﻿/* --- BẢNG MÀU THEO YÊU CẦU --- */
:root {
    --primary-color: #008dda;
    --secondary-color: #41c9e2;
    --light-blue: #ace2e1;
    --accent-blue: #5ab2ff;
    --cream-yellow: #fff9d0;
    --soft-blue-bg: #c4e2f5;
    --dark-color: #000000;
    --light-color: #ffffff;
}

/* --- TOÀN CỤC --- */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--dark-color);
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

/* ==========================================================================
   HEADER STYLE
   ========================================================================== */
.main-header {
    background-color: var(--light-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Top Header (Logo & Auth) */
.top-header {
    padding: 15px 0;
    border-bottom: 1px solid var(--soft-blue-bg);
}

.auth-buttons .btn-login {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 15px;
    padding: 8px 16px;
}

.auth-buttons .btn-register {
    background-color: var(--primary-color);
    color: var(--light-color);
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
}

    .auth-buttons .btn-register:hover {
        background-color: var(--accent-blue);
    }

/* Navigation Menu */



.main-navigation {
    background-color: var(--soft-blue-bg);
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 15px 25px;
    color: var(--dark-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 15px;
}

    .nav-link:hover,
    .nav-item:hover .nav-link {
        background-color: var(--primary-color);
        color: var(--light-color);
    }

.icon-sub {
    font-size: 12px;
    margin-left: 5px;
}

/* --- DROPDOWN HOVER hiệu ứng Mega Menu --- */
.dropdown-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    width: 450px;
    background-color: var(--light-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    border-top: 3px solid var(--primary-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 15px;
}

/* Kích hoạt khi đưa chuột vào (Hover) */
.has-dropdown:hover .dropdown-mega {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Lưới hiển thị các Lớp học */
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

    .dropdown-grid a {
        color: var(--dark-color);
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 14px;
    }

        .dropdown-grid a:hover {
            background-color: var(--cream-yellow);
            color: var(--primary-color);
            font-weight: 600;
        }

/* Nút Toggle Mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    padding: 10px 0;
    cursor: pointer;
}

/* ==========================================================================
   HEADINGS / TYPE SCALE
   ========================================================================== */
.hero-title,
.section-title,
.resource-title,
.post-item-title {
    font-family: "Baloo 2", "Segoe UI", sans-serif;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    background: linear-gradient( 160deg, var(--soft-blue-bg) 0%, #eaf6fb 55%, var(--light-color) 100% );
    padding: 70px 0 90px;
    overflow: hidden;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    background-color: rgba(0, 141, 218, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 18px;
}

.hero-highlight {
    color: var(--primary-color);
    position: relative;
}

.hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    max-width: 520px;
    margin-bottom: 28px;
}

.hero-search {
    display: flex;
    gap: 10px;
    background-color: var(--light-color);
    padding: 8px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 141, 218, 0.15);
    margin-bottom: 30px;
}

    .hero-search .form-select {
        max-width: 170px;
        border: none;
        background-color: #f5f9fc;
        font-size: 14px;
        font-weight: 600;
        border-radius: 10px;
    }

    .hero-search .form-control {
        border: none;
        background-color: #f5f9fc;
        border-radius: 10px;
        font-size: 14px;
    }

        .hero-search .form-select:focus,
        .hero-search .form-control:focus {
            box-shadow: none;
            outline: 2px solid var(--accent-blue);
        }

.btn-hero-search {
    background-color: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: 10px;
    padding: 0 22px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

    .btn-hero-search:hover {
        background-color: var(--accent-blue);
    }

.hero-stats {
    display: flex;
    gap: 36px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
}

    .hero-stat strong {
        font-family: "Baloo 2", sans-serif;
        font-size: 22px;
        color: var(--primary-color);
    }

    .hero-stat span {
        font-size: 13px;
        color: #555;
    }

/* Signature: fanned document stack */
.hero-stack {
    position: relative;
    height: 340px;
    max-width: 380px;
    margin: 0 auto;
}

.stack-card {
    position: absolute;
    width: 230px;
    height: 150px;
    border-radius: 18px;
    left: 50%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    font-family: "Baloo 2", sans-serif;
    font-size: 15px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.12);
    color: var(--dark-color);
}

    .stack-card i {
        font-size: 26px;
    }

.stack-card--lesson {
    background-color: var(--cream-yellow);
    transform: translate(-70%, -30%) rotate(-9deg);
    z-index: 3;
}

.stack-card--exam {
    background-color: var(--light-blue);
    transform: translate(-30%, -55%) rotate(4deg);
    z-index: 2;
}

.stack-card--post {
    background-color: var(--soft-blue-bg);
    transform: translate(-50%, -78%) rotate(-2deg);
    z-index: 1;
}

.stack-card--lesson i,
.stack-card--lesson span {
    color: #7a5f00;
}

.stack-card--exam i,
.stack-card--exam span {
    color: #0d6b6a;
}

.stack-card--post i,
.stack-card--post span {
    color: var(--primary-color);
}

/* ==========================================================================
   CONTENT SECTIONS (Giáo án / Đề thi / Bài viết)
   ========================================================================== */
.content-section {
    padding: 60px 0;
}

.content-section--tinted {
    background-color: #f6fbfd;
}

.section-heading {
    margin-bottom: 30px;
}

.section-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
}

.section-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

    .section-link:hover {
        color: var(--accent-blue);
    }

/* --- Resource Card (Giáo án / Đề thi) --- */
.resource-card {
    background-color: var(--light-color);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

    .resource-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 14px 30px rgba(0, 141, 218, 0.18);
    }

.resource-thumb {
    position: relative;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--light-color);
}

.resource-thumb--lesson {
    background: linear-gradient( 135deg, var(--primary-color), var(--accent-blue) );
}

.resource-thumb--exam {
    background: linear-gradient( 135deg, var(--secondary-color), var(--light-blue) );
}

/* Folder-tab corner fold indicating file type */
.file-tab {
    position: absolute;
    top: 0;
    right: 16px;
    padding: 5px 12px;
    border-radius: 0 0 8px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--dark-color);
}

.file-tab--pdf {
    background-color: var(--cream-yellow);
}

.file-tab--docx {
    background-color: var(--light-color);
}

.file-tab--ppt {
    background-color: var(--soft-blue-bg);
}

.resource-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: var(--soft-blue-bg);
    color: var(--primary-color);
}

.resource-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.resource-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 16px;
    flex-grow: 1;
}

