/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet (max-width: 991px) */
@media (max-width: 991px) {
    .header-main {
        text-align: center;
    }
    
    .header-logos {
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .navbar-custom .nav-link::after {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .info-card {
        border-right: none;
        border-bottom: 1px solid #eee;
        margin-bottom: 15px;
    }
    
    .info-card:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .stat-item {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 30px 20px;
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    .floating-menu {
        display: none; /* Hide floating menu on mobile/tablet to save space */
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    /* Hide topbar for a cleaner mobile app feel */
    .topbar {
        display: none !important;
    }
    
    /* Make the header sticky with glassmorphism */
    .header-main {
        position: sticky;
        top: 0;
        z-index: 1040;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding: 10px 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    /* Keep logos small and centered */
    .header-logo {
        height: 38px !important;
    }
    
    .uni-text, .conf-title-text {
        display: none !important; /* Hide long texts on mobile */
    }

    .header-divider {
        display: none !important;
    }

    /* Sexy Mobile Navbar */
    .navbar-custom {
        padding: 0 !important;
        background: transparent !important;
    }
    
    .navbar-toggler {
        position: fixed;
        right: 15px;
        top: 15px;
        z-index: 1060;
        background: var(--primary) !important;
        border-radius: 50% !important;
        width: 45px;
        height: 45px;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .navbar-toggler-icon {
        filter: invert(1);
        width: 20px;
        height: 20px;
    }

    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(17, 58, 38, 0.95); /* Deep green glass */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1050;
        padding-top: 80px;
        padding-bottom: 40px;
        overflow-y: auto;
    }

    .navbar-collapse .navbar-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .navbar-collapse .nav-link {
        color: white !important;
        font-size: 1.4rem;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .navbar-collapse .dropdown-menu {
        background: rgba(255,255,255,0.1);
        border: none;
        text-align: center;
        border-radius: 15px;
    }

    .navbar-collapse .dropdown-item {
        color: white !important;
        font-size: 1.1rem;
        padding: 10px;
    }
    
    .mobile-header-actions {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 30px;
        margin-top: 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    /* Sexy Hero Section adjustments for mobile */
    .hero-sexy-bg {
        min-height: 85vh;
        align-items: flex-start;
        padding-top: 80px;
    }
    
    .hero-text-glass {
        padding: 2rem 1.5rem !important;
        border-radius: 20px !important;
        clip-path: none !important; /* Remove slant on mobile for full width */
        margin: 0 15px !important;
        background: rgba(255, 255, 255, 0.75) !important; /* More opaque on mobile */
    }
    
    .hero-text-glass::before {
        display: none !important; /* Remove complex mask on mobile */
    }

    .hero-title-main {
        font-size: 2.2rem !important;
    }
    
    /* Ensure mobile navbar menu appears */
    .navbar-collapse {
        display: none !important;
        visibility: hidden;
    }
    .navbar-collapse.show {
        display: flex !important;
        visibility: visible;
        flex-direction: column;
        align-items: center;
    }
    .navbar-toggler {
        filter: none; /* remove invert which hid icon */
        color: #fff;
    }
    .navbar-toggler .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,<svg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'><path stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/></svg>");
    }
    /* Mobile header toggle button – sleek glassy round */
    .header-menu-toggle {
        display: none; /* hidden on desktop */
        position: absolute;
        right: 15px;
        top: 15px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255,255,255,0.2);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255,255,255,0.4);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 1065;
        transition: background 0.3s ease, transform 0.2s ease;
    }
    .header-menu-toggle:hover {
        background: rgba(255,255,255,0.4);
        transform: scale(1.05);
    }
    .header-menu-toggle .navbar-toggler-icon {
        /* use white hamburger */
        background-image: url("data:image/svg+xml;charset=utf8,<svg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'><path stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/></svg>");
        width: 20px;
        height: 20px;
        margin: 14px auto;
    }
    .header-menu-toggle.collapsed .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,<svg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'><path stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/></svg>");
    }
    .header-menu-toggle:not(.collapsed) .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,<svg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'><path stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M6 6l18 18M24 6l-18 18'/></svg>");
    }
    @media (max-width: 991px) {
        .header-menu-toggle { display: flex; align-items: center; justify-content: center; }
        .header-main { padding-right: 60px; } /* give space for button */
    }
    @media (min-width: 992px) {
    .header-menu-toggle { display: none; }
}

/* Modern mobile bottom navigation bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.3);
    z-index: 1050;
    padding: 0;
}
.mobile-bottom-nav .nav-link {
    color: var(--primary-dark);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    transition: color 0.3s ease;
    text-decoration: none;
}
.mobile-bottom-nav .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}
.mobile-bottom-nav .nav-link:hover,
.mobile-bottom-nav .nav-link.active {
    color: var(--primary);
}
    
    .hero-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary-custom, .btn-outline-custom {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .countdown-wrapper {
        flex-wrap: wrap;
    }
    
    .count-box {
        flex: 1 1 40%;
        margin-bottom: 10px;
    }
    
    .float-top {
        right: 20px;
        bottom: 80px;
    }
    
    /* Global Safety Nets for Mobile Layout */
    html, body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
        padding-bottom: 80px !important; /* Prevent bottom bar from hiding content/buttons */
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Normalize massive bootstrap paddings on mobile */
    .p-5, .p-4, .px-5, .px-4, .py-5, .py-4 {
        padding: 1.25rem !important;
    }
    
    /* Make tables responsive without breaking their layout */
    .fee-table, table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix any rogue flex containers */
    .d-flex:not(.flex-wrap):not(.flex-column) {
        /* This can be risky, so we target specific known custom flex containers */
    }
    
    .stat-border {
        border-left: 1px solid rgba(255,255,255,0.1);
        padding-left: 15px;
    }
    /* stat-border-md is handled in global css or min-width query if needed, but on mobile it's transparent */
    
    .pass-header, .pass-body, .delegate-info, .two-col-section {
        flex-direction: column !important;
    }
    
    .pass-right-col {
        width: 100% !important;
        border-left: none !important;
        border-top: 2px solid #000;
    }
    
    /* Mobile Navigation Drawer */
    .navbar-collapse {
        background: #11150f;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px - 65px); /* Minus topbar and bottom bar */
        overflow-y: auto;
        padding: 20px;
        z-index: 1000;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-custom .nav-link {
        font-size: 1.2rem;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .dropdown-menu {
        background: transparent;
        border: none;
        padding-left: 20px;
    }
    
    .dropdown-item {
        color: #aaa !important;
        padding: 10px 0;
        font-size: 1.1rem;
    }
    
    /* Mobile Bottom Action Bar */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1040;
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 65px;
        border-top: 1px solid #eee;
    }
    
    .mobile-bar-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #777;
        font-size: 0.7rem;
        font-weight: 600;
        flex: 1;
        height: 100%;
        transition: all 0.2s ease;
    }
    
    .mobile-bar-btn i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .mobile-bar-btn.active {
        color: #0b3d2c;
    }
    .mobile-bar-btn.active i {
        color: var(--accent, #d4af37);
    }
    
    /* Card UI & Spacing adjustments */
    .info-card, .stat-item, .info-box {
        border-radius: 16px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        margin-bottom: 15px;
        padding: 20px !important;
        border: 1px solid #f0f0f0 !important;
    }
    
    .page-hero {
        padding: 40px 0 !important;
    }
    
    .page-hero h1 {
        font-size: 1.8rem !important;
    }
    
    /* Ensure padding for bottom bar */
    body {
        padding-bottom: 65px;
    }
}
