/* =========================================
   PREMIUM MOBILE REDESIGN (App-Like Feel)
   ========================================= */

/* Default: Hide Mobile Nav on Desktop */
.mobile-bottom-nav {
    display: none !important;
}

@media (max-width: 768px) {

    /* 1. RESTORE Sidebar & Toggle (User Request) */
    .sidebar {
        display: block !important;
        z-index: 20001;
        /* Ensure it's above everything */
    }

    #sidebar-toggle-btn {
        display: flex !important;
        z-index: 20002;
        /* Ensure clickability */
    }

    /* 2. APP LAYOUT CONTAINER */
    .app-container {
        display: block;
        /* Remove flex sidebar layout */
        padding-bottom: 80px;
        /* Space for Bottom Nav */
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .content-wrapper {
        padding: 1.5rem 1.25rem !important;
        padding-top: 2rem !important;
    }

    /* 3. HERO SECTION (Immersive) */
    .hero-section {
        min-height: 85vh;
        /* Almost full screen */
        display: flex;
        align-items: center;
        text-align: center;
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        opacity: 0.8;
    }

    /* 4. HORIZONTAL SCROLL CARDS (Netflix Style) */
    .features-grid,
    /* Group monthly cards if wrapped in a container, otherwise apply to cards directly? */
    /* Looking at index.html, resource-cards are siblings divs. We can't flex them easily without a wrapper. */
    /* But features-grid IS a wrapper. */
    .features-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem !important;
        padding-bottom: 2rem;
        margin: 0 -1.25rem 2rem -1.25rem;
        /* Full bleed */
        padding-left: 1.25rem;
        /* Margin restore */
        padding-right: 1.25rem;
        -webkit-overflow-scrolling: touch;
        /* Hide Scrollbar */
        scrollbar-width: none;
    }

    .features-grid::-webkit-scrollbar {
        display: none;
    }

    .feature-card {
        min-width: 85vw;
        scroll-snap-align: center;
        background: rgba(30, 41, 59, 0.7);
        /* Slightly more opaque */
        backdrop-filter: blur(20px);
        margin-bottom: 0 !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    /* 5. MONTHLY RESOURCES (Vertical Stack with "App" styling) */
    .resource-card {
        margin: 1rem 0;
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
        border-radius: 1.5rem;
        padding: 1.5rem;
        border: 1px solid rgba(99, 102, 241, 0.2);
        position: relative;
        overflow: hidden;
    }

    .resource-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--color-neon-cyan);
    }

    /* 6. BOTTOM NAVIGATION BAR */
    .mobile-bottom-nav {
        display: flex !important;
        /* Override default hidden */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(10, 14, 39, 0.95);
        backdrop-filter: blur(20px);
        display: flex;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    }

    .nav-item-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--color-text-muted);
        text-decoration: none;
        font-size: 0.75rem;
        gap: 4px;
        width: 100%;
        height: 100%;
        transition: all 0.3s ease;
    }

    .nav-item-mobile.active {
        color: var(--color-neon-cyan);
    }

    .nav-item-mobile svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
    }

    /* 7. FLOATING ACTION BUTTON (for primary action on pages) */
    .fab-primary {
        position: fixed;
        bottom: 90px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: var(--gradient-cosmic);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        box-shadow: 0 5px 20px rgba(99, 102, 241, 0.6);
        z-index: 9998;
        font-size: 24px;
        text-decoration: none;
        animation: pulse-fab 2s infinite;
    }
}

@keyframes pulse-fab {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}