/* =================================================================== */
/* --- 1. BIẾN MÀU VÀ THIẾT LẬP CHUNG (RESET) --- */
/* =================================================================== */
:root {
    --background-dark: #121826;
    --card-dark: #1E293B;
    --border-color: #334155;
    --primary-accent: #6a3ff6;
    --text-light: #F8FAFC;
    --text-secondary: #94A3B8;
    --message-user-bg: #4F46E5;
    --message-other-bg: #374151;
    --status-green: #28a745;
    --status-yellow: #ffc107;
    --status-red: #dc3545;
    --cyber-neon: #00ffe1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter var", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Major Mono Display", monospace;
    background-color: var(--background-dark);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-size: 16px;
}

/* =================================================================== */
/* --- 2. LAYOUT CHÍNH (USER & ADMIN) --- */
/* =================================================================== */
.main-layout {
    /* Styles handled by Tailwind in HTML */
}

.sidebar {
    width: 280px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

.content-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 20;
    /* Ngăn scroll ở cấp cao nhất */
}

/* KHÔI PHỤC BACKGROUND HIỂN THỊ TRÊN ADMIN.HTML */
body:not(.dashboard-glass) .sidebar,
body:not(.dashboard-glass) .card {
    background-color: var(--card-dark);
}

body:not(.dashboard-glass) .sidebar,
body:not(.dashboard-glass) .card {
    border: 1px solid var(--border-color);
}

body:not(.dashboard-glass) .main-layout {
    background-color: var(--background-dark);
    display: flex;
    /* Bắt buộc để Sidebar và Content nằm ngang */
    flex-direction: row;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    width: 100%;
    margin: 30px auto;
    height: 90vh;
    overflow: hidden;
    max-width: 1400px;
}

.page-content {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
}

.page-content.active {
    display: flex;
}

.page-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Viền mờ */
    text-align: left;
    flex-shrink: 0;
}

.page-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.page-body {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

/* --- Style cho Logo --- */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    text-decoration: none;
}

.sidebar-logo img {
    height: 60px;
    filter: drop-shadow(0 4px 10px rgba(124, 131, 255, .25));
}

.sidebar-logo span {
    font-weight: 700;
    letter-spacing: .2px
}

/* --- Cập nhật Header Mobile --- */
.mobile-header {
    justify-content: space-between;
    /* Dàn các item ra */
}

.mobile-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 35px;
    /* Chiều cao logo mobile */
}

.mobile-logo img {
    height: 100%;
}

/* Quan trọng: Đảm bảo lớp phủ che đúng */
@media (max-width: 992px) {
    .mobile-overlay.show {
        display: block;
    }
}

.nav-menu li a {
    position: relative;
    /* Cần để định vị chấm thông báo */
}

.notification-dot {
    display: block;
    width: 8px;
    height: 8px;
    background-color: #e63946;
    border-radius: 50%;
    position: absolute;
    top: 12px;
    right: 12px;
    border: 1px solid var(--sidebar-bg);
}