.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
}

.resource-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #444;
}

.resource-meta {
    display: flex;
    gap: 12px;
    color: #888;
}

.avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-circle--lg {
    width: 44px;
    height: 44px;
    font-size: 16px;
    background-color: var(--secondary-color);
}

/* --- Post list (Chia sẻ trong ngành) --- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.post-item {
    display: flex;
    gap: 18px;
    background-color: var(--light-color);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.25s ease;
}

    .post-item:hover {
        box-shadow: 0 10px 24px rgba(0, 141, 218, 0.12);
    }

.post-item-body {
    flex-grow: 1;
}

.post-item-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.post-item-footer {
    display: flex;
    gap: 18px;
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}

    .post-item-footer span:first-child {
        font-weight: 700;
        color: var(--primary-color);
    }

/* ==========================================================================
   FOOTER STYLE
   ========================================================================== */
.main-footer {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 40px 0 10px 0;
    margin-top: auto;
}

.footer-title {
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

    .footer-title::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 50px;
        height: 2px;
        background-color: var(--cream-yellow);
    }

.footer-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--cream-yellow);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 10px;
    }

    .footer-links a {
        color: var(--light-color);
        font-size: 14px;
    }

        .footer-links a:hover {
            color: var(--cream-yellow);
            padding-left: 5px;
        }

.footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 30px 0 20px 0;
}

