﻿/* Mobile Adaptation for Sound & Light School */
@media screen and (max-width: 768px) {

    /* Layout */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Header */
    .main-header {
        position: relative;
        padding: 10px 0;
        overflow-y: auto !important;
        /* Enable Sidebar Scrolling */
    }

    .main-header .container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .main-header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 0;
    }

    .main-header nav ul li {
        margin: 0 5px;
    }

    /* Hero */
    .hero {
        padding: 60px 0 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    /* Hide Desktop Warning */
    .tip-box {
        display: none !important;
    }

    /* Sections */
    .section {
        padding: 40px 0;
    }

    /* Course Cards */
    .course-card {
        padding: 20px;
    }

    .actions {
        flex-direction: column;
    }

    .actions button,
    .actions a {
        width: 100%;
    }

    /* Accordion Details */
    .accordion-content {
        padding: 0 15px;
    }

    .accordion-header h3 {
        font-size: 1.1rem;
    }

    /* --- Learn Mode Mobile --- */
    .learn-container {
        flex-direction: column;
        display: block;
        /* Override flex */
    }

    .learn-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
        background-color: var(--bg-card);
        /* Ensure background */
        overflow-y: auto;
    }

    .learn-sidebar.active {
        left: 0;
    }

    .learn-content {
        padding: 60px 15px 80px;
        /* Space for header/footer */
        width: 100%;
        margin-left: 0;
    }

    /* Mobile Toggle Button for Course Menu */
    .mobile-course-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        background-color: var(--accent-primary);
        color: white;
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        z-index: 10000;
        font-size: 24px;
        cursor: pointer;
        transition: transform 0.2s;
    }

    .mobile-course-toggle:active {
        transform: scale(0.95);
    }

    /* Overlay when sidebar is open */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vh;
        /* Cover full width */
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 5000;
    }

    /* FIX: Allow scrolling on mobile */
    .learning-mode {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        display: block !important;
    }

    .learn-container {
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    #contentArea {
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 150px;
        /* Ensure enough space at bottom */
    }
}