/* Style cho khu vực input chat mới */
.input-area-wrapper {
    padding: 15px;
    background-color: transparent;
    /* TRONG SUỐT */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.input-area button {
    /* Ghi đè lại style nút gửi */
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.input-area button i {
    margin: 0;
    width: auto;
}

.message {
    position: relative;
    padding-bottom: 25px;
}

.message-time {
    position: absolute;
    bottom: 8px;
    right: 15px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message.admin .message-time {
    left: 15px;
    right: auto;
}

.message-content {
    position: relative;
}

.reply-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -30px;
    /* Hoặc right: -30px cho .message.user */
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .reply-icon {
    opacity: 1;
}

.message.user .reply-icon {
    order: 2;
    /* Luôn nằm ở cuối */
    left: auto;
    right: -30px;
}

.reply-context {
    width: 100%;
    padding: 10px;
    background-color: var(--background-dark);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-accent);
    display: flex;
    justify-content: space-between;
}

.reply-sender {
    font-weight: bold;
    font-size: 0.9rem;
}

.reply-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* CSS cho tin nhắn được reply */
.replied-message {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-accent);
}

.replied-message .sender {
    font-weight: bold;
    font-size: 0.8rem;
}

.replied-message .content {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =================================================================== */
/* --- 3. CÁC THÀNH PHẦN TÁI SỬ DỤNG --- */
/* =================================================================== */

/* --- Card --- */
.card {
    width: 100%;
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-dark);
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.card-body {
    padding: 20px;
}

/* --- Form --- */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #121826;
    color: var(--text-light);
    font-size: 1rem;
}

/* Fix dropdown options white-on-white issue */
select option {
    background-color: #121826;
    color: var(--text-light);
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

/* --- Button --- */
.buy-button,
.save-btn,
.action-btn {
    background-color: var(--primary-accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn {
    padding: 5px 10px;
    margin-right: 5px;
}

.edit-btn {
    background-color: #007bff;
}

.delete-btn {
    background-color: var(--status-red);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    /* Sửa lỗi lệch góc */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* =================================================================== */
/* --- MODAL GLASSMORPHISM TWEAKS --- */
/* =================================================================== */
.dashboard-glass .modal-overlay {
    background-color: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.dashboard-glass .modal-content {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
    border-radius: 20px !important;
}

.dashboard-glass .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.dashboard-glass .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.dashboard-glass textarea,
.dashboard-glass input[type="text"],
.dashboard-glass input[type="email"],
.dashboard-glass input[type="password"],
.dashboard-glass input[type="number"],
.dashboard-glass select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    transition: all 0.3s ease !important;
}

.dashboard-glass textarea:focus,
.dashboard-glass input[type="text"]:focus,
.dashboard-glass input[type="email"]:focus,
.dashboard-glass input[type="password"]:focus,
.dashboard-glass input[type="number"]:focus,
.dashboard-glass select:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 15px rgba(106, 63, 246, 0.4) !important;
}

/* Hiệu ứng Fade In cho Modal */
@keyframes glassModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-glass .modal-content {
    animation: glassModalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background-color: var(--background-dark);
    color: var(--text-light);
}

/* --- Hiệu ứng Animation Nâng cao cho Modal (WOW Factor) --- */
@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px rgba(106, 63, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(106, 63, 246, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(106, 63, 246, 0.4);
    }
}

#download-result-modal .modal-content {
    animation: modalPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#download-result-modal.show #result-modal-icon {
    animation: iconBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.1s;
    /* Chờ modal pop lên một chút */
    opacity: 0;
}

#result-modal-download-btn {
    animation: glowPulse 2s infinite;
    transition: transform 0.2s;
}

#result-modal-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(106, 63, 246, 1);
}

/* ----------------------------------------------------------- */
.modal-content.modal-split-layout {
    max-width: 900px;
    display: flex;
    flex-direction: row;
    /* Xếp 2 cột nằm ngang */
    padding: 0;
    overflow: hidden;
}

/* Nút X ở góc */
.modal-close-corner {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 12;
}

/* Cột trái */
.modal-split-left {
    width: 40%;
    flex-shrink: 0;
    background-color: var(--background-dark);
    /* Nền tối hơn một chút */
}

.modal-body-left {
    padding: 5px;
}

/* Cột phải */
.modal-split-right {
    width: 60%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Quan trọng */
}

/* Cho phép chỉ phần thân của cột phải cuộn */
.modal-split-right .modal-body {
    overflow-y: auto;
    flex-grow: 1;
}

/* Ghi đè lại responsive cũ cho modal content */
@media (max-width: 992px) {
    .modal-content.modal-split-layout {
        flex-direction: column;
        /* Xếp dọc trên mobile */
        width: 95%;
        max-height: 90vh;
    }

    .modal-split-left,
    .modal-split-right {
        width: 100%;
    }

    .modal-split-right {
        overflow: visible;
    }

    .modal-header-image {
        height: 150px;
    }
}

/* --- Badge --- */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    text-align: center;
    min-width: 100px;
}

.status-completed {
    background-color: var(--status-green);
}

.status-pending {
    background-color: var(--status-yellow);
    color: #343a40;
}

.status-cancelled {
    background-color: var(--status-red);
}

.status-free {
    background-color: var(--text-secondary);
    color: var(--background-dark);
}

.status-premium {
    background-color: #f59e0b;
    color: var(--background-dark);
}

/* --- DataTables --- */
.dataTables_wrapper {
    color: var(--text-secondary);
}

.dataTables_wrapper th,
.dataTables_wrapper td {
    border-bottom: 1px solid var(--border-color);
}

.dataTables_length label,
.dataTables_filter label,
.dataTables_info {
    color: var(--text-secondary) !important;
}

.dataTables_length select,
.dataTables_filter input {
    border: 1px solid var(--border-color) !important;
    background-color: #121826 !important;
    color: var(--text-light) !important;
}

.dataTables_paginate .paginate_button {
    color: var(--text-light) !important;
}

.dataTables_paginate .paginate_button.disabled {
    color: var(--text-secondary) !important;
}

.action-btn {
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    margin-right: 5px;
}

.edit-btn {
    background-color: #007bff;
}

.delete-btn {
    background-color: var(--status-red);
}


/* =================================================================== */
/* --- 4. SIDEBAR (USER & ADMIN) --- */
/* =================================================================== */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.user-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Đảm bảo ảnh lấp đầy vòng tròn */
    border-radius: 50%;
    /* Bo tròn ảnh */
}

.vip-crown {
    position: absolute;
    top: -9px;
    left: -8px;
    font-size: 1.2rem;
    color: #f59e0b;
    transform: rotate(321deg);
}

.user-info {
    margin: 10px 0;
}

.user-status-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.active-plans-wrapper {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.vip-plan-icon {
    width: 32px;
    height: 32px;
}

.vip-plan-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 5px;
    transition: background-color 0.2s, color 0.2s;
    text-align: left;
}