.footer-copyright {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   PAGE BANNER + BREADCRUMB (dùng cho các trang con)
   ========================================================================== */
.page-banner {
    background: linear-gradient(160deg, var(--soft-blue-bg) 0%, #eaf6fb 100%);
    padding: 26px 0;
}

.breadcrumb-nav {
    font-size: 13px;
    color: #557;
    margin-bottom: 10px;
}

    .breadcrumb-nav a {
        color: #557;
    }

        .breadcrumb-nav a:hover {
            color: var(--primary-color);
        }

    .breadcrumb-nav .current {
        color: var(--primary-color);
        font-weight: 600;
    }

.page-banner-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0;
}

.page-banner-count {
    color: #667;
    font-size: 14px;
    margin-top: 4px;
}

/* ==========================================================================
   FILTER BAR (danh sách giáo án / đề thi)
   ========================================================================== */
.filter-bar {
    padding: 18px 0;
    border-bottom: 1px solid #eef3f7;
}

.grade-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.grade-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: #f2f7fa;
    color: #445;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

    .grade-tab:hover {
        background-color: var(--soft-blue-bg);
        color: var(--primary-color);
    }

    .grade-tab.active {
        background-color: var(--primary-color);
        color: var(--light-color);
    }

.filter-selects {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

    .filter-selects .form-select {
        width: auto;
        font-size: 13px;
        border-radius: 8px;
        border-color: #e2eaf0;
    }

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 46px;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f2f7fa;
    color: #445;
    font-weight: 600;
    font-size: 14px;
    padding: 0 10px;
}

    .page-btn:hover {
        background-color: var(--soft-blue-bg);
        color: var(--primary-color);
    }

    .page-btn.active {
        background-color: var(--primary-color);
        color: var(--light-color);
    }

    .page-btn.disabled {
        opacity: 0.4;
        pointer-events: none;
    }

/* ==========================================================================
   DETAIL PAGE (Giáo án / Đề thi)
   ========================================================================== */
.detail-wrap {
    max-width: 820px;
    margin: 0 auto;
}

.detail-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.35;
}

.detail-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eef3f7;
    margin-bottom: 28px;
}

.detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-author-name {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 14px;
}

.detail-author-date {
    font-size: 12px;
    color: #889;
}

.detail-download-count {
    font-size: 13px;
    color: #667;
    display: flex;
    align-items: center;
    gap: 6px;
}

.download-card {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    border-radius: 18px;
    padding: 36px;
    text-align: center;
    color: var(--light-color);
    margin-bottom: 32px;
}

    .download-card i.file-icon {
        font-size: 44px;
        margin-bottom: 12px;
    }

    .download-card .file-name {
        font-weight: 700;
        font-size: 16px;
        margin-bottom: 4px;
    }

    .download-card .file-size {
        font-size: 13px;
        opacity: 0.85;
        margin-bottom: 18px;
    }

.btn-download {
    background-color: var(--light-color);
    color: var(--primary-color);
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 24px;
    border: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-download:hover {
        background-color: var(--cream-yellow);
    }

.detail-desc {
    font-size: 15px;
    line-height: 1.85;
    color: #333;
    margin-bottom: 32px;
}

    .detail-desc h3 {
        font-family: "Baloo 2", sans-serif;
        font-size: 1.15rem;
        margin: 20px 0 10px;
    }

/* Vote widget */
.vote-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: #f6fbfd;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 36px;
}

.vote-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--light-color);
    border: 1px solid #e2eaf0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667;
    font-size: 16px;
}

    .vote-btn:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .vote-btn.upvoted {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: var(--light-color);
    }

.vote-score {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-color);
    min-width: 40px;
    text-align: center;
}

.vote-label {
    font-size: 12px;
    color: #889;
}

/* Comments */
.comment-section-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

    .comment-form textarea {
        flex-grow: 1;
        border: 1px solid #e2eaf0;
        border-radius: 12px;
        padding: 12px 14px;
        font-size: 14px;
        resize: none;
        min-height: 46px;
    }

        .comment-form textarea:focus {
            outline: 2px solid var(--accent-blue);
        }

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.comment-body {
    background-color: #f6fbfd;
    border-radius: 12px;
    padding: 12px 16px;
    flex-grow: 1;
}

