html, body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent default body scrolling */
    font-family: 'Inter', sans-serif;
    background-color: #f0f9ff; /* Base background color */
}

#hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#slider-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}

/* Hide scrollbar */
#slider-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
#slider-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.slide {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-y: auto; /* Allow content to scroll if it overflows a slide */
    overflow-x: hidden;
    background-color: transparent;
}

.hero-section > * {
    position: relative;
    z-index: 10;
}
.text-shadow {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* New Vibrant Color Scheme based on Air Selangor Logo */
.brand-primary-dark { color: #0b2d48; } /* A deep, modern navy blue */
.bg-brand-primary-dark { background-color: #0b2d48; }
.brand-aqua { color: #00a9e0; } /* Vibrant aqua from the logo */
.bg-brand-aqua { background-color: #00a9e0; }
.brand-lime { color: #8dc63f; } /* Fresh lime green from the logo */
.bg-brand-lime { background-color: #8dc63f; }

/* Custom animation for pipeline drawing */
.pipeline-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: draw-pipeline 3s ease-in-out forwards;
}
.aos-animate .pipeline-path {
    animation-play-state: running;
}
@keyframes draw-pipeline { to { stroke-dashoffset: 0; } }

/* For the animated timeline */
.timeline-progress {
    transform-origin: left;
    transition: transform 1.5s ease-out;
    transform: scaleX(0);
}
.aos-animate .timeline-progress { transform: scaleX(1); }

/* FLOATING NAVIGATION STYLES */
.floating-nav {
    position: fixed;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    z-index: 50;
}
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
}
.nav-link:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.nav-link.active {
    background-color: #00a9e0; /* brand-aqua */
    color: white;
    transform: scale(1.1);
}
.nav-tooltip {
    position: absolute;
    left: 120%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    padding: 0.5rem 1rem;
    background-color: #0b2d48; /* brand-primary-dark */
    color: white;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}
.nav-link:hover .nav-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* MOBILE MENU STYLES */
#mobile-nav-button {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 45, 72, 0.95);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* QR Code Modal Styles */
#qr-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#qr-code-container {
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
}
.card-bg {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

/* Team & Timeline Modal Styles */
#team-modal-overlay, #timeline-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#team-modal-overlay.open, #timeline-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
#team-modal-content, #timeline-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* --- Inactive UI States for Focus Mode (Slide Animation) --- */

/* Add a smooth transform transition to the navigation elements */
.floating-nav, #footer-nav {
    transition: transform 0.4s cubic-bezier(0.6, -0.28, 0.74, 0.05);
}

/* Create the 'hint' arrows using pseudo-elements */
.floating-nav::after, #footer-nav::after {
    content: '';
    position: absolute;
    opacity: 0;
    /* Delay the hint's appearance slightly */
    transition: opacity 0.3s ease-in-out 0.2s;
    pointer-events: none;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #0b2d48; /* brand-primary-dark */
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Style the sidebar's right-pointing arrow hint */
.floating-nav::after {
    content: '›';
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 40px;
    border-radius: 0 8px 8px 0;
}

/* Style the footer's upward-pointing arrow hint */
#footer-nav::after {
    content: 'ˆ';
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 25px;
    border-radius: 8px 8px 0 0;
    line-height: 1;
}

/* Define the hidden state by sliding elements off-screen */
.floating-nav.inactive-ui {
    /* It's already transformed with translateY, so we add translateX */
    transform: translateY(-50%) translateX(-100%);
}
#footer-nav.inactive-ui {
    /* It's already transformed with translateX, so we add translateY */
    transform: translateX(-50%) translateY(100%);
}

/* Show the hint arrows only when the UI is inactive */
.floating-nav.inactive-ui::after,
#footer-nav.inactive-ui::after {
    opacity: 1;
}

/* Bring the elements back into view on hover */
.floating-nav.inactive-ui:hover {
    transform: translateY(-50%) translateX(0);
}
#footer-nav.inactive-ui:hover {
    transform: translateX(-50%) translateY(0);
}

/* TIMELINE MODAL SPECIFIC STYLES */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid #e2e8f0; /* light grey */
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}
.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 5px;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #00a9e0; /* brand-aqua */
    border: 4px solid white;
}

.timeline-content {
    padding-left: 1.5rem;
}

.slide-background {
    position: absolute;
    top: 40px; /* Moved logos higher up the page */
    width: 100%;
    height: 100%;
    align-content: space-evenly;
    z-index: -1;
    background-image:
            url('new.png'),
            url('new_logo.png');
    background-repeat: no-repeat;
    /* Adjusted positions to bring logos closer together */
    background-position: left 5% top, right 5% top;
    background-size: 200px, 250px; /* Slightly reduced size */
    opacity: 0.8;
}