.nav-menu li a:hover {
    background-color: var(--card-dark);
    color: var(--text-light);
}

.nav-menu li.active a {
    background-color: var(--primary-accent);
    color: var(--text-light);
    font-weight: bold;
}

.nav-menu li a i {
    width: 30px;
    text-align: center;
    font-size: 1.1em;
    margin-right: 10px;
}

.logout-section button {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1em;
    text-align: left;
    transition: background-color 0.2s, color 0.2s;
}

.logout-section button:hover {
    background-color: var(--status-red);
    color: var(--text-light);
}

.logout-section button i {
    width: 30px;
    text-align: center;
    font-size: 1.1em;
    margin-right: 10px;
}

/* =================================================================== */
/* --- 5. CÁC TRANG CỤ THỂ --- */
/* =================================================================== */

/* --- Trang Mua Gói (User) --- */
.plan-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.plan-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.1rem;
    border-bottom: 3px solid transparent;
}

.plan-tab-btn.active {
    color: var(--primary-accent);
    border-bottom-color: var(--primary-accent);
}

.plan-tab-content {
    display: none;
}

.plan-tab-content.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Tăng kích thước tối thiểu */
    gap: 20px;
}

.plan-card {
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Kế thừa từ .card */
.plan-card-image {
    width: 100%;
    height: 150px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.plan-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plan-card h3 {
    margin-top: auto;
    padding-top: 15px;
}

.plan-card .features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* --- Trang Chat --- */
.chat-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    /* Viền mờ */
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.chat-search-wrapper {
    position: relative;
    margin-top: 15px;
}

.chat-search-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#chat-search-input {
    width: 100%;
    background-color: #121826;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 10px 10px 40px;
    color: var(--text-light);
}

#chat-conversation-list {
    padding-top: 10px;
    list-style: none;
    margin: 0;
    overflow-y: auto;
}

#chat-conversation-list li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
    gap: 4px;
    position: relative;
}

#chat-conversation-list li:hover {
    background-color: #2c3a52;
}

#chat-conversation-list li.active {
    background-color: var(--primary-accent);
}

.conv-item-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.conv-item-name {
    font-weight: bold;
}

.conv-item-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.conv-item-last-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.new-message-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--status-red);
    border-radius: 50%;
}

.messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 75%;
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.admin {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* --- Nâng cấp Style cho Khu vực Nhập tin nhắn --- */

.input-area {
    padding: 15px;
    background-color: var(--background-dark);
    /* Đổi nền tối hơn */
    border-top: 1px solid var(--border-color);
}

.input-area input {
    flex-grow: 1;
    padding: 12px 20px;
    /* Tăng padding */
    border: none;
    /* Bỏ viền */
    background-color: var(--card-dark);
    /* Nền tối vừa */
    border-radius: 22px;
    /* Bo tròn thành hình viên thuốc */
    color: var(--text-light);
    font-size: 1rem;
}

.input-area input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-accent);
    /* Thêm hiệu ứng focus */
}

.input-area button {
    margin-left: 10px;
    padding: 0;
    border: none;
    background-color: var(--primary-accent);
    color: var(--text-light);
    border-radius: 50%;
    /* Bo tròn thành hình tròn */
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    width: 44px;
    /* Đặt kích thước cố định */
    height: 44px;
    flex-shrink: 0;
    /* Ngăn nút bị co lại */
}

/* --- Nâng cấp Style cho trang Đăng nhập / Đăng ký --- */
body.standalone-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    text-align: left;
    /* Căn lề chữ trong form sang trái */
}

.auth-container button {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: var(--primary-accent);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    /* Chữ to hơn */
}

/* --- Modal Mua Gói & Thanh toán --- */
#plan-detail-modal .modal-content {
    padding: 0;
    overflow: hidden;
}

.modal-header-image {
    position: relative;
    width: 100%;
    height: 180px;
}

#modal-plan-banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-header-image .close-modal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 0;
}

#plan-detail-modal .modal-body {
    padding: 20px;
}

#modal-plan-name {
    margin-top: 0;
    margin-bottom: 10px;
}

.plan-description {
    padding-bottom: 5px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.plan-description ul {
    margin-left: 20px;
    padding: 0;
}

/* --- Modal Mua Gói Nâng Cao --- */
.options-title {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: left;
}

.options-group {
    margin-bottom: 20px;
}

.options-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-btn {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    background-color: var(--card-dark);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: var(--primary-accent);
    color: var(--text-light);
}

.option-btn.selected {
    background-color: var(--primary-accent);
    color: white;
    font-weight: bold;
    border-color: var(--primary-accent);
}

.plan-options-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.plan-option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.plan-option-item:hover {
    border-color: var(--primary-accent);
}

.plan-option-item.selected {
    border-color: var(--primary-accent);
    background-color: rgba(99, 102, 241, 0.1);
}

.plan-option-info .duration {
    font-weight: bold;
}

.plan-option-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-accent);
}