.comment-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--dark-color);
}

.comment-date {
    font-size: 11px;
    color: #99a;
    margin-left: 8px;
}

.comment-text {
    font-size: 13px;
    color: #444;
    margin-top: 4px;
    line-height: 1.6;
}

.comment-reply {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 6px;
    display: inline-block;
}

/* ==========================================================================
   FORM PAGES (Thêm/Sửa Giáo án, Đề thi, Bài viết)
   ========================================================================== */
.form-card {
    max-width: 720px;
    margin: 0 auto;
    background-color: var(--light-color);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 36px;
}

.form-card-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.form-control,
.form-select {
    border: 1px solid #e2eaf0;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    width: 100%;
}

    .form-control:focus,
    .form-select:focus {
        outline: none;
        border-color: var(--accent-blue);
        box-shadow: 0 0 0 3px rgba(90, 178, 255, 0.2);
    }

.form-hint {
    font-size: 12px;
    color: #889;
    margin-top: 6px;
}

.dropzone {
    border: 2px dashed #cfe0ea;
    border-radius: 14px;
    padding: 34px;
    text-align: center;
    color: #667;
    background-color: #f9fcfd;
}

    .dropzone i {
        font-size: 30px;
        color: var(--secondary-color);
        margin-bottom: 10px;
    }

    .dropzone strong {
        color: var(--primary-color);
    }

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f6fbfd;
    border-radius: 12px;
    padding: 14px 18px;
}

.toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #d7e3ea;
    border-radius: 26px;
    transition: 0.3s;
    cursor: pointer;
}

    .toggle-slider::before {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        left: 3px;
        top: 3px;
        background-color: var(--light-color);
        border-radius: 50%;
        transition: 0.3s;
    }

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(20px);
    }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
}

.btn-form-primary {
    background-color: var(--primary-color);
    color: var(--light-color);
    font-weight: 700;
    padding: 11px 28px;
    border-radius: 24px;
    border: none;
    font-size: 14px;
}

    .btn-form-primary:hover {
        background-color: var(--accent-blue);
    }

.btn-form-secondary {
    background-color: #f2f7fa;
    color: #556;
    font-weight: 700;
    padding: 11px 24px;
    border-radius: 24px;
    border: none;
    font-size: 14px;
}

    .btn-form-secondary:hover {
        background-color: #e6eef3;
    }

/* ==========================================================================
   ARTICLE / POST DETAIL PAGE
   ========================================================================== */
.article-wrap {
    max-width: 760px;
    margin: 0 auto;
}

.article-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 18px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eef3f7;
    margin-bottom: 28px;
}

.article-meta-text {
    font-size: 13px;
    color: #778;
}

    .article-meta-text strong {
        color: var(--dark-color);
        display: block;
        font-size: 14px;
    }

.article-body {
    font-size: 16px;
    line-height: 1.9;
    color: #2b2b2b;
}

    .article-body p {
        margin-bottom: 20px;
    }

    .article-body h3 {
        font-family: "Baloo 2", sans-serif;
        font-size: 1.3rem;
        margin: 28px 0 12px;
    }

/* ==========================================================================
   USER PROFILE
   ========================================================================== */
.profile-cover {
    height: 220px;
    background: linear-gradient( 120deg, var(--primary-color), var(--secondary-color) 60%, var(--light-blue) );
    border-radius: 0 0 24px 24px;
}

.profile-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: -60px;
    padding: 0 10px 26px;
    border-bottom: 1px solid #eef3f7;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid var(--light-color);
    background-color: var(--cream-yellow);
    color: #7a5f00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Baloo 2", sans-serif;
    font-size: 44px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.profile-info {
    padding-bottom: 6px;
}

