/* --- CÀI ĐẶT CHUNG VÀ FONT CHỮ --- */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #f093fb;
    --text-color: #333;
    --white-color: #ffffff;
    --light-gray-color: #f4f6f8;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-color: var(--light-gray-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- THANH ĐIỀU HƯỚNG CỐ ĐỊNH --- */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    overflow: visible;
    /* Thay đổi từ hidden để menu chia sẻ hiển thị */
    position: relative;
    /* Thêm để định vị menu con */
}

.nav-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.nav-icon.zalo {
    background: linear-gradient(135deg, #0068ff, #00a8ff);
}

.nav-icon.admin {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.nav-icon.members {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
}

.nav-icon.share {
    background: linear-gradient(135deg, #3498db, #2980b9);
    position: relative;
}

.nav-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Menu chia sẻ - CẢNH BÁO: ĐÃ CẬP NHẬT ĐỂ KHẮC PHỤC VẤN ĐỀ */
.share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    margin-top: 10px;
    display: none;
    z-index: 1002;
    /* Tăng z-index để đảm bảo hiển thị trên cùng */
    min-width: 180px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.share-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-option:hover {
    background-color: #f5f5f5;
}

.share-option i {
    width: 20px;
    text-align: center;
}

.share-option.facebook {
    color: #1877f2;
}

.share-option.zalo-share {
    color: #0068ff;
}

.share-option.tiktok {
    color: #000000;
}

.share-option.messenger {
    color: #0084ff;
}

.share-option.copy-link {
    color: #333;
}

/* --- NÚT CUỘN LÊN ĐẦU TRANG --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #27ae60, #229954);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* --- HERO SECTION (PHẦN ĐẦU TRANG) --- */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white-color);
    padding: 100px 0 60px;
    /* Thêm padding-top để có khoảng trống cho thanh điều hướng */
    text-align: center;
}

.hero .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 40px;
    text-align: left;
}

.hero-left {
    flex: 1;
    min-width: 280px;
    text-align: center;
}

.hero-right {
    flex: 2;
    min-width: 300px;
    text-align: center;
}

.hero-logo {
    max-width: 50%;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0px 5px 15px rgba(0, 0, 0, 0.3));
}

.hero-text-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #FFD700;
    /* MÀU VÀNG */
}

.hero-text-container p {
    font-size: 1rem;
    max-width: 700px;
    margin-bottom: 30px;
    color: #ffffff;
    /* MÀU TRẮNG */
}

.cta-button {
    display: inline-block;
    background-color: #8B4513;
    /* Màu nâu nhạt (SaddleBrown) */
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    padding: 12px 25px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    background-color: #6F4E37;
    /* Màu nâu đậm hơn khi di chuột qua */
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(111, 78, 55, 0.4);
    /* Bóng đổ màu nâu */
}

.hero-right h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    /* MÀU TRẮNG */
    margin-bottom: 15px;
}

/* VIDEO: Đặt kích thước lớn trên desktop, tự co giãn trên mobile */
.hero-right video {
    width: 601px;
    max-width: 100%;
    /* Giúp video co lại khi container nhỏ hơn 601px */
    height: auto;
    /* Giữ tỷ lệ khung hình */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- CÁC SECTION CHUNG --- */
section {
    padding: 80px 0;
    text-align: center;
}

section h3 {
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* --- COURSE DETAILS SECTION --- */
.course-details {
    background-color: var(--white-color);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: left;
}

.detail-item {
    background-color: var(--light-gray-color);
    padding: 30px;
    border-radius: 15px;
    transition: transform 0.3s;
}

.detail-item:hover {
    transform: translateY(-10px);
}

.detail-item .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.detail-item h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

/* --- VIDEO GALLERY SECTION WITH SIDEBAR --- */
.video-gallery-section {
    background-color: #f8f9fa;
    padding: 0;
    min-height: 100vh;
}

/* Layout: Sidebar + Main Video */
.video-layout {
    display: flex;
    gap: 0;
    height: 100vh;
}

/* Sidebar Menu */
.video-sidebar {
    width: 350px;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 12px 20px;
    margin: 0;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.video-menu {
    padding: 6px 8px;
}

/* Category Header - Updated to match Admin Menu */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
    font-weight: 600;
}

.category-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.category-title {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.category-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.category-header.active .category-arrow {
    transform: rotate(180deg);
    animation: none;
}

/* Category Submenu */
.category-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding-left: 4.5px;
}

.category-submenu.show {
    max-height: 1000px;
}

.video-menu-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    border: 2px solid transparent;
}

.video-menu-item:hover {
    background-color: #f0f1f3;
    transform: translateX(5px);
}

.video-menu-item.active {
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.1) 0%, rgba(37, 117, 252, 0.1) 100%);
    border-color: var(--primary-color);
}