.discount-area {
    display: flex;
    margin-top: 20px;
    gap: 10px;
    align-items: stretch;
    /* Căn các item có chiều cao bằng nhau */
}

.discount-area input {
    flex-grow: 1;
    /* Cho ô input chiếm hết không gian còn lại */
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1rem;
}

.discount-area button {
    border: none;
    background-color: var(--primary-accent);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
    /* Ngăn nút bị co lại */
}

.summary-section {
    margin-top: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.summary-line strong {
    font-size: 1.5rem;
    color: #f59e0b;
}

.summary-section .buy-button {
    width: 100%;
    margin-top: 10px;
}

.payment-layout {
    display: flex;
    gap: 30px;
}

.qr-code-section,
.bank-info-section {
    flex: 1;
}

.qr-image-wrapper {
    text-align: center;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    display: inline-block;
}

#qr-code-image {
    max-width: 220px;
    width: 100%;
}

.bank-details {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bank-details li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.payment-warning {
    font-size: 0.9rem;
    color: #f59e0b;
    margin-top: 15px;
}

.payment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.price-highlight {
    color: #e11d48;
    font-weight: bold;
}

/* --- Dashboard Admin (Stat boxes) --- */
.stat-box-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.stat-box {
    padding: 20px;
    border-radius: 8px;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-box h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.stat-box p {
    margin: 5px 0 0 0;
    font-size: 1rem;
}

.stat-box-link {
    display: block;
    background-color: rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: 8px 0;
    margin: 20px -20px -20px -20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
}

.stat-box-link:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.color-teal {
    background-color: #16a085;
}

.color-green {
    background-color: #27ae60;
}

.color-yellow {
    background-color: #f39c12;
}

.color-red {
    background-color: var(--status-red);
}

.color-blue {
    background-color: #2980b9;
}

.color-cyan {
    background-color: #00A89D;
}

.color-purple {
    background-color: #8e44ad;
}

/* =================================================================== */
/* --- DATATABLES GLASSMORPHISM TWEAKS --- */
/* =================================================================== */
.dashboard-glass .dataTables_wrapper .dataTables_length select,
.dashboard-glass .dataTables_wrapper .dataTables_filter input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    outline: none !important;
    transition: all 0.3s ease !important;
}

.dashboard-glass .dataTables_wrapper .dataTables_length select option {
    background-color: #0a0f1c !important;
    color: white !important;
}

.dashboard-glass .dataTables_wrapper .dataTables_length select:focus,
.dashboard-glass .dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 10px rgba(106, 63, 246, 0.5) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.dashboard-glass table.dataTable tbody tr {
    background-color: transparent !important;
}

.dashboard-glass table.dataTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.dashboard-glass .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.dashboard-glass .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dashboard-glass .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: rgba(106, 63, 246, 0.3) !important;
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 10px rgba(106, 63, 246, 0.4) !important;
    color: white !important;
}

.dashboard-glass table.dataTable.display>tbody>tr.odd>.sorting_1,
.dashboard-glass table.dataTable.order-column.stripe>tbody>tr.odd>.sorting_1 {
    box-shadow: none !important;
    background-color: transparent !important;
}

.dashboard-glass table.dataTable.display>tbody>tr.even>.sorting_1,
.dashboard-glass table.dataTable.order-column.stripe>tbody>tr.even>.sorting_1 {
    box-shadow: none !important;
    background-color: transparent !important;
}