.profile-name {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.profile-sub {
    font-size: 13px;
    color: #778;
    margin-top: 4px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    padding-bottom: 6px;
}

.btn-follow {
    background-color: var(--primary-color);
    color: var(--light-color);
    font-weight: 700;
    padding: 9px 22px;
    border-radius: 22px;
    border: none;
    font-size: 13px;
}

    .btn-follow:hover {
        background-color: var(--accent-blue);
    }

.btn-edit-profile {
    background-color: #f2f7fa;
    color: #445;
    font-weight: 700;
    padding: 9px 22px;
    border-radius: 22px;
    border: none;
    font-size: 13px;
}

    .btn-edit-profile:hover {
        background-color: var(--soft-blue-bg);
        color: var(--primary-color);
    }

.profile-stats {
    display: flex;
    gap: 26px;
    padding: 18px 10px;
}

.profile-stat strong {
    font-family: "Baloo 2", sans-serif;
    color: var(--primary-color);
    font-size: 17px;
}

.profile-stat span {
    font-size: 12px;
    color: #778;
    margin-left: 4px;
}

.profile-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #eef3f7;
    margin-bottom: 30px;
    overflow-x: auto;
}

.profile-tab {
    padding: 12px 20px;
    font-weight: 700;
    font-size: 14px;
    color: #778;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

    .profile-tab:hover {
        color: var(--primary-color);
    }

    .profile-tab.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

.activity-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f2f6f9;
    font-size: 14px;
    color: #445;
}

    .activity-item i {
        color: var(--secondary-color);
        margin-top: 3px;
    }

    .activity-item .activity-date {
        display: block;
        font-size: 12px;
        color: #99a;
        margin-top: 3px;
    }

/* ==========================================================================
   ACCOUNT SETTINGS
   ========================================================================== */
.settings-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.settings-nav {
    width: 220px;
    flex-shrink: 0;
    background-color: var(--light-color);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    padding: 10px;
    position: sticky;
    top: 20px;
}

    .settings-nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        color: #556;
    }

        .settings-nav a:hover {
            background-color: #f2f7fa;
            color: var(--primary-color);
        }

        .settings-nav a.active {
            background-color: var(--soft-blue-bg);
            color: var(--primary-color);
        }

.settings-panel {
    flex-grow: 1;
    background-color: var(--light-color);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    padding: 32px;
}

.settings-panel-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.social-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border: 1px solid #eef3f7;
    border-radius: 12px;
    margin-bottom: 14px;
}

    .social-link-row .social-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .social-link-row i {
        font-size: 22px;
    }

        .social-link-row i.fa-google {
            color: #ea4335;
        }

        .social-link-row i.fa-facebook {
            color: #1877f2;
        }

.social-status {
    font-size: 12px;
    color: #889;
}

.btn-social-connect {
    background-color: #f2f7fa;
    color: var(--primary-color);
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    font-size: 13px;
}

    .btn-social-connect:hover {
        background-color: var(--soft-blue-bg);
    }

.settings-divider {
    border-top: 1px solid #eef3f7;
    margin: 30px 0;
}

/* ==========================================================================
   AUTH PAGES (Đăng nhập / Đăng ký)
   ========================================================================== */
.auth-section {
    min-height: calc(100vh - 260px);
    display: flex;
    align-items: center;
    background: linear-gradient(160deg, var(--soft-blue-bg) 0%, #eaf6fb 55%, var(--light-color) 100%);
    padding: 60px 0;
}

.auth-wrap {
    max-width: 440px;
    margin: 0 auto;
    background-color: var(--light-color);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0, 141, 218, 0.15);
    padding: 40px;
}

.auth-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    background-color: rgba(0, 141, 218, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.auth-title {
    font-family: "Baloo 2", sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #667;
    margin-bottom: 28px;
}

.auth-wrap .form-group {
    margin-bottom: 18px;
}

.input-with-icon {
    position: relative;
}

    .input-with-icon i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #99a;
        font-size: 14px;
    }

    .input-with-icon .form-control {
        padding-left: 40px;
    }

    .input-with-icon .toggle-password {
        left: auto;
        right: 14px;
        cursor: pointer;
        pointer-events: auto;
    }

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 24px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #556;
}

    .auth-remember input {
        width: 15px;
        height: 15px;
        accent-color: var(--primary-color);
    }

