/* =====================
   Modern Navigation
   ===================== */
/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Account for fixed header */
}

/* For browsers that don't support smooth scrolling */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

:root {
    /* Colors */
    --primary: #0a4a0a;        /* Dark green - primary brand color */
    --primary-light: #0f5a0f;  /* Lighter green for hover states */
    --accent: #ff9000;         /* Orange accent color */
    --accent-hover: #ffa733;   /* Lighter orange for hover */
    --text: #333;              /* Main text color */
    --text-light: #666;        /* Lighter text */
    --bg: #fff;                /* Background color */
    --bg-light: #f8f9fa;       /* Light background */
    --border: rgba(0, 0, 0, 0.1); /* Border color */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 80px;     /* Desktop header height */
    --header-height-mobile: 70px; /* Mobile header height */
}

/* Skip Link (for keyboard navigation) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 1001;
    transition: transform 0.3s;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(40px);
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Main Header with Glassmorphism Effect */
.main-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    transition: var(--transition);
    will-change: transform, background, backdrop-filter, box-shadow;
}

/* Sticky header on scroll */
.main-header.scrolled {
    height: var(--header-height-mobile);
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

/* Add smooth transition for the glass effect */
.main-header,
.main-header * {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
    transition: var(--transition);
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 6px;
    margin-right: 12px;
    transition: var(--transition);
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    transition: var(--transition);
}

/* Smooth scroll behavior for anchor links */
a[href^="#"] {
    transition: color 0.3s ease;
}

a[href^="#"]:not([href="#"]) {
    scroll-margin-top: 100px; /* Account for fixed header */
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    margin-left: 2rem;
    gap: 1.5rem;
}

/* Enroll Now CTA Button */
.nav-cta {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #0a6a0a, #0a4a0a);
    color: white !important;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(10, 106, 10, 0.2);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 106, 10, 0.3);
    background: linear-gradient(135deg, #0a7a0a, #0a5a0a);
}

.nav-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(10, 106, 10, 0.3);
}

.nav-cta .cta-text {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.nav-cta .cta-icon {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.nav-cta:hover .cta-icon {
    transform: translateX(4px);
}

/* Mobile styles for CTA */
@media (max-width: 1024px) {
    .main-nav .nav-cta {
        display: none; /* Hide on mobile - we'll show it in the mobile menu */
    }
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
    color: var(--text);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    transition: var(--transition);
    position: relative;
}

.link-text {
    position: relative;
    z-index: 1;
    padding: 0.5rem 0.75rem;
}

.link-underline {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover .link-underline,
.nav-link:focus .link-underline,
.nav-link.active .link-underline {
    width: 70%;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-login {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-login:hover,
.btn-login:focus {
    background: rgba(10, 74, 10, 0.05);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 74, 10, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 74, 10, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1002;
    position: relative;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    transition: var(--transition);
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    position: absolute;
    transition: var(--transition);
    border-radius: 2px;
}

.menu-icon::before {
    transform: translateY(-8px);
}

.menu-icon::after {
    transform: translateY(8px);
}

/* Mobile Navigation Overlay with Glassmorphism */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu */
@media (max-width: 1024px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-left: 1px solid rgba(255, 255, 255, 0.3);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 2rem 2rem;
        margin: 0;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-link {
        padding: 1rem 0;
        font-size: 1.1rem;
        color: var(--text);
    }

    .link-underline {
        display: none;
    }

    .nav-link:hover,
    .nav-link:focus,
    .nav-link.active {
        color: var(--primary);
        background: rgba(10, 74, 10, 0.08);
        border-radius: 8px;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        margin: 2rem 0 1rem;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        padding: 0.85rem 1.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
        margin-left: 1rem;
    }

    /* Animate menu icon to X when active */
    .mobile-menu-toggle.active .menu-icon {
        background: transparent;
    }

    .mobile-menu-toggle.active .menu-icon::before {
        transform: rotate(45deg);
    }

    .mobile-menu-toggle.active .menu-icon::after {
        transform: rotate(-45deg);
    }

    /* Adjust header height on mobile */
    .main-header {
        height: var(--header-height-mobile);
    }

    .logo-img {
        height: 36px;
    }

    .logo-text {
        font-size: 1.3rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .main-header .container {
        padding: 0 1.25rem;
    }

    .logo-text {
        display: none;
    }

    .nav-link {
        font-size: 1rem;
    }
}

/* Sticky Header on Scroll */
.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Focus styles for keyboard navigation */
.nav-link:focus-visible,
.btn:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