/* Ensure bright, clear text within DataTables */
.dashboard-glass table.dataTable thead th,
.dashboard-glass table.dataTable thead td,
.dashboard-glass table.dataTable tbody th,
.dashboard-glass table.dataTable tbody td {
    color: var(--text-light) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Hovers on DataTable Rows */
.dashboard-glass table.dataTable.hover>tbody>tr:hover>*,
.dashboard-glass table.dataTable.display>tbody>tr:hover>* {
    background: rgba(106, 63, 246, 0.1) !important;
    box-shadow: inset 0 0 0 9999px rgba(106, 63, 246, 0.1) !important;
    transition: background 0.2s ease, box-shadow 0.2s ease !important;
}

/* --- Trang Login/Register --- */
.auth-container {
    width: 100%;
    max-width: 500px;
    padding: 40px;
    background-color: var(--card-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-align: left;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.auth-container p {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.auth-container a {
    color: var(--primary-accent);
    text-decoration: none;
}

.auth-container button {
    width: 100%;
}

/* =================================================================== */
/* --- 6. TOOLTIP TÙY CHỈNH --- */
/* =================================================================== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 8px solid transparent;
    border-top-color: #1E293B;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 11;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1E293B;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    white-space: pre-line;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 10;
    width: max-content;
    max-width: 250px;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* =================================================================== */
/* --- RESPONSIVE DESIGN (Bản hoàn thiện) --- */
/* =================================================================== */

/* --- Cài đặt chung cho Mobile --- */
.mobile-header {
    display: none;
}

/* Mặc định ẩn trên desktop */
.mobile-overlay {
    display: none;
}

/* --- Bắt đầu giao diện Mobile (Màn hình nhỏ hơn 992px) --- */
@media (max-width: 992px) {

    body {
        display: block;
        overflow-y: auto !important;
    }

    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 15px;
        text-decoration: none;
        color: var(--text-light);
    }

    .mobile-logo {
        height: 30px;
    }

    .mobile-logo img {
        height: 100%;
    }

    /* Ẩn tiêu đề chữ, chỉ hiện logo và nút menu */
    .mobile-header-title {
        display: none;
    }

    #mobile-menu-btn,
    #mobile-menu-btn-user {
        background: none;
        border: none;
        color: var(--text-light);
        font-size: 1.5rem;
        cursor: pointer;
        margin-right: 15px;
    }

    .mobile-header-title {
        font-weight: bold;
    }

    /* --- Tinh chỉnh các thành phần --- */
    .stat-box-wrapper,
    .plan-options-list {
        grid-template-columns: 1fr;
        /* 1 cột trên mobile */
    }

    .plan-tab-content.active {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        /* Cho phép 1 hoặc 2 cột tùy độ rộng */
    }

    /* public/style.css -> bên trong @media */
    /* --- Header Mobile --- */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        height: 60px;
        background-color: var(--card-dark);
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }

    .getlink-body {
        align-items: flex-start;
        /* Căn lề trên mobile */
        padding-top: 30px;
    }

    .getlink-title {
        font-size: 1.8rem;
    }

    .getlink-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .supported-websites {
        gap: 10px;
        margin-bottom: 30px;
    }

    .getlink-form {
        flex-direction: column;
        /* Xếp dọc form trên mobile */
        align-items: stretch;
    }

    .stat-box-wrapper,
    .plan-options-list {
        grid-template-columns: 1fr;
    }

    .plan-tab-content.active {
        grid-template-columns: 1fr;
        /* Luôn là 1 cột trên mobile */
    }

    /* --- Khu vực nhập tin nhắn trên Mobile --- */
    .input-area-wrapper {
        padding: 10px;
        /* Giảm padding */
        position: fixed;
        /* Cố định ở dưới cùng */
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--background-dark);
    }

    .messages {
        /* Thêm padding dưới để không bị che bởi ô input */
        padding-bottom: 100px;
    }

    .main-layout {
        width: 100%;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        overflow-y: visible !important;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 1002;
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    }

    .sidebar.show {
        left: 0;
    }

    .content-window,
    .content-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        padding-top: 60px;
        /* Chừa không gian cho top fixed header */
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        height: 60px;
        background-color: var(--card-dark);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        height: 60px;
        background-color: var(--card-dark);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .page-body {
        padding: 15px;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 1001;
    }

    .mobile-overlay.show {
        display: block;
    }

    /* --- GIAO DIỆN "GET LINK" MOBILE (ĐÃ SỬA LỖI) --- */
    .getlink-body {
        justify-content: flex-start;
        padding-top: 20px;
    }

    /* 1. Khung chứa để ẩn phần thừa */
    .supported-websites-wrapper {
        overflow: hidden;
        width: 100%;
        padding: 10px 0;
        margin-bottom: 20px;
    }

    /* 2. Danh sách trượt bên trong */
    .supported-websites {
        display: flex;
        width: max-content;
        /* Chiều rộng bằng tổng các item */
        animation: scroll-left 20s linear infinite;
        /* Tăng tốc độ */
    }

    .supported-websites:hover {
        animation-play-state: paused;
        /* Dừng lại khi di chuột vào */
    }

    .website-item {
        flex-shrink: 0;
        margin: 0 10px;
    }

    .options-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    /* 3. Định nghĩa animation */
    @keyframes scroll-left {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-50%);
        }

        /* Dừng lại khi 1 nửa đã trượt qua */
    }

    #plan-detail-modal.combo-modal .modal-content {
        display: flex;
        flex-direction: column;
        max-height: 95vh;
        /* Tăng chiều cao tối đa một chút /
    overflow-y: hidden; / Ẩn thanh cuộn */
    }

    #plan-detail-modal.combo-modal .modal-header h2 {
        font-size: 1.5rem;
        /* Giảm kích thước tiêu đề */
        margin-bottom: 5px;
    }

    #plan-detail-modal.combo-modal .combo-logo-wrapper {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        /* 6 cột /
    gap: 5px; / Giảm khoảng cách giữa các logo */
        padding: 10px;
        margin-bottom: 10px;
    }

    #plan-detail-modal.combo-modal .combo-logo {
        width: 100%;
        height: auto;
        /* Giữ tỷ lệ khung hình */
    }

    #plan-detail-modal.combo-modal .combo-details ul {
        padding-left: 15px;
        margin-bottom: 10px;
    }

    #plan-detail-modal.combo-modal .combo-details li {
        font-size: 0.9rem;
        /* Giảm kích thước chữ chi tiết */
        margin-bottom: 3px;
    }

    #plan-detail-modal.combo-modal .modal-body {
        overflow-y: auto;
        /* Vẫn cho phép cuộn nếu thực sự cần thiết /
    padding: 10px; / Giảm padding thân modal /
    display: flex;
    flex-direction: column;
    height: auto; / Chiều cao tự động */
    }

    #plan-detail-modal.combo-modal .options-wrapper {
        padding: 10px;
    }

    #plan-detail-modal.combo-modal .options-title {
        font-size: 1rem;
        /* Giảm kích thước tiêu đề tùy chọn */
        margin-bottom: 5px;
    }

    #plan-detail-modal.combo-modal .options-group button {
        padding: 8px 12px;
        /* Giảm padding nút tùy chọn */
        font-size: 0.9rem;
        margin-right: 5px;
        margin-bottom: 5px;
    }

    #plan-detail-modal.combo-modal .summary-section {
        padding: 10px 15px;
        /* Giảm padding phần tóm tắt */
        font-size: 0.9rem;
    }

    #plan-detail-modal.combo-modal .summary-section .total-price {
        font-size: 1.1rem;
        /* Giữ kích thước giá tiền tương đối */
    }

    #plan-detail-modal.combo-modal .modal-footer .buy-button {
        padding: 10px 20px;
        /* Giảm padding nút mua */
        font-size: 1rem;
    }
}

