/* =========================================================
   NGỮ VĂN THCS (lớp 6 - 9) - CSS dùng chung
   Dùng cho tất cả các trang category-XXXX.php của môn Ngữ văn cấp 2
   ========================================================= */

.nguvan-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
    font-family: Arial, sans-serif;
}

.nguvan-title {
    text-align: center;
    color: #2c5aa0;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

/* ---------------- Breadcrumb ---------------- */
.breadcrumb {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}
.breadcrumb a {
    color: #2c5aa0;
    text-decoration: none;
    transition: color 0.2s ease;
}
.breadcrumb a:hover {
    color: #1a3a6b;
    text-decoration: underline;
}
.breadcrumb .separator { margin: 0 8px; color: #999; }
.breadcrumb .current { color: #333; font-weight: 500; }

/* ---------------- Tab (Tập 1 / Tập 2 / PDF) ---------------- */
.tab-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    gap: 8px;
    flex-wrap: wrap;
}
.tab-button {
    background: #f0f0f0;
    border: 2px solid #ddd;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}
.tab-button:hover { background: #e0e0e0; border-color: #2c5aa0; }
.tab-button.active { background: #2c5aa0; color: #fff; border-color: #2c5aa0; }

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

/* ---------------- Banner chạy tự động ---------------- */
.nv-banner {
    position: relative;
    width: 100%;
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.nv-banner-track {
    display: flex;
    transition: transform 0.6s ease;
}
.nv-banner-slide {
    flex: 0 0 100%;
    min-width: 100%;
}
.nv-banner-slide img {
    display: block;
    width: 100%;
    height: auto;
}
.nv-banner-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.nv-banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background 0.2s ease;
}
.nv-banner-dot.active { background: #2c5aa0; }

/* ---------------- Nút chuyên mục phụ ---------------- */
.additional-buttons {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 25px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 5px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.additional-buttons::-webkit-scrollbar { height: 6px; }
.additional-buttons::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.additional-buttons::-webkit-scrollbar-thumb { background: #2c5aa0; border-radius: 3px; }
.additional-buttons::-webkit-scrollbar-thumb:hover { background: #1e3f73; }

.additional-btn {
    background: linear-gradient(135deg, #0acc27 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 180px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.additional-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #764ba2 0%, #0acc27 100%);
}

/* ---------------- Danh sách bài học ---------------- */
.lesson-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.lesson-section { margin-bottom: 25px; }
.lesson-section:last-child { margin-bottom: 0; }

.section-title {
    color: #2c5aa0;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c5aa0;
}

.lesson-item { border-bottom: 1px solid #f0f0f0; }
.lesson-item:last-child { border-bottom: none; }

/* Nút tên bài (bấm để xổ menu con) */
.lesson-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 9px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 400;          /* bỏ in đậm (ghi đè theme) */
    text-transform: none;      /* bỏ IN HOA tất cả (ghi đè theme) */
    letter-spacing: 0;
    transition: all 0.2s ease;
}
.lesson-toggle:hover { color: #2c5aa0; padding-left: 6px; }
.lesson-toggle::after {
    content: "\25BE";            /* mũi tên ▼ */
    font-size: 12px;
    color: #2c5aa0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.lesson-toggle.open::after { transform: rotate(180deg); }

/* Menu con: Lý thuyết / Soạn */
.lesson-submenu {
    display: none;
    padding: 2px 0 10px 16px;
}
.lesson-submenu.open { display: block; }

.submenu-link {
    display: block;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    transition: all 0.2s ease;
}
.submenu-link.submenu-theory {
    background: #eef4ff;
    color: #1e3f73;
}
.submenu-link.submenu-theory:hover { background: #dde9ff; padding-left: 16px; }

.submenu-link.submenu-soan {
    background: #eafaee;
    color: #1f7a34;
}
.submenu-link.submenu-soan:hover { background: #d8f5df; padding-left: 16px; }

/* ---------------- Trình xem PDF ---------------- */
.pdf-viewer-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.pdf-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.pdf-select-btn {
    background: #f0f0f0;
    border: 2px solid #ddd;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 13px;
    transition: all 0.3s ease;
    min-width: 100px;
}
.pdf-select-btn:hover { background: #e0e0e0; border-color: #2c5aa0; }
.pdf-select-btn.active { background: #2c5aa0; color: #fff; border-color: #2c5aa0; }

.pdf-viewer {
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    min-height: 500px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    width: 100%;
}
.pdf-btn {
    background: #2c5aa0;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
    min-width: 60px;
}
.pdf-btn:hover { background: #1e3f73; }
.pdf-btn:disabled { background: #ccc; cursor: not-allowed; }

.page-info {
    font-weight: bold;
    color: #2c5aa0;
    margin: 0 8px;
    font-size: 13px;
    text-align: center;
    min-width: 80px;
}
#pdf-canvas {
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
.pdf-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 300px;
    font-size: 16px;
    color: #666;
    width: 100%;
}
.zoom-controls { display: flex; align-items: center; gap: 6px; }
.zoom-level { font-size: 12px; color: #666; min-width: 40px; text-align: center; }
.page-input {
    width: 50px;
    padding: 3px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 7px;
    text-align: center;
    vertical-align: middle;
}

/* ---------------- Hộp giới thiệu ---------------- */
.content-box {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.content-title {
    color: #2c5aa0;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
    .nguvan-container { padding: 10px; }
    .nguvan-title { font-size: 20px; margin-bottom: 18px; }
    .tab-buttons { gap: 5px; margin-bottom: 20px; }
    .tab-button { padding: 8px 12px; font-size: 12px; min-width: 70px; }
    .lesson-list { padding: 15px; }
    .section-title { font-size: 14px; }
    .lesson-toggle { font-size: 13px; }
    .submenu-link { font-size: 12.5px; }
    .additional-btn { padding: 8px 15px; font-size: 12px; min-width: 150px; }
    .additional-buttons { gap: 5px; padding: 8px 5px; }
    .pdf-viewer-container { padding: 10px; }
    .pdf-controls { gap: 5px; justify-content: space-between; }
    .pdf-btn { padding: 5px 8px; font-size: 11px; min-width: 50px; }
    .page-info { font-size: 11px; margin: 0 4px; min-width: 70px; }
    .zoom-controls { gap: 4px; }
    .zoom-level { font-size: 11px; min-width: 35px; }
    .pdf-viewer { padding: 10px; min-height: 400px; }
    .content-box { padding: 15px; }
    .content-title { font-size: 16px; }
    .breadcrumb { font-size: 12px; margin-bottom: 15px; }
    .breadcrumb .separator { margin: 0 4px; }
}

@media (max-width: 480px) {
    .tab-button { padding: 6px 10px; font-size: 11px; min-width: 60px; }
    .pdf-controls { flex-direction: column; gap: 8px; }
    .zoom-controls { justify-content: center; }
}