.menu-item-thumbnail {
    position: relative;
    width: 120px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.menu-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-menu-item:hover .play-icon,
.video-menu-item.active .play-icon {
    opacity: 1;
}

.menu-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.menu-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.menu-item-duration {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Main Video Player */
.video-main {
    flex: 1;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}

/* Video Header */
.video-header {
    background: linear-gradient(135deg, #d2691e 0%, #ff8c42 100%);
    padding: 12px 30px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(210, 105, 30, 0.3);
}

.video-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.main-video-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding-bottom: 56.25%;
    /* Tỷ lệ 16:9 */
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.main-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Scrollbar cho sidebar */
.video-sidebar::-webkit-scrollbar {
    width: 8px;
}

.video-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.video-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.video-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Admin Menu Section */
.admin-menu-section {
    margin-top: auto;
    border-top: 2px solid #e5e7eb;
    padding: 10px;
}

.admin-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-bottom: 5px;
}

.admin-menu-header:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
}

.admin-menu-header .arrow-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.admin-menu-header.active .arrow-icon {
    transform: rotate(180deg);
}

.admin-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.admin-submenu.show {
    max-height: 500px;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    color: #374151;
    text-decoration: none;
    position: relative;
}

.submenu-item:hover {
    background-color: #e5e7eb;
    transform: translateX(5px);
}

.submenu-item i:first-child {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.submenu-item span {
    flex: 1;
}

.submenu-item .arrow-right {
    font-size: 0.7rem;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.submenu-item:hover .arrow-right {
    transform: translateX(3px);
}

/* Share Submenu */
.share-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-left: 10px;
    display: none;
    z-index: 1000;
    min-width: 180px;
}

.submenu-item:hover .share-submenu {
    display: block;
}

.share-submenu .share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-submenu .share-option:hover {
    background-color: #f5f5f5;
}

.share-submenu .share-option i {
    width: 20px;
    text-align: center;
}

.share-submenu .share-option.facebook {
    color: #1877f2;
}

.share-submenu .share-option.zalo-share {
    color: #0068ff;
}

.share-submenu .share-option.tiktok {
    color: #000000;
}

.share-submenu .share-option.copy-link {
    color: #333;
}

/* Responsive Optimization for Mobile with Hamburger Menu */
@media (max-width: 768px) {

    /* Main Layout Reset */
    .video-layout {
        display: block;
        height: auto;
        overflow: visible;
    }

    /* Ẩn/Hiện Header trên Mobile tùy ý, ở đây giữ lại nhưng nhỏ gọn */
    .video-header {
        padding: 10px;
    }

    .video-header h1 {
        display: block;
        font-size: 1rem;
        /* Nhỏ lại */
    }

    /* HAMBURGER MENU BUTTON */
    .hamburger-btn {
        display: flex !important;
        /* Hiện nút trên mobile */
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        border-radius: 50%;
        color: white;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        z-index: 3000;
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .hamburger-btn:active {
        transform: scale(0.9);
    }

    /* SIDEBAR DRAWER (Ngăn kéo menu) */
    .video-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        /* Chiếm 85% chiều rộng màn hình */
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 2100;
        transform: translateX(-100%);
        /* Ẩn sang trái mặc định */
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
        max-height: none;
        /* Reset đè thuộc tính cũ */
    }

    .video-sidebar.active {
        transform: translateX(0);
        /* Trượt ra */
    }

    /* OVERLAY (Lớp phủ đen mờ khi mở menu) */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2050;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(3px);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Video chiếm full màn hình mobile */
    .video-main {
        position: relative;
        height: auto;
        min-height: 100vh;
        padding-bottom: 80px;
        /* Chừa chỗ cho nút hamburger */
        z-index: 1;
    }

    .main-video-container {
        padding-bottom: 56.25%;
        height: 0;
    }

    .main-video-container iframe,
    #video-cover {
        position: absolute;
    }
}

/* --- FOOTER --- */
footer {
    background-color: var(--text-color);
    color: var(--light-gray-color);
    text-align: center;
    padding: 30px 0;
}

/* --- PHẦN ĐĂNG KÝ VÀ THANH TOÁN --- */
.auth-section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.auth-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.package-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.package-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.package-card.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.form-section {
    margin-top: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.form-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.form-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
    text-align: left;
}

.form-group label {
    font-size: 0.85rem;
    margin-bottom: 3px;
    color: #374151;
}

.form-group input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.form-group input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.form-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #6366f1;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover {
    background-color: #4f46e5;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.qr-section {
    margin-top: 16px;
    padding: 14px;
    border-radius: 10px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.qr-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.qr-left,
.qr-center,
.qr-right {
    flex: 1;
    min-width: 220px;
}

.qr-left h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 6px 0 8px 0;
}

.price-tag {
    background-color: #ef4444;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.discount-price {
    font-size: 0.8rem;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: bold;
}

.form-note {
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 8px;
}

.bank-info {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px dashed #d1d5db;
    margin-bottom: 8px;
}

.bank-info h4 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bank-info p {
    margin: 2px 0;
    font-size: 0.8rem;
    color: #374151;
}

.transaction-info,
.transaction-details {
    font-size: 0.8rem;
    color: #374151;
}

.transaction-info p,
.transaction-details p {
    margin: 2px 0;
}

.qr-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 6px;
}

.qr-image {
    max-width: 200px;
    margin: 0 auto;
}

#qrCodeImage {
    width: 100%;
    height: auto;
    display: block;
}