.auth-forgot {
    color: var(--primary-color);
    font-weight: 600;
}

    .auth-forgot:hover {
        color: var(--accent-blue);
    }

.btn-auth-primary {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--light-color);
    font-weight: 700;
    padding: 13px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    margin-bottom: 22px;
}

    .btn-auth-primary:hover {
        background-color: var(--accent-blue);
    }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #99a;
    margin-bottom: 22px;
}

    .auth-divider::before,
    .auth-divider::after {
        content: "";
        flex-grow: 1;
        height: 1px;
        background-color: #eef3f7;
    }

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 26px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px;
    border-radius: 12px;
    border: 1px solid #e2eaf0;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
    background-color: var(--light-color);
}

    .btn-social:hover {
        background-color: #f6fbfd;
        border-color: var(--accent-blue);
    }

    .btn-social i.fa-google {
        color: #ea4335;
    }

    .btn-social i.fa-facebook {
        color: #1877f2;
    }

.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: #667;
}

    .auth-footer-text a {
        color: var(--primary-color);
        font-weight: 700;
    }

        .auth-footer-text a:hover {
            color: var(--accent-blue);
        }

.auth-terms {
    font-size: 12px;
    color: #778;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 24px;
}

    .auth-terms input {
        width: 15px;
        height: 15px;
        margin-top: 2px;
        accent-color: var(--primary-color);
        flex-shrink: 0;
    }

    .auth-terms a {
        color: var(--primary-color);
        font-weight: 600;
    }