/* --- Thematic Slide Backgrounds --- */

.slide.aos-animate .slide-background {
    opacity: 1.2; /* A very subtle effect */
}




/* --- Interactive Pipeline Styles --- */

/* Style for the individual station nodes */
.station-node {
    width: 80px;
    height: 80px;
    background-color: #f0f9ff; /* light sky color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    color: #00a9e0; /* brand-aqua */
    z-index: 10;
    position: relative; /* Ensure nodes are on top */
}

/* Style for the lime-colored nodes */
.station-node.brand-lime-bg {
    color: #8dc63f; /* brand-lime */
}

/* The water flow animation setup */
.pipeline-water {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

/* Define the looping animation using keyframes */
@keyframes flow-animation {
    from {
        stroke-dashoffset: 2000; /* Start empty */
    }
    to {
        stroke-dashoffset: 0; /* End full */
    }
}

/* The class that triggers the animation */
#pipeline-container.animate .pipeline-water {
    /* Apply the keyframe animation */
    animation-name: flow-animation;
    animation-duration: 8s; /* Slower fill time */
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite; /* Loop forever */
    animation-direction: alternate; /* This makes it flow in, then flow back out */
}

/* --- New "Forming Droplet" Animation --- */

/* 1. The Main Container & Positioning */
.floating-interactive-drop {
    position: absolute;
    top: 55%;
    right: -220px; /* Your sweet spot positioning */
    transform: translateY(-65%); /* Your sweet spot positioning */
    z-index: 20;
}

.drop-link-area {
    display: block;
    width: 150px;
    height: 180px;
    cursor: pointer;
    text-decoration: none;
}

.drop-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 2. The Animation Elements */
.falling-drop {
    position: absolute;
    width: 25px; /* Make it small */
    height: auto;
    opacity: 0; /* Starts invisible */
    /* Link to the 'fall' animation */
    animation: fall 4s infinite cubic-bezier(0.55, 0.09, 0.68, 0.53);
}

.drop-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Link to the 'ripple' animation */
    animation: ripple 4s infinite ease-in-out;
}

.drop-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0px 10px 15px rgba(11, 45, 72, 0.2));
}

.drop-text {
    position: relative;
    z-index: 10;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    /* Link to the 'text-reveal' animation */
    animation: text-reveal 4s infinite ease-in-out;
}

/* 3. The Keyframe Sequences */
@keyframes fall {
    0%, 15%, 100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.6);
    }
    25% { /* Appears and starts falling */
        opacity: 1;
    }
    40% { /* Hits the main drop */
        transform: translateY(20px) scale(0.6);
        opacity: 1;
    }
    41% { /* Disappears on impact */
        opacity: 0;
        transform: translateY(20px) scale(0.6);
    }
}

@keyframes ripple {
    0%, 40%, 100% { /* Idle state */
        transform: scale(1);
    }
    43% { /* Impact squash */
        transform: scale(1.15, 0.85);
    }
    47% { /* Bounce back */
        transform: scale(0.9, 1.1);
    }
    53% { /* Settle */
        transform: scale(1.05, 0.95);
    }
    60% { /* Back to normal */
        transform: scale(1);
    }
}

@keyframes text-reveal {
    0%, 50%, 100% { /* Hidden state */
        opacity: 0;
        transform: translateY(10px);
    }
    60% { /* Fades in after ripple */
        opacity: 1;
        transform: translateY(0);
    }
    90% { /* Stays visible for a while */
        opacity: 1;
        transform: translateY(0);
    }
}

/* 4. Hover Interaction */
.drop-link-area:hover .drop-container {
    transform: scale(1.15); /* Enlarge the whole element */
}
/* Pause all animations on hover */
.drop-link-area:hover .falling-drop,
.drop-link-area:hover .drop-shape,
.drop-link-area:hover .drop-text {
    animation-play-state: paused;
}
/* Ensure text is visible on hover, even if paused while invisible */
.drop-link-area:hover .drop-text {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mobile Responsiveness Fixes --- */
@media (max-width: 767px) {
    .slide {
        /* Aligns content to the top on mobile instead of centering it vertically */
        align-items: flex-start;
        /* Adds some breathing room for scrolling content */
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    .slide-background {
        /* Use top-left and top-right positioning */
        background-position: top 1rem left 1rem, top 1rem right 1rem;
        /* Significantly reduce logo size on mobile */
        background-size: 100px, 120px;
        /* Lower opacity for better text readability */
        opacity: 0.1;
        /* Reset top position for mobile layout */
        top: 0;
    }
    .floating-interactive-drop {
        /* Reset positioning to be relative to the content flow */
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        /* Center the droplet and add top margin */
        margin: 3rem auto 0;
        /* Make it slightly smaller on mobile */
        transform: scale(0.9);
    }
}