.qr-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.qr-controls select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
}

/* --- MODAL DANH SÁCH HỌC VIÊN --- */
.members-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    overflow: auto;
    animation: fadeIn 0.3s;
}

.members-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.members-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
}

.members-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.members-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.members-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.members-modal-close:hover {
    color: #333;
    background-color: #f5f5f5;
}

.members-table-container {
    overflow-x: auto;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.members-table th,
.members-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.members-table th {
    background-color: var(--light-gray-color);
    font-weight: 600;
    color: var(--primary-color);
    position: sticky;
    top: 0;
}

.members-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.members-table tr:hover {
    background-color: #f1f1f1;
}

.student-code {
    font-weight: 600;
    color: #0066cc;
    background-color: #e6f2ff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-paid {
    background-color: #28a745;
    color: white;
}

.status-unpaid {
    background-color: #dc3545;
    color: white;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* --- MODAL THÔNG BÁO --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.modal-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.modal-icon.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-icon.info {
    background-color: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.modal-content {
    margin-bottom: 20px;
    color: #4b5563;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.modal-btn.primary {
    background-color: #6366f1;
    color: white;
}

.modal-btn.primary:hover {
    background-color: #4f46e5;
}

.modal-btn.secondary {
    background-color: #f3f4f6;
    color: #374151;
    margin-left: 8px;
}

.modal-btn.secondary:hover {
    background-color: #e5e7eb;
}

/* Ẩn footer của modal khi có class no-footer */
.modal-box.no-footer .modal-footer {
    display: none;
}

/* --- PHẦN UPLOAD MINH CHỨNG THANH TOÁN (ĐÃ CẬP NHẬT) --- */
.proof-section {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    background-color: #f0f7ff;
    border: 1px solid #d1e7ff;
}

.proof-section h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proof-upload-container {
    margin-top: 15px;
}

.proof-upload-area {
    border: 2px dashed #d1e7ff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background-color: #fafcff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.proof-upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #eef5ff;
}

.upload-icon {
    font-size: 3rem;
    color: #6366f1;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 15px;
}

.upload-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 10px;
}

.proof-preview-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.proof-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
}

.proof-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.proof-preview-info {
    flex: 1;
    min-width: 0;
    /* Cho phép text bị truncate khi cần thiết */
}

.proof-preview-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proof-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.proof-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #4b5563;
}

/* --- RESPONSIVE DESIGN (TỐI ƯU CHO DI ĐỘNG) --- */
@media (max-width: 768px) {
    .nav-logo {
        font-size: 1rem;
    }

    .nav-logo img {
        height: 30px;
    }

    .nav-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .nav-icon img {
        width: 20px;
        height: 20px;
    }

    .hero {
        padding: 80px 0 40px;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        /* Giảm khoảng cách giữa các khối khi xếp dọc */
    }

    .hero-left,
    .hero-right {
        flex: 1 1 100%;
        width: 100%;
    }

    .hero-text-container h1 {
        font-size: 2.2rem;
        /* Tăng kích thước chữ để dễ đọc hơn */
    }

    .hero-text-container p {
        font-size: 1rem;
    }

    .hero-right h2 {
        font-size: 1.4rem;
        /* Tăng kích thước chữ */
        margin-bottom: 20px;
    }

    /* Cho video chiếm toàn bộ chiều rộng trên mobile */
    .hero-right video {
        width: 100%;
        max-width: none;
    }

    section {
        padding: 60px 0;
    }

    section h3 {
        font-size: 1.8rem;
    }

    .carousel-arrow {
        width: 35px;
        height: 35px;
    }

    .prev-arrow {
        left: -10px;
    }

    .next-arrow {
        right: -10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        /* Form trên 1 cột trên mobile */
    }

    .qr-container {
        flex-direction: column;
        /* Các khối QR xếp dọc trên mobile */
    }

    /* Cải thiện hiển thị của phần upload minh chứng trên mobile */
    .proof-preview {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .proof-preview img {
        width: 120px;
        height: 120px;
        max-width: 80%;
    }

    .proof-preview-info {
        width: 100%;
        text-align: center;
    }

    .proof-preview-info p {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .proof-actions {
        justify-content: center;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        flex: 1;
        max-width: 150px;
    }

    .members-modal-content {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }

    .members-table th,
    .members-table td {
        padding: 8px 5px;
        font-size: 0.85rem;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {

    /* Tối ưu cho màn hình rất nhỏ */
    .proof-preview img {
        width: 100px;
        height: 100px;
    }

    .proof-upload-area {
        padding: 20px 15px;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .upload-text {
        font-size: 0.9rem;
    }

    .upload-note {
        font-size: 0.75rem;
    }
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal thông báo lỗi */
.error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.error-modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.error-modal-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 15px;
}

.error-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.error-modal-message {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

.error-modal-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.error-modal-btn:hover {
    background-color: #c82333;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal thông báo lỗi */
.error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.error-modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.error-modal-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 15px;
}

.error-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.error-modal-message {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

.error-modal-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.error-modal-btn:hover {
    background-color: #c82333;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}