.message {
    position: relative;
    padding-bottom: 20px;
    /* Thêm không gian cho timestamp */
    max-width: fit-content;
    display: flex;
}

.message-content-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-content {
    background-color: var(--message-other-bg);
    padding: 10px 15px;
    border-radius: 18px;
}

.message.user .message-content {
    background-color: var(--message-user-bg);
}

.message-time {
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message.admin .message-time {
    left: 15px;
    right: auto;
}

.replied-message {
    background-color: rgb(18 24 38 / 0%);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 5px;
    border-left: 3px solid var(--primary-accent);
    text-align: left;
    max-width: 100%;
}

.replied-message .sender {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary-accent);
}

.replied-message .content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-context {
    width: 100%;
    padding: 10px;
    background-color: var(--background-dark);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.reply-sender {
    font-weight: bold;
    font-size: 0.9rem;
}

.reply-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}


.input-area-wrapper {
    padding: 15px;
    background-color: var(--background-dark);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.input-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-area input {
    flex-grow: 1;
    padding: 12px 20px;
    border: none;
    background-color: var(--card-dark);
    border-radius: 22px;
    color: var(--text-light);
    font-size: 1rem;
}

.input-area input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-accent);
}

.input-area button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.input-area button i {
    margin: 0;
}

/* =================================================================== */
/* --- TÙY CHỈNH THANH TRƯỢT DỌC --- */
/* =================================================================== */

/* Áp dụng cho các khu vực có thể cuộn */
.messages,
.sidebar,
.page-body,
.modal-body {
    /* --- Dành cho Firefox --- */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--background-dark);

    /* --- Dành cho Chrome, Edge, Safari --- */
}

/* Toàn bộ thanh trượt */
.messages::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.page-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
    /* Độ rộng của thanh trượt */
}

/* Phần nền (track) của thanh trượt */
.messages::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.page-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: var(--background-dark);
    /* Màu nền */
}

/* Phần con trượt (thumb) */
.messages::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.page-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    /* Màu của con trượt */
    border-radius: 4px;
    /* Bo tròn góc */
    border: 2px solid var(--background-dark);
    /* Tạo khoảng cách với nền */
}

/* Hiệu ứng khi di chuột vào con trượt */
.messages::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.page-body::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Đảm bảo bảng luôn chiếm 100% chiều rộng */
table.dataTable {
    width: 100% !important;
}

.action-btn {
    white-space: nowrap;
    /* Ngăn các nút tự xuống dòng */
}

/* --- Style cho Trang Get Link --- */

.getlink-body {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.getlink-container {
    width: 100%;
    max-width: 800px;
}

.getlink-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary-accent);
}

.getlink-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 15px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.getlink-form {
    display: flex;
    gap: 10px;
}

#getlink-input {
    flex-grow: 1;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    background-color: var(--background-dark);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

#getlink-btn {
    padding: 15px 30px;
    flex-shrink: 0;
    /* Ngăn nút bị co lại */
}

/* --- Style cho Danh sách Website hỗ trợ --- */

.supported-websites {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.website-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--card-dark);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.website-item img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

.website-item span {
    font-weight: 500;
    color: var(--text-secondary);
}

.download-options-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.download-options-wrapper label {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.download-options-wrapper input[type="radio"] {
    margin-right: 8px;
}

/* --- Style cho Khu vực Thông báo Get Link --- */

#getlink-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid transparent;

    /* Mặc định ẩn */
    display: none;
}

#getlink-message.show {
    display: block;
    /* Hiện ra */
}

