/* ===========================================
   SIMPLIFIED NAVIGATION - VfL WOLFSBURG
   Clean <a> link structure (no ul/li)
   =========================================== */

/* DESKTOP NAVIGATION - HORIZONTAL LAYOUT */

/* Hide mobile menu toggle on desktop by default */
.mobile-menu-toggle {
    display: none;
}

/* Hide mobile socials on desktop */
.mobile-socials {
    display: none;
}

/* Header content layout */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    width: 90vw;
}

/* Site branding (logo + title) */
.site-branding {
    display: flex;
    align-items: center;
}

/* Logo and title layout */
.logo-and-title {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-title-wrapper {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-family: "Open Sans", sans-serif;
    font-weight: normal;
    font-style: normal;
    color: #fff;
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Make "WOLFSBURG" semibold using CSS */
.site-title {
    position: relative;
}

/* Style for making second word semibold */
.site-title-semibold {
    font-weight: 600; /* Semibold for "WOLFSBURG" */
}

.site-logo, .custom-logo {
    max-height: 40px;
    width: auto;
}

/* Main navigation container - HORIZONTAL */
.main-navigation {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push navigation to the right */
}

/* Navigation links container - SIMPLE FLEXBOX */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0; /* Reduced gap to 0 as requested */
}

/* Navigation links - CLEAN STYLING */
.nav-link {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    padding: 0.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Reset button styling for dropdown toggles */
button.nav-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hover effects */
.nav-link:hover {
    color: var(--light-green);
    background-color: rgba(64, 166, 57, 0.1);
}

/* Active page styling */
.nav-link.active,
.nav-link:focus {
    color: var(--light-green);
    background-color: rgba(64, 166, 57, 0.1);
    outline: 2px solid var(--light-green);
    outline-offset: 2px;
}

/* External link styling (for Fanshop) - Universal new tab icon */
.nav-link.external-link:after {
    content: " ⧉"; /* Universal new tab/external link icon */
    font-size: 0.9rem;
    opacity: 0.8;
    margin-left: 0.4rem;
    font-weight: normal;
}

/* Hide channels menu when it doesn't fit (< 1320px) */
@media (max-width: 1319px) {
    .header-content > .channels-wrapper {
        display: none !important;
    }

    /* When channels hidden on desktop, push nav to far right */
    .navigation-wrapper,
    .main-navigation {
        margin-left: auto;
        margin-right: 0;
    }
}

/* MOBILE & TABLET RESPONSIVE (max-width: 1200px) */
@media (max-width: 1200px) {
    /* Hide page scroll when mobile menu is open */
    body:has(.main-navigation.active),
    html:has(.main-navigation.active) {
        overflow: hidden !important;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--dark-green);
        cursor: pointer;
        padding: 0.5rem;
        margin-left: auto;
        z-index: 10000; /* Above navigation overlay */
        position: relative;
        border-radius: 4px;
        transition: background-color 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background-color: rgba(64, 166, 57, 0.1);
    }
    
    /* Navigation wrapper on mobile - hidden by default, only shows when menu is active */
    .navigation-wrapper {
        display: none;
        position: static;
        width: auto;
        height: auto;
        pointer-events: none;
        z-index: 9998;
    }

    /* When menu is active, show the wrapper as fixed overlay */
    .navigation-wrapper:has(.main-navigation.active) {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        pointer-events: auto;
    }

    /* FULL SCREEN MOBILE MENU OVERLAY - hidden by default */
    .main-navigation {
        display: none !important;
        visibility: hidden;
        opacity: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.97);
        z-index: 998;
        overflow-y: auto;
        padding-top: 90px; /* Space for header */
    }

    /* Show navigation when active - full screen */
    .main-navigation.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-direction: column;
        align-items: center;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background-color: rgba(0, 0, 0, 0.97) !important;
        z-index: 9999 !important;
        overflow-y: auto;
        padding-top: 90px;
    }

    /* Mobile menu - vertical layout centered */
    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 2rem 1.5rem;
        align-items: stretch;
        width: 100%;
        max-width: 400px;
    }

    /* WordPress wraps menu items in a <ul> - style it for mobile */
    .nav-links > ul,
    .nav-links > menu {
        display: flex !important;
        flex-direction: column !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        gap: 0 !important;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        text-align: left;
        font-size: 0.9rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        margin: 0;
        color: #ffffff !important;
        font-weight: 500;
    }

    .nav-link:hover {
        color: var(--light-green) !important;
        background-color: rgba(255, 255, 255, 0.05);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Nav dropdown wrapper - ensure proper stacking on mobile */
    .nav-dropdown,
    .mega-menu-trigger {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Expanded dropdown button styling */
    .mega-menu-trigger[aria-expanded="true"] > .nav-link,
    .mega-menu-trigger[aria-expanded="true"] > .dropdown-toggle {
        color: var(--light-green) !important;
        background-color: rgba(64, 166, 57, 0.15);
        border-bottom: none;
        position: relative;
        z-index: 2; /* Keep button and its outline above the mega-menu */
    }

    /* Mega menu content - hidden by default on mobile */
    .mega-menu-trigger .mega-menu {
        display: none !important;
        background: rgba(30, 30, 30, 0.95);
        border-radius: 0;
        margin: 0;
        padding: 1rem;
        position: relative;
        z-index: 1; /* Below the button */
    }

    /* Show mega menu only when expanded */
    .mega-menu-trigger[aria-expanded="true"] .mega-menu {
        display: block !important;
    }

    /* Header adjustments for mobile */
    .header-content {
        flex-wrap: nowrap;
        position: relative;
    }
    
    /* Mobile logo and title adjustments */
    .logo-and-title {
        gap: 1rem;
        flex-shrink: 1;
        min-width: 0;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .site-logo, .custom-logo {
        max-height: 40px;
    }

    /* Hide channels/socials in header on mobile - they'll be in the menu */
    .header-content > .channels-wrapper {
        display: none !important;
    }

    /* Show channels/socials inside the mobile menu when open */
    .main-navigation.active ~ .channels-wrapper,
    .navigation-wrapper:has(.main-navigation.active) ~ .channels-wrapper {
        display: none !important;
    }

    /* Style the channels navigation inside the mobile menu */
    .main-navigation .channels-navigation,
    .main-navigation.active + .channels-wrapper .channels-navigation {
        display: flex;
        justify-content: center;
        padding: 1.5rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        margin-top: 1rem;
    }

    .main-navigation .channels-navigation .nav-links {
        display: flex;
        justify-content: center;
        gap: 1.5rem;
    }

    .main-navigation .channels-navigation .nav-link {
        color: #ffffff !important;
        padding: 0.5rem;
        border-bottom: none !important;
        width: auto !important;
    }

    .main-navigation .channels-navigation .nav-link:hover {
        color: var(--light-green) !important;
    }

    /* Mobile socials inside burger menu */
    .mobile-socials {
        display: flex;
        justify-content: center;
        padding: 2rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        margin-top: 1rem;
        width: 100%;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .mobile-socials ul {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        list-style: none;
        padding: 0;
        margin: 0;
        flex-wrap: wrap;
    }

    .mobile-socials li {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-socials .nav-link,
    .mobile-socials .social-icon-link {
        color: #ffffff !important;
        padding: 0 !important;
        border-bottom: none !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border-radius: 4px;
        transition: color 0.3s ease, background-color 0.3s ease;
    }

    .mobile-socials .nav-link:hover,
    .mobile-socials .social-icon-link:hover {
        color: var(--light-green) !important;
        background: rgba(64, 166, 57, 0.1) !important;
    }

    /* SVG icon styling */
    .mobile-socials .nav-link svg,
    .mobile-socials .social-icon-link svg {
        width: 20px;
        height: 20px;
        display: block;
        fill: currentColor;
    }

    .site-branding {
        flex-shrink: 1;
        min-width: 0;
    }
}

/* TABLET SCREENS - wider nav buttons */
@media (min-width: 768px) and (max-width: 1200px) {
    .nav-links {
        max-width: 600px;
    }

    .mobile-socials {
        max-width: 600px;
    }
}

/* EXTRA SMALL SCREENS (max-width: 480px) */
@media (max-width: 480px) {
    .logo-and-title {
        flex-direction: row;
        gap: 0.5rem;
        text-align: center;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .site-logo, .custom-logo {
        max-height: 40px;
    }

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

/* ACCESSIBILITY FOCUS STATES */
.nav-link:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid var(--light-green);
    outline-offset: 2px;
}

/* SMOOTH ANIMATIONS */
.main-navigation,
.nav-links,
.nav-link {
    transition: all 0.3s ease;
}

/* ACTIVE PAGE DETECTION (for current page highlighting) */
body.page-sport .nav-link[href*="sport"],
body.page-kurs .nav-link[href*="kurs"],
body.page-wer-wir-sind .nav-link[href*="wer-wir-sind"],
body.page-kultur .nav-link[href*="kultur"],
body.page-trainingsplan .nav-link[href*="trainingsplan"] {
    color: var(--light-green);
    background-color: rgba(64, 166, 57, 0.1);
}

/* Dark Mode - Mobile Menu Toggle */
@media (prefers-color-scheme: dark) {
    .mobile-menu-toggle {
        color: #ffffff;
    }
}

[data-theme="dark"] .mobile-menu-toggle,
.dark-mode .mobile-menu-toggle {
    color: #ffffff;
}