/* ==========================================================================
   RESPONSIVE (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Hiện nút hamburger */
    }

    .nav-menu {
        display: none !important; /* Ẩn menu chính mặc định trên mobile */
        flex-direction: column;
        width: 100%;
        background-color: var(--soft-blue-bg);
        padding-bottom: 15px;
    }

        /* Class kích hoạt hiển thị bằng JS */
        .nav-menu.show {
            display: flex !important;
        }

    .nav-link {
        padding: 12px 15px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Biến đổi Dropdown thành dạng mở tràn trên mobile */
    .dropdown-mega {
        position: static;
        transform: none !important;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none; /* Ẩn mặc định, điều khiển bằng JS click */
        padding: 10px 20px;
        background-color: rgba(255, 255, 255, 0.5);
    }

    .has-dropdown.active .dropdown-mega {
        display: block;
    }

    .dropdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section {
        padding: 40px 0 60px;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-search {
        flex-wrap: wrap;
    }

        .hero-search .form-select,
        .hero-search .form-control {
            max-width: 100%;
            flex: 1 1 100%;
        }

    .hero-stats {
        justify-content: center;
    }

    .hero-stack {
        height: 240px;
        margin-top: 30px;
    }

    .stack-card {
        width: 190px;
        height: 120px;
        font-size: 13px;
    }

        .stack-card i {
            font-size: 20px;
        }

    .section-heading {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .post-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .post-item-footer {
        justify-content: center;
    }

    .detail-meta-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-form {
        flex-direction: column;
    }

    .form-card {
        padding: 24px 18px;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .profile-head {
        flex-direction: column;
        align-items: flex-start;
        margin-top: -50px;
    }

    .profile-avatar {
        width: 96px;
        height: 96px;
        font-size: 34px;
    }

    .profile-actions {
        padding-bottom: 0;
    }

    .settings-layout {
        flex-direction: column;
    }

    .settings-nav {
        width: 100%;
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 4px;
    }

        .settings-nav a {
            white-space: nowrap;
        }

    .settings-panel {
        padding: 22px 18px;
    }

    .auth-wrap {
        padding: 28px 22px;
    }

    .auth-section {
        padding: 30px 0;
    }
}


/* --- Mega menu phân nhóm theo Cấp học (Mầm non / Tiểu học / THCS / THPT) --- */
/* --- Mega menu phân nhóm theo Cấp học (Mầm non / Tiểu học / THCS / THPT) --- */
.dropdown-grid-levels {
    display: flex;
    gap: 18px;
}

.nav-level-group {
    flex: 1;
    min-width: 0;
}

.nav-level-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--soft-blue-bg);
}

.nav-level-group a {
    display: block;
    padding: 6px 8px;
    color: var(--dark-color);
    font-size: 14px;
    border-radius: 4px;
    white-space: nowrap;
}

    .nav-level-group a:hover {
        background-color: var(--cream-yellow);
        color: var(--primary-color);
        font-weight: 600;
    }

/* Mega menu cần rộng hơn để chứa 4 cột cấp học */
.has-dropdown .dropdown-mega {
    width: 640px;
}

@media (max-width: 992px) and (min-width: 769px) {
    .has-dropdown .dropdown-mega {
        width: 520px;
    }

    .dropdown-grid-levels {
        flex-wrap: wrap;
    }

    .nav-level-group {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .has-dropdown .dropdown-mega {
        width: 100%;
    }

    .dropdown-grid-levels {
        flex-direction: column;
        gap: 14px;
    }
}

/* --- Thanh tìm kiếm (select + input + button liền khối) --- */
.search-bar-row {
    background-color: var(--light-color);
    padding: 12px 0;
    border-bottom: 1px solid var(--soft-blue-bg);
}

.search-bar-group {
    display: flex;
    align-items: stretch;
    max-width: 700px;
    margin: 0 auto;
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    overflow: hidden;
}

.search-select {
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    background-color: var(--soft-blue-bg);
    padding: 0 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 160px;
}

.search-input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background-color: var(--light-color);
}

.search-btn {
    border: none;
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 0 24px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

    .search-btn:hover {
        background-color: var(--accent-blue);
    }

@media (max-width: 576px) {
    .search-select {
        max-width: 110px;
        font-size: 12px;
        padding: 0 8px;
    }

    .search-btn {
        padding: 0 16px;
    }
}

/* --- Đăng bài dropdown: icon thẳng hàng icon, text thẳng hàng text --- */
.dropdown-item-icon {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    margin-right: 10px;
    color: var(--primary-color);
}

/* --- Bộ lọc trang kết quả tìm kiếm (Lớp theo Cấp học + Môn học) --- */
.search-filter-panel {
    background: var(--light-color);
    border: 1px solid var(--soft-blue-bg);
    border-radius: 10px;
    padding: 16px 20px;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
    user-select: none;
}

    .filter-panel-header .filter-toggle-icon {
        font-size: 13px;
        color: var(--primary-color);
        transition: transform 0.2s ease;
    }

.filter-panel-body {
    margin-top: 14px;
}

/* --- Toggle độc lập cho từng nhóm filter (Lớp / Môn học riêng biệt) --- */
.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
    user-select: none;
    padding: 4px 0;
}

    .filter-section-header .filter-toggle-icon {
        font-size: 13px;
        color: var(--primary-color);
        transition: transform 0.2s ease;
    }

.filter-section-body {
    margin-top: 10px;
    margin-bottom: 4px;
}

.search-filter-panel hr {
    margin: 14px 0;
    border-color: var(--soft-blue-bg);
    opacity: 1;
}

.filter-level-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

    .filter-level-group:last-of-type {
        margin-bottom: 0;
    }

.filter-level-label {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 13px;
    margin-right: 2px;
    white-space: nowrap;
}

.filter-subject-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    border: 1px solid var(--soft-blue-bg);
    background: var(--light-color);
    color: var(--dark-color);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .filter-btn:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .filter-btn.active {
        background: var(--primary-color);
        color: var(--light-color);
        border-color: var(--primary-color);
    }

/*nav-level-addon    */