/* ==========================================================================
   STYLE CHÍNH - HỆ THỐNG HỌC TRỰC TUYẾN
   Khoa Nghiệp vụ cơ bản - Học viện PCCC và CNCH
   ========================================================================== */

:root {
    --primary: #1e3a8a;          /* Xanh lam đậm Bộ Công an */
    --primary-light: #2563eb;
    --primary-dark: #0f172a;
    --accent: #dc2626;           /* Đỏ truyền thống CAND/PCCC */
    --accent-hover: #b91c1c;
    --gold: #d97706;             /* Vàng huy hiệu */
    --gold-light: #fef3c7;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Header & Top Bar */
.top-bar {
    background: linear-gradient(90deg, #991b1b 0%, #b91c1c 50%, #dc2626 100%);
    color: #ffffff;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gold);
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-badge {
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.main-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    gap: 16px;
    position: relative;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex-shrink: 1;
}

.brand-emblem {
    width: 46px;
    height: 46px;
    background: radial-gradient(circle, #dc2626 0%, #991b1b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fef08a;
    font-size: 22px;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.35);
    border: 2px solid var(--gold);
    flex-shrink: 0;
}

.brand-text {
    min-width: 0;
}

.brand-text h1 {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
}

.brand-text p {
    font-size: 11.5px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text .course-tag {
    display: inline-block;
    font-size: 10.5px;
    background: #eff6ff;
    color: var(--primary-light);
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
}

/* Nav Menu */
.main-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.mobile-nav-header {
    display: none;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-light);
    background: #f1f5f9;
}

.nav-link.active {
    color: #ffffff;
    background: var(--primary);
}

.nav-btn-highlight {
    background: linear-gradient(135deg, var(--accent) 0%, #b91c1c 100%);
    color: #ffffff !important;
    padding: 7px 14px;
    border-radius: 20px;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25);
}

.nav-btn-highlight:hover {
    box-shadow: 0 5px 12px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-toggle:hover {
    background: #dbeafe;
}

.mobile-nav-backdrop {
    display: none;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #172554 100%);
    color: #ffffff;
    padding: 60px 0 70px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="%23ffffff" fill-opacity="0.03" fill-rule="evenodd"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>');
    opacity: 0.8;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 17px;
    color: #cbd5e1;
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-gold {
    background: rgba(217, 119, 6, 0.2);
    color: #fde68a;
    border: 1px solid rgba(217, 119, 6, 0.4);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.badge-info {
    background: rgba(37, 99, 235, 0.25);
    color: #93c5fd;
    border: 1px solid rgba(37, 99, 235, 0.4);
}

.hero-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.45);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

.hero-media {
    position: relative;
}

.hero-media img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.2);
    display: block;
}

.hero-media-tag {
    position: absolute;
    bottom: -15px;
    right: 20px;
    background: #ffffff;
    color: var(--primary);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-weight: 700;
    font-size: 13px;
    border-left: 4px solid var(--accent);
}

/* Department Section (Khoa Nghiệp vụ cơ bản) */
.section-dept {
    background: #ffffff;
    padding: 70px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
}

.section-pretitle {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 14px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
}

.dept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
}

.dept-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.dept-lead {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 24px;
}

.dept-features {
    display: grid;
    gap: 16px;
}

.dept-feature-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.dept-icon {
    width: 36px;
    height: 36px;
    background: var(--gold-light);
    color: var(--gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.dept-feature-item h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.dept-feature-item p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.dept-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.stat-box {
    text-align: center;
}

.stat-number {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Chapter & Lessons Curriculum */
.section-curriculum {
    padding: 70px 0;
}

.chapters-list {
    display: grid;
    gap: 30px;
}

.chapter-block {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.chapter-block:hover {
    box-shadow: var(--shadow-md);
}

.chapter-header {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.chapter-title-group h3 {
    font-size: 19px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}

.chapter-title-group p {
    font-size: 14px;
    color: var(--text-muted);
}

.chapter-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lessons-grid {
    padding: 24px 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.lesson-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.lesson-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.lesson-card-media {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: #0f172a;
}

.lesson-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.lesson-card:hover .lesson-card-media img {
    transform: scale(1.05);
}

.lesson-code-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lesson-audio-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.9);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.lesson-card-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 8px;
}

.lesson-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.lesson-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0 24px;
    font-size: 14px;
    border-top: 4px solid var(--accent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 36px;
    height: 2px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 1040px) {
    .mobile-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 290px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
        z-index: 1200;
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        gap: 10px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .main-nav.show {
        display: flex;
        transform: translateX(0);
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 800;
        font-size: 15px;
        color: var(--primary);
        padding-bottom: 14px;
        border-bottom: 2px solid var(--accent);
        margin-bottom: 12px;
    }

    .btn-close-nav {
        background: #f1f5f9;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        cursor: pointer;
        color: var(--text-main);
        font-weight: bold;
    }

    .btn-close-nav:hover {
        background: #fee2e2;
        color: var(--accent);
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(3px);
        z-index: 1150;
    }

    .mobile-nav-backdrop.show {
        display: block;
    }

    .nav-link {
        padding: 11px 14px;
        font-size: 14.5px;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .nav-btn-highlight {
        margin-top: 10px;
        text-align: center;
        justify-content: center;
        padding: 12px 16px;
    }

    .brand-text p {
        max-width: 300px;
    }
}

@media (max-width: 992px) {
    .hero-grid, .dept-grid, .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero-media {
        order: -1;
    }
}

@media (max-width: 768px) {
    .lessons-grid {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 14px;
    }
    .chapter-header {
        padding: 16px;
    }
    .top-bar {
        padding: 6px 0;
        font-size: 11.5px;
    }
    .top-bar-left span.separator,
    .top-bar-right .top-bar-phone {
        display: none;
    }
    .top-bar-inner {
        justify-content: center;
        text-align: center;
    }
    .hero-content h2 {
        font-size: 22px;
    }
    .hero-subtitle {
        font-size: 14px;
    }
    .hero-cta {
        flex-direction: column;
    }
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    .section-title {
        font-size: 20px;
    }
    .dept-card {
        padding: 18px;
    }
    .dept-stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .brand-text h1 {
        font-size: 14px;
    }
    .brand-text p {
        font-size: 10.5px;
        max-width: 220px;
    }
    .brand-emblem {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ========================================================
   GIÁO TRÌNH ĐIỆN TỬ - RESPONSIVE LAYOUT CHUẨN ĐẸP TRÊN DI ĐỘNG
   ======================================================== */
.giaotrinh-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    position: relative;
}

/* Sidebar Mục lục trên Desktop */
.giaotrinh-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 18px;
    position: sticky;
    top: 85px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    z-index: 10;
}

.giaotrinh-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.giaotrinh-sidebar-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.btn-close-gt-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}

.giaotrinh-toc-group {
    margin-bottom: 14px;
}

.giaotrinh-toc-chapter {
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    transition: color 0.2s;
}

.giaotrinh-toc-chapter:hover {
    color: var(--primary);
}

.giaotrinh-toc-sub {
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 2px solid #f1f5f9;
}

.giaotrinh-toc-item {
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.4;
    font-size: 13px;
    transition: all 0.2s;
    padding: 3px 6px;
    border-radius: 4px;
}

.giaotrinh-toc-item:hover {
    color: var(--primary);
    background: #f8fafc;
}

/* Nội dung toàn văn giáo trình */
.giaotrinh-main {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 38px 42px;
    box-shadow: var(--shadow-sm);
    line-height: 1.8;
    font-size: 15.5px;
}

.giaotrinh-main [id^="chuong-"],
.giaotrinh-main [id^="bai-"] {
    scroll-margin-top: 90px;
}

.giaotrinh-foreword {
    background: #f8fafc;
    border-left: 4px solid var(--gold);
    padding: 22px 24px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 40px;
}

.giaotrinh-foreword h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 700;
}

.giaotrinh-chapter-banner {
    background: linear-gradient(90deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.giaotrinh-chapter-banner h2 {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.giaotrinh-lesson-card {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
}

.giaotrinh-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.giaotrinh-lesson-header h3 {
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    min-width: 250px;
}

.giaotrinh-lesson-img-wrap {
    margin-bottom: 16px;
}

.giaotrinh-lesson-img-wrap img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Nút bấm nổi mục lục trên Mobile (FAB) */
.giaotrinh-mobile-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.giaotrinh-mobile-fab:active {
    transform: scale(0.96);
}

/* Hộp Accordion Mục lục nhanh đầu trang trên Mobile */
.mobile-toc-accordion {
    display: none;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
}

.mobile-toc-accordion summary {
    padding: 13px 16px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    background: #f1f5f9;
}

.mobile-toc-accordion summary::-webkit-details-marker {
    display: none;
}

.mobile-toc-accordion-body {
    padding: 16px;
    max-height: 350px;
    overflow-y: auto;
    font-size: 13.5px;
    background: #ffffff;
}

/* Lớp phủ Backdrop Drawer */
.giaotrinh-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.giaotrinh-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================================
   RESPONSIVE GIAO TRINH FOR TABLET & MOBILE (< 992px)
   ======================================================== */
@media (max-width: 991px) {
    .giaotrinh-layout {
        flex-direction: column;
        gap: 0;
    }

    /* Tắt hoàn toàn vị trí sticky trên mobile để không bao giờ bị đè lên nội dung */
    .giaotrinh-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 320px !important;
        max-width: 86vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.35);
        border-radius: 0 !important;
        border: none !important;
        padding: 20px 18px 80px 18px !important;
    }

    .giaotrinh-sidebar.open {
        transform: translateX(0) !important;
    }

    .btn-close-gt-sidebar {
        display: block;
    }

    .giaotrinh-mobile-fab {
        display: flex;
    }

    .mobile-toc-accordion {
        display: block;
    }

    .giaotrinh-main {
        padding: 22px 16px !important;
        font-size: 15px !important;
        line-height: 1.75 !important;
        border-radius: 12px !important;
        width: 100%;
    }

    .giaotrinh-foreword {
        padding: 16px 14px;
        margin-bottom: 25px;
    }

    .giaotrinh-chapter-banner {
        padding: 12px 14px;
        margin-bottom: 18px;
    }

    .giaotrinh-chapter-banner h2 {
        font-size: 16px;
    }

    .giaotrinh-lesson-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .giaotrinh-lesson-header h3 {
        font-size: 16px;
        width: 100%;
    }

    .giaotrinh-lesson-header .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13.5px;
    }

    .giaotrinh-lesson-img-wrap img {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .giaotrinh-main {
        padding: 18px 12px !important;
        font-size: 14.5px !important;
    }
    .doc-text {
        font-size: 14.5px !important;
    }
    .doc-text p {
        text-align: left !important;
    }
}
