/* ========================================
   ENHANCED NAVBAR - PROMINENT & MODERN
   Sticky, scroll effects, premium design
   ======================================== */

/* Navbar Container */
/* Navbar Container - Floating Pill */
.navbar {
    position: fixed !important;
    top: 20px !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    width: 95% !important;
    max-width: 1200px !important;
    padding: 10px 0 !important;
    /* Premium Deep Tech Gradient Background */
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.85) 0%, rgba(17, 34, 64, 0.9) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Subtle Teal Border Glow */
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-top: 1px solid rgba(100, 255, 218, 0.3);
    /* Highlight top border */
    border-radius: 50px;
    border-radius: 50px;
    z-index: 10000;
    /* Higher than noise overlay (9999) */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Deep Shadow with faint Teal Glow */
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7),
        0 0 20px rgba(100, 255, 218, 0.05);
    transform: none !important;

    /* Hardening */
    display: flex;
    justify-content: center;
}

/* Scrolled State - Compact Pill */
.navbar.scrolled {
    top: 15px !important;
    padding: 8px 0 !important;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.95) 0%, rgba(2, 12, 27, 0.98) 100%) !important;
    border-color: rgba(100, 255, 218, 0.25);
    box-shadow: 0 10px 30px -5px rgba(2, 12, 27, 0.8),
        0 0 25px rgba(100, 255, 218, 0.1);
    /* Stronger glow on scroll */
    max-width: 1100px !important;
}

/* Navbar Layout */
.nav-center-layout {
    width: 100%;
    margin: 0 auto !important;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 50px;
    /* Fixed height for consistency */
}

/* Logo - Center Position */
.logo-center {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    /* Ensure no margins */
}

.logo-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.nav-logo-img {
    height: 40px;
    /* Slightly smaller for pill */
    width: auto;
    filter: drop-shadow(0 0 10px rgba(100, 255, 218, 0.3));
    transition: all 0.3s ease;
}

.navbar.scrolled .nav-logo-img {
    height: 36px;
    filter: drop-shadow(0 0 15px rgba(100, 255, 218, 0.4));
}

/* Navigation Groups */
.nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Standard gap */
    z-index: 5;
    flex-shrink: 0;
    /* Prevent group shrinking */
}

.group-left {
    justify-content: flex-start;
    min-width: 300px;
    /* Ensure space for links */
}

.group-right {
    justify-content: flex-end;
    min-width: 300px;
    /* Ensure space for right items */
}

/* Navigation Links */
.nav-links a {
    position: relative;
    padding: 8px 20px;
    color: #cbd5e1;
    /* Softer white for better contrast */
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    /* Rounded pill hover */

    /* Hardening Layout fixes */
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0 2px;
    /* Fallback spacing */
}

/* Hover Effect */
.nav-links a:hover {
    color: #64ffda;
    /* Signature Teal */
    background: rgba(100, 255, 218, 0.08);
    transform: translateY(-1px);
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

/* Active Link - More Prominent */
.nav-links a[aria-current="page"],
.nav-links a.active-link {
    color: #64ffda !important;
    background: rgba(100, 255, 218, 0.12);
    box-shadow: inset 0 0 10px rgba(100, 255, 218, 0.1);
    font-weight: 600;
}

/* Underline Animation */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--color-secondary),
            transparent);
    transition: transform 0.3s ease;
}

.nav-links a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* CTA Button - Prominent */
.nav-btn,
.pill-btn {
    padding: 10px 28px !important;
    /* Vibrant Teal Gradient */
    background: linear-gradient(135deg, #64ffda 0%, #43c6ac 100%);
    color: #0a192f !important;
    /* Dark Navy Text */
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* Prevent squashing */
    white-space: nowrap;
}

.nav-btn:hover,
.pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 255, 218, 0.6), 0 0 15px rgba(100, 255, 218, 0.4);
    background: linear-gradient(135deg, #7affea 0%, #5ce1c6 100%);
    /* Lighter on hover */
}

.nav-btn:active,
.pill-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Glow Effect on Scroll */
.navbar.scrolled .nav-btn,
.navbar.scrolled .pill-btn {
    box-shadow: 0 4px 20px rgba(100, 255, 218, 0.4),
        0 0 30px rgba(100, 255, 218, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(100, 255, 218, 0.4),
            0 0 30px rgba(100, 255, 218, 0.3);
    }

    50% {
        box-shadow: 0 4px 25px rgba(100, 255, 218, 0.5),
            0 0 40px rgba(100, 255, 218, 0.4);
    }
}

/* Body Padding - REMOVED to prevent background bar effect */
body {
    padding-top: 0 !important;
}

body.scrolled {
    padding-top: 0 !important;
}

/* ========================================
   DESKTOP RESPONSIVE
   ======================================== */

@media (max-width: 1400px) {
    .nav-center-layout {
        padding: 0 30px;
    }

    .nav-links a {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    .nav-links a {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .nav-btn,
    .pill-btn {
        padding: 10px 24px !important;
        font-size: 0.9rem;
    }
}

/* ========================================
   TABLET & MOBILE
   ======================================== */

@media (max-width: 992px) {
    .nav-center-layout {
        padding: 0 20px;
    }
}

/* Mobile Menu - Ensure compatibility */
@media (max-width: 768px) {

    /* Hide desktop nav links */
    .nav-group.nav-links,
    .nav-group.group-left,
    .nav-group.group-right {
        display: none !important;
    }

    /* Show mobile toggle */
    .mobile-toggle {
        display: flex !important;
        position: relative;
        z-index: 10001;
        margin-left: auto;
        /* Push to right */
    }

    /* Adjust navbar for mobile */
    .navbar {
        width: 92% !important;
        top: 15px !important;
        padding: 8px 0 !important;
        border-radius: 40px;
    }

    /* Logo positioning on mobile - Move to Left for better mobile UX or keep centered */
    .logo-center {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-right: auto;
        /* Push to left */
    }

    .logo-center:hover {
        transform: scale(1.05);
    }

    .nav-center-layout {
        padding: 0 20px;
        justify-content: flex-start;
        /* Align items for mobile */
    }

    .nav-logo-img {
        height: 32px !important;
    }

    /* Prevent mobile menu overlay from covering floating nav */
    .mobile-menu-overlay {
        top: 0;
        z-index: 999 !important;
        /* Behind navbar */
    }

    /* Ensure close button in menu works */
    /* Ensure close button in menu works */
    .mobile-menu-content {
        padding-top: 100px;
    }

    /* Ensure mobile menu overlay works */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 10000 !important;
        display: flex;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        backdrop-filter: blur(15px);
        /* Stronger blur for deep tech feel */
        background: rgba(10, 25, 47, 0.95);
        /* Deep blue tint */
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Body padding adjustment for mobile */
    body {
        padding-top: 60px;
    }
}

/* ========================================
   ACCESSIBILITY & INTERACTIONS
   ======================================== */

/* Focus States */
.nav-links a:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 4px;
    background: rgba(100, 255, 218, 0.12);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .navbar,
    .nav-links a,
    .nav-btn,
    .pill-btn,
    .nav-logo-img {
        transition: none !important;
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .navbar {
        background: rgba(10, 25, 47, 1);
        border-bottom: 2px solid var(--color-secondary);
    }

    .nav-links a {
        border: 1px solid transparent;
    }

    .nav-links a:hover,
    .nav-links a:focus {
        border-color: var(--color-secondary);
    }
}