/* --- Material 3 Color Palette (Emulation) --- */
:root {
    --primary: #6750A4; /* Primary Color (Violet) */
    --on-primary: #FFFFFF;
    --primary-container: #EADDFF;
    --on-primary-container: #21005D;
    --surface: #FFFBFE;
    --on-surface: #1C1B1F;
    --surface-container-high: #ECE6F0; /* Used for elevated cards */
    --outline: #79747E;
    --background: #FEF7FF;
    --font-bengali: 'Noto Sans Bengali', sans-serif;
    --max-mobile-width: 600px;
}

/* Base Styles & Typography */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-bengali);
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--on-surface);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    margin-top: 0;
    font-weight: 600;
}

/* --- Top App Bar (Android Header) --- */
.top-app-bar {
    background-color: var(--surface);
    color: var(--on-surface);
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 500;
}

.top-app-bar h1 {
    font-size: 1.25rem;
    flex-grow: 1;
    text-align: center;
    margin: 0;
}

.top-app-bar .menu-icon,
.top-app-bar .search-icon {
    cursor: pointer;
    padding: 8px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Main Content Area --- */
#main-content {
    /* বটম নেভিগেশনের জন্য অতিরিক্ত প্যাডিং সরানো হয়েছে */
    padding: 16px; 
    flex-grow: 1;
    width: 100%;
}

.loader {
    text-align: center;
    padding: 50px;
    color: var(--primary);
    font-size: 1.2rem;
}

/* --- Course Card Grid --- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.material-card {
    background-color: var(--surface-container-high);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.material-card h3 {
    color: var(--on-primary-container);
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.material-card p {
    color: var(--outline);
    font-size: 0.8rem;
    margin: 0;
}

/* --- Navigation Rail (Sidebar for Mobile/Desktop) --- */
.navigation-rail {
    position: fixed;
    top: 0;
    left: -80px; /* Initially hidden off-screen */
    height: 100vh;
    width: 80px;
    background-color: var(--surface);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 64px; /* Space for Top App Bar */
    transition: left 0.3s ease-in-out;
    z-index: 1500;
}

.navigation-rail.open {
    left: 0; /* Slide in when open on mobile */
}

.navigation-rail .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    margin: 8px 0;
    color: var(--on-surface);
    cursor: pointer;
    transition: background-color 0.2s;
}

.navigation-rail .nav-item:hover {
    background-color: var(--surface-container-high);
}

.navigation-rail .nav-item .material-symbols-outlined {
    font-size: 24px;
    margin-bottom: 4px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.navigation-rail .nav-item .label {
    font-size: 0.7rem;
}

/* --- Tab Bar Styling (For Course Details) --- */
.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--outline);
    margin-bottom: 16px;
    margin-top: 20px;
}

.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--outline);
    font-weight: 500;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-button.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
}

.tab-content-item {
    display: none;
    padding-top: 10px;
}

.tab-content-item.active {
    display: block;
}

/* --- Expansion Panel (Accordion) Styling --- */
.expansion-panel {
    border: 1px solid var(--outline);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background-color: var(--surface);
}

.panel-header {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
    padding: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.panel-header .material-symbols-outlined {
    transition: transform 0.3s ease-in-out;
}

.panel-content {
    /* Transition setup for the collapsible content */
    max-height: 0; 
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.panel-content.open {
    max-height: 1000px; /* Large enough to show all content */
    padding: 16px;
}
.question-item {
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--outline);
}
.question-item:last-child {
    border-bottom: none;
}
.question-item strong {
    color: var(--primary);
}


/* --- Responsiveness: Desktop Layout (Media Query) --- */
@media (min-width: 601px) {
    /* Main body layout adjusted for sidebar */
    body {
        flex-direction: row;
    }
    
    /* Top app bar adjustment */
    .top-app-bar {
        position: static;
        width: calc(100% - 80px); /* Adjust for fixed navigation rail */
        margin-left: 80px;
    }
    .top-app-bar .menu-icon {
        display: none; /* Hide menu icon on desktop */
    }

    /* Navigation Rail becomes permanent */
    .navigation-rail {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 80px;
    }
    
    /* বটম নেভিগেশন বারটি মুছে যাওয়ায়, মেইন কন্টেন্ট এখন বাম দিকে জায়গা নেবে */
    #main-content {
        padding-bottom: 0; 
        margin-left: 80px;
        width: calc(100% - 80px);
    }
}