/* Mobile Navigation Fix - Ensures navbar stays on top */

@media (max-width: 768px) {
    /* Force all page content to stay behind navbar */
    body {
        position: relative !important;
    }

    /* Navbar must be on top */
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999999 !important;
        background-color: rgba(26, 26, 26, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        padding: 0.6rem 0 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
        height: auto !important;
        min-height: 50px !important;
    }

    .nav-container {
        position: relative !important;
        z-index: 999999 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 0.4rem 2rem !important;
        min-height: 50px !important;
    }

    /* Logo on the left */
    .nav-brand-logo {
        position: absolute !important;
        left: -2.5rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        height: 50px !important;
        width: auto !important;
        z-index: 999999 !important;
    }

    /* Center the brand text in the middle */
    .nav-brand {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        text-align: center !important;
        z-index: 999999 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-brand a,
    .nav-brand .established {
        position: relative !important;
        z-index: 999999 !important;
    }

    .nav-brand .established {
        align-self: center !important;
        padding-right: 0 !important;
        text-align: center !important;
        margin-top: -0.3rem !important;
    }

    .nav-brand-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0 !important;
        line-height: 1.2 !important;
    }

    .nav-brand-link span {
        display: block !important;
        text-align: center !important;
        line-height: 1.05 !important;
        word-spacing: 9999px !important; /* Force "Social Committee" to break into separate lines */
    }

    /* Make hamburger bigger and position on right */
    .mobile-menu-toggle {
        display: block !important;
        position: absolute !important;
        right: 0 !important;
        z-index: 999999 !important;
        padding: 0.75rem !important;
    }

    .mobile-menu-toggle .hamburger {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        width: 32px !important;
    }

    .mobile-menu-toggle .hamburger span {
        display: block !important;
        width: 100% !important;
        height: 4px !important;
        background: var(--primary) !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
    }

    /* Dropdown menu */
    .nav-menu {
        position: fixed !important;
        top: 50px !important;
        right: 1rem !important;
        z-index: 999998 !important;
        display: none !important;
        flex-direction: column !important;
        background: rgba(31, 31, 31, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 1rem !important;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7) !important;
        min-width: 200px !important;
        gap: 0.5rem !important;
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-menu li {
        width: 100% !important;
        margin: 0 !important;
    }

    .nav-menu a {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        height: 44px !important;
        padding: 0.6rem 1rem !important;
    }

    /* Force all content sections to be behind navbar */
    /* CRITICAL: hero-section contains the navbar, so it needs high z-index too */
    .hero-section {
        position: relative !important;
        z-index: 999998 !important;
        padding-top: 80px !important;
        isolation: auto !important;
        transform: none !important;
    }

    .hero-background {
        position: absolute !important;
        z-index: 1 !important;
        transform: none !important;
    }

    .hero-content {
        position: relative !important;
        z-index: 3 !important;
        text-align: center !important;
        padding: 2rem 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        transform: none !important;
    }

    .hero-title {
        text-align: center !important;
        width: 100% !important;
        transform: none !important;
        position: relative !important;
        z-index: auto !important;
    }

    .hero-tagline {
        text-align: center !important;
        width: 100% !important;
        transform: none !important;
        position: relative !important;
        z-index: auto !important;
    }

    .hero-gallery-slideshow {
        position: absolute !important;
        z-index: 1 !important;
        transform: none !important;
    }

    .hero-gallery-slideshow .slide {
        position: absolute !important;
        z-index: 1 !important;
    }

    .hero-overlay {
        position: absolute !important;
        z-index: 2 !important;
        transform: none !important;
    }

    .main-content {
        position: relative !important;
        z-index: 1 !important;
        transform: none !important;
    }

    .section {
        position: relative !important;
        z-index: 1 !important;
        transform: none !important;
    }

    /* All cards and content must be behind - AGGRESSIVE */
    .phase-card,
    .poll-card,
    .welcome-card,
    .member-card,
    .feedback-form {
        position: relative !important;
        z-index: auto !important;
        transform: translateY(0px) !important;
    }

    .phase-card:hover,
    .poll-card:hover,
    .welcome-card:hover,
    .member-card:hover,
    .feedback-form:hover {
        transform: translateY(-5px) !important;
        z-index: auto !important;
    }

    .container {
        position: relative !important;
        z-index: auto !important;
        transform: none !important;
    }

    h1, h2, h3, h4, h5, h6, p, div {
        transform: none !important;
    }

    /* Ensure footer stays behind too */
    .main-footer {
        position: relative !important;
        z-index: 1 !important;
        transform: none !important;
    }

    /* FORCE FOOTER LOGOS TO STACK VERTICALLY ON MOBILE - NUCLEAR OPTION */
    .footer-logos {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 1rem !important;
        margin-top: 1.5rem !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    .footer-logos .logo-link {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
    }

    .footer-logos .logo-link:first-child {
        order: 1 !important;
    }

    .footer-logos .logo-link:last-child {
        order: 2 !important;
    }

    .footer-logos img {
        height: 40px !important;
        width: auto !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }

    /* Fix gallery indicators position on mobile */
    .gallery-indicators {
        position: absolute !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 10 !important;
        display: flex !important;
        gap: 8px !important;
    }
}
