/* --- UNIVERSAL NAVBAR CSS (REDESIGN) --- */

/* Base Variables required if not already defined in root */

/* 1. Navbar Container */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 25px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Transparent Start - "Floating" Effect */
    background: transparent;
    backdrop-filter: blur(0px);
    /* Transitionable property */
    box-shadow: none;
}

/* 2. Scrolled State - "Glass" Effect */
.navbar.scrolled {
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 3. Brand Styling */
.brand {
    font-family: var(--font-heading, 'Fredoka', sans-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary, #5A8DEE) !important;
    /* Force Blue Globally */
    /* Default White for Hero overlap REMOVED */
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    transition: color 0.4s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 80px;
    /* Increased separation */
}

.navbar.scrolled .brand {
    color: var(--color-primary-dark, #3F72D3);
    text-shadow: none;
}

.brand-logo {
    width: 55px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    /* Shadow for ensuring visibility on light images */
    transition: filter 0.4s ease;
}

.navbar.scrolled .brand-logo {
    filter: none;
}

.brand span {
    color: var(--color-secondary, #89D934);
    /* Keep the 'Nutrition' green always? Or white at top? 
       Let's keep it Green but add a shadow for contrast at the top. */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 4. Desktop Navigation Links */
.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: nowrap;
}

.desktop-only {
    display: flex;
}

.nav-link {
    font-family: var(--font-body, 'Quicksand', sans-serif);
    font-weight: 600;
    /* Slightly bolder for legibility on images */
    font-size: 1rem;
    position: relative;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.9);
    /* White text at top */
    transition: color 0.3s ease;
    white-space: nowrap;
    border-bottom: none !important;
    /* Prevent legacy underlines */
    text-decoration: none !important;
}

.navbar.scrolled .nav-link {
    color: var(--color-text, #2C3E50);
    /* Dark text on scroll */
}

/* Hover Effect: Pill Shape */
.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    height: 100%;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.nav-link:hover {
    color: white;
}

.nav-link:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.navbar.scrolled .nav-link:hover {
    color: var(--color-primary, #5A8DEE);
}

.navbar.scrolled .nav-link::before {
    background: rgba(90, 141, 238, 0.1);
    /* Light blue tint on white bg */
}

/* Active State */
.nav-link.active {
    color: white;
}

.nav-link.active::after {
    /* Dot indicator */
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--color-secondary, #89D934);
    border-radius: 50%;
}

.navbar.scrolled .nav-link.active {
    color: var(--color-primary, #5A8DEE);
}

/* 4b. Dropdown Styles (New) */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.80);
    /* More transparent (was 0.95) */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    min-width: 220px;
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    /* Slightly subtler border */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    padding: 10px 15px;
    color: var(--color-text, #2C3E50);
    text-decoration: none !important;
    font-family: var(--font-body, 'Quicksand', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--color-secondary-light, #E9F7D9);
    color: var(--color-primary, #5A8DEE);
    padding-left: 20px;
    /* Slide effect */
}

/* Ensure arrows or indicators look good */
.nav-link svg {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.dropdown:hover .nav-link svg {
    transform: rotate(180deg);
}

/* 5. CTA Button in Navbar */
/* We target the .btn class inside navbar specifically */
/* 5. CTA Button in Navbar */
/* We target the .btn class inside navbar specifically */


@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(137, 217, 52, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(137, 217, 52, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(137, 217, 52, 0);
    }
}



/* --- GLOBAL BUTTON STYLES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none !important;
    font-family: var(--font-heading, 'Fredoka', sans-serif);
}

.btn-primary {
    background: var(--color-primary, #5A8DEE);
    color: white !important;
    box-shadow: 0 10px 25px rgba(90, 141, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(90, 141, 238, 0.4);
    background: var(--color-primary-dark, #3F72D3);
    color: white !important;
}

.btn-secondary {
    background: white;
    color: var(--color-primary, #5A8DEE) !important;
    border: 2px solid var(--color-primary, #5A8DEE);
}

.btn-secondary:hover {
    background: var(--color-primary, #5A8DEE);
    color: white !important;
    transform: translateY(-2px);
}

/* Global Pulse Animation Class */
.btn-pulse {
    animation: pulse-glow 2s infinite;
    box-shadow: 0 4px 15px rgba(137, 217, 52, 0.3);
}

.btn-pulse:hover {
    animation: none;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(137, 217, 52, 0.6);
}


/* --- MOBILE MENU (RE-ENGINEERED) --- */
.mobile-menu-btn {
    display: none;
    /* Hidden on desktop by default */
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2002;
    /* Top of the stack */
    padding: 10px;
    position: relative;
    /* Ensure z-index applies */
}

.mobile-menu-btn span {
    display: block;
    width: 32px;
    /* Slightly wider */
    height: 4px;
    /* Thicker for visibility */
    background-color: #FF6B35;
    /* VIBRANT ORANGE */
    margin: 6px 0;
    transition: all 0.3s ease-in-out;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Force Orange in ALL states to ensure visibility */
.navbar.scrolled .mobile-menu-btn span,
.navbar-inverse .mobile-menu-btn span {
    background-color: #FF6B35 !important;
}

.mobile-menu-btn.open span {
    background-color: #FF6B35 !important;
}

/* Animation to X */
.mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -8px);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    z-index: 2001;
    /* Just below the button */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 35px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.mobile-menu-overlay.open {
    right: 0;
}

.mobile-nav-link {
    font-size: 1.8rem;
    font-family: var(--font-heading, 'Fredoka', sans-serif);
    font-weight: 700;
    color: var(--color-text, #2C3E50);
    text-decoration: none !important;
    transition: transform 0.2s, color 0.2s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--color-primary, #5A8DEE);
    transform: scale(1.05);
}

/* --- FOOTER --- */
footer {
    background: #121a22;
    color: white;
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
    margin: 0 15px;
    transition: color 0.3s ease;
    display: inline-block;
}

.footer-nav-link:hover {
    color: var(--color-secondary, #89D934) !important;
}

/* --- NAVBAR INVERSE (For Light Background Pages) --- */
/* Use this class on pages with white/light hero sections */
.navbar-inverse .brand {
    color: var(--color-primary, #5A8DEE);
    text-shadow: none;
}

.navbar-inverse .brand-logo {
    filter: none;
}

.navbar-inverse .nav-link {
    color: var(--color-text, #2C3E50);
}

.navbar-inverse .nav-link::before {
    background: rgba(90, 141, 238, 0.1);
}

.navbar-inverse .nav-link:hover {
    color: var(--color-primary, #5A8DEE);
}

.navbar-inverse .nav-link.active {
    color: var(--color-primary, #5A8DEE);
}

/* Mobile Toggle for Inverse */
.navbar-inverse .mobile-menu-btn span {
    background-color: var(--color-primary, #5A8DEE);
}

/* Scrolled state handles itself (White BG, Dark Text) so no overrides needed there. */


/* Mobile Utility to hide elements */
@media (max-width: 1350px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 25px;
        top: 50%;
        /* Center vertically */
        transform: translateY(-50%);
        /* Adjust for own height */
        margin: 0;
    }

    .navbar .btn {
        display: none;
    }
}

/* --- LIQUID ANIMATION (Global) --- */
.btn-liquid {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.4s ease-in-out;
    background: transparent !important;
    /* Force transparent so liquid shows */
}

/* Base Background (Behind everything) */
.btn-liquid::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    border-radius: 50px;
    transition: all 0.4s ease;
}

/* Map Base Colors */
.btn-primary.btn-liquid::after {
    background: var(--color-primary, #5A8DEE);
}

.btn-secondary.btn-liquid::after {
    background: white;
}

/* Green Button Variant (Green Background, Blue Liquid) */
.btn-green.btn-liquid::after {
    background: var(--color-secondary, #89D934);
}

.btn-green.btn-liquid::before {
    background: var(--color-primary, #5A8DEE);
    /* Blue Liquid */
}

/* Ensure Blue Text is always visible (Default state) */
.btn-green.btn-liquid {
    color: var(--color-primary-dark, #3F72D3) !important;
}

.btn-green.btn-liquid:hover {
    color: white !important;
}

/* White Button Variant (Base Color) */
.btn-white.btn-liquid::after {
    background: white;
}

/* Ensure text is Blue by default (so it shows on white bg) */
.btn-white.btn-liquid {
    color: var(--color-primary-dark, #3F72D3) !important;
}

/* White Button uses Green Liquid (Standard) */
.btn-white.btn-liquid::before {
    background: var(--color-secondary, #89D934);
}

.btn-white.btn-liquid:hover {
    color: var(--color-primary-dark, #3F72D3) !important;
}

/* The Liquid Wave (Green by Default) */
.btn-liquid::before {
    content: "";
    position: absolute;
    top: 200%;
    left: 50%;
    width: 500px;
    height: 500px;
    z-index: -1;
    border-radius: 40%;
    transform: translateX(-50%) rotate(0deg);
    transition: top 1.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    /* Speeded up from 2.5s (Slightly faster global) */
    animation: waveSpin 6s linear infinite;
    opacity: 0;
    background: var(--color-secondary, #89D934);
    /* Green Liquid */
}

.btn-liquid:hover::before {
    top: -50px;
    opacity: 1;
}

.btn-liquid:hover {
    color: var(--color-primary-dark, #3F72D3) !important;
    box-shadow: 0 10px 20px rgba(137, 217, 52, 0.4);
}

@keyframes waveSpin {
    from {
        transform: translateX(-50%) rotate(0deg);
    }

    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

/* --- GLOBAL TEXT ANIMATIONS (Moved from Index) --- */
.colourful-text {
    background: linear-gradient(to right, #5A8DEE, #89D934, #5A8DEE);
    /* Brand Blue -> Brand Green -> Brand Blue Loop */
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    animation: gradientFlow 3s linear infinite, fadeInScale 0.8s ease-out forwards;
    /* Faster flow (3s) for more dynamic feel */
    opacity: 0;
    display: inline-block;
}

@keyframes gradientFlow {
    to {
        background-position: 200% center;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}