#getlink-message.success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: var(--status-green);
    color: var(--status-green);
}

#getlink-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: var(--status-red);
    color: var(--status-red);
}

#getlink-message.processing {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}

/* Nút tải xuống bên trong thông báo */
.result-download-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 12px;
    font-size: 0.9rem;
    text-decoration: none;
}

/* --- Style cho Hệ thống Thông báo Toast --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.toast-notification {
    background-color: var(--card-dark);
    border-left: 4px solid var(--primary-accent);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 350px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* --- Style cho Loading Spinner trong Toast --- */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.toast-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

.toast-spinner-img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.auth-subtitle {
    text-align: left;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.buy-button {
    position: relative;
    overflow: hidden;
}

.buy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.5) 100%);
    transform: skewX(-20deg);
}

.buy-button:hover::before {
    animation: shine 0.8s forwards;
}

@keyframes shine {
    0% {
        left: -75%;
    }

    100% {
        left: 125%;
    }
}

.buy-button:hover {
    box-shadow: 0 0 12px var(--primary-accent), 0 0 24px rgba(106, 63, 246, 0.6);
}

/* Desktop: logo + text căn giữa tuyệt đối trong panel trái */
@media (min-width: 993px) {
    .auth-promo-panel {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .auth-hero {
        margin: auto;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        max-width: 420px;
        /* tránh text quá dài */
    }

    .auth-promo-panel .auth-promo-image {
        height: clamp(64px, 7vw, 96px);
        width: auto;
        object-fit: contain;
        display: block;
        margin-bottom: 16px;
    }

    .auth-hero h2 {
        font-size: 1.8rem;
        font-weight: 700;
        margin: 0;
    }

    .auth-hero p {
        font-size: 1rem;
        color: var(--text-secondary);
        margin: 0;
    }
}

/* Mobile: xếp dọc, form trước promo sau – đều căn giữa */
@media (max-width: 992px) {
    .standalone-page .auth-layout {
        display: block;
        flex-direction: column;
        align-items: center;
        gap: 24px;
        width: 100%;
        padding: 16px;
    }

    .auth-form-panel {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .auth-promo-panel {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: center;
        text-align: center;
    }

    .auth-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .auth-promo-panel .auth-promo-image {
        height: 64px;
        width: auto;
        margin-bottom: 12px;
    }

    .auth-hero h2 {
        font-size: 1.5rem;
        margin: 0;
    }

    .auth-hero p {
        font-size: 0.95rem;
        color: var(--text-secondary);
        margin: 0;
    }
}

/* --- CSS cho thông báo chat admin --- */
#chat-conversation-list li.unread {
    background-color: #eef5ff;
}

#chat-conversation-list li.unread .conv-item-name {
    font-weight: 700;
    color: #333;
}

.unread-badge {
    background-color: #e63946;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 10px;
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.load-more-container {
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Khung tin nhắn chung */
.message {
    display: flex;
    gap: 10px;
}

/* Avatar */
.message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e5e7eb;
    /* xám nhạt */
    color: #374151;
    /* xám đậm */
    overflow: hidden;
}

.message-avatar i {
    font-size: 16px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.replied-message .sender {
    font-weight: 600;
    margin-bottom: 2px;
}

.replied-message .content {
    color: #97999b;
    font-size: 0.95em;
}

/* Highlight khi nhảy tới tin gốc */
.message--highlight {
    animation: msgFlash 1.2s ease-out;
}

@keyframes msgFlash {
    0% {
        box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5) inset;
        background: rgba(99, 102, 241, 0.08);
    }

    100% {
        box-shadow: 0 0 0 0 transparent;
        background: transparent;
    }
}

/* (Nếu chưa có) bố cục avatar + body */
.message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e5e7eb;
    color: #374151;
    overflow: hidden;
}

.message-avatar i {
    font-size: 16px;
}

.message-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Định dạng cho các URL trong tin nhắn */
.message-content a {
    color: #87CEEB;
    /* Màu xanh da trời sáng */
    text-decoration: underline;
    font-weight: 600;
}

.message-content a:hover {
    text-decoration: none;
}

/* Đối với tin nhắn của mình (nền xanh), link sẽ có màu trắng */
.message.user .message-content a,
.message.admin .message-content a {
    color: #FFFFFF;
}

.chat-image {
    max-width: 250px;
    max-height: 250px;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px;
}

.attach-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
}

.image-preview-wrapper {
    padding: 0 15px 10px 15px;
}

.image-preview-box {
    position: relative;
    display: inline-block;
}

#image-preview {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.remove-preview-button {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* public/css/style.css */

/* --- CSS cho Lightbox xem ảnh --- */
.lightbox-overlay {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #bbb;
}

/* Thêm con trỏ phóng to cho ảnh trong chat */
.chat-image {
    cursor: zoom-in;
}

/* Chỉ áp cho khu vực chat admin để không ảnh hưởng UI khác */
#chat-message-container .message {
    display: flex;
    gap: 10px;
    margin: 8px 0;
}

/* Tin đến từ USER (incoming) => bên trái */
#chat-message-container .message.incoming {
    justify-content: flex-start;
    flex-direction: row;
    /* avatar bên trái, bubble bên phải */
}

/* Tin của ADMIN (outgoing) => bên phải */
#chat-message-container .message.outgoing {
    justify-content: flex-end;
    flex-direction: row-reverse;
    /* avatar bên phải, bubble bên trái */
}

/* (tuỳ chọn) chỉnh bo góc để nhìn đúng hướng */
#chat-message-container .message.incoming .message-bubble {
    border-radius: 16px 16px 16px 6px;
}

#chat-message-container .message.outgoing .message-bubble {
    border-radius: 16px 16px 6px 16px;
}

.page-content {
    position: relative;
}

/* Kiểu cho nút cuộn xuống */
.scroll-to-bottom-button {
    position: absolute;
    bottom: 120px;
    /* Điều chỉnh khoảng cách với ô nhập liệu */
    right: 30px;
    /* Điều chỉnh khoảng cách với lề phải */
    z-index: 100;

    width: 40px;
    height: 40px;
    background-color: var(--card-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-to-bottom-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Button --- */
.redownload-button,
.save-btn,
.action-btn {
    background-color: var(--primary-accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.redownload-button {
    position: relative;
    overflow: hidden;
}

.redownload-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    transform: skewX(-20deg);
}

.redownload-button:hover {
    box-shadow: 0 0 12px var(--primary-accent), 0 0 24px rgba(106, 63, 246, 0.6);
}

.status-failed {
    color: #f44336;
    /* Màu đỏ */
    font-weight: bold;
}

/* --- CSS cho trang Hướng dẫn --- */
.guide-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h3 {
    font-size: 1.5rem;
    color: var(--primary-accent);
    margin-bottom: 15px;
}

.guide-section p,
.guide-section li {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.guide-section ol,
.guide-section ul {
    padding-left: 30px;
    margin-top: 15px;
}

.guide-section img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- CSS cho mục FAQ Accordion --- */
.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 15px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    text-align: left;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
}

.faq-question:hover {
    background-color: var(--card-dark);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--primary-accent);
}

.faq-answer {
    padding: 0 20px 20px 20px;
    background-color: var(--card-dark);
    display: none;
    /* Mặc định ẩn câu trả lời */
}

/* Khi một item được active, xoay icon */
.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* =================================================================== */
/* --- 7. MÀN HÌNH CHỜ (PREMIUM LOADING OVERLAY) --- */
/* =================================================================== */

.premium-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 24, 38, 0.85);
    /* Tối và hơi trong suốt */
    backdrop-filter: blur(10px);
    /* Làm mờ nền rất đẹp */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.premium-loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.premium-loader-content {
    background-color: var(--card-dark);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(106, 63, 246, 0.3);
    box-shadow: 0 0 40px rgba(106, 63, 246, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-loader-overlay.active .premium-loader-content {
    transform: scale(1);
}

.premium-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 20px auto;
}

.double-bounce1,
.double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-accent);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: sk-bounce 2.0s infinite ease-in-out;
    box-shadow: 0 0 20px var(--primary-accent);
}

.double-bounce2 {
    animation-delay: -1.0s;
}

@keyframes sk-bounce {

    0%,
    100% {
        transform: scale(0.0)
    }

    50% {
        transform: scale(1.0)
    }
}

.premium-loader-text {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.premium-loader-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- FLOATING CONTACT BUTTONS (EXPANDABLE) --- */
.expandable-contact-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 9999;
}

.contact-sub-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: none;
    outline: none;
}

.main-contact-btn {
    background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    font-size: 24px;
    z-index: 2;
}

.main-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(106, 63, 246, 0.5);
}

.vibrate-anim {
    animation: vibrate 2s linear infinite;
}

@keyframes vibrate {
    0% {
        transform: scale(1) rotate(0deg);
    }

    10% {
        transform: scale(1.1) rotate(-10deg);
    }

    20% {
        transform: scale(1.1) rotate(10deg);
    }

    30% {
        transform: scale(1.1) rotate(-10deg);
    }

    40% {
        transform: scale(1.1) rotate(10deg);
    }

    50% {
        transform: scale(1) rotate(0deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.contact-sub-buttons>a.contact-btn:hover {
    transform: scale(1.1) !important;
}

.zalo-btn {
    background-color: #fff;
}

.zalo-btn img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.fb-btn {
    background: linear-gradient(45deg, #00B2FF, #006AFF);
    color: white;
    font-size: 24px;
}

@media (max-width: 768px) {
    .expandable-contact-wrapper {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }

    .contact-btn {
        width: 45px;
        height: 45px;
    }

    .zalo-btn img {
        width: 30px;
        height: 30px;
    }

    .fb-btn,
    .main-contact-btn {
        font-size: 20px;
    }
}