﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Màu cơ bản - Giao diện tối (Mặc định) */
    --bg-base: #0f0f23;
    --bg-gradient: linear-gradient(-45deg, #0f0f23, #151530, #1a1a2e, #0f0f23);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --glass-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(75, 85, 99, 0.4);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: #475569;
    --badge-bg: rgba(255, 255, 255, 0.05);

    /* Hằng số (Dùng chung) */
    --primary-gradient: linear-gradient(135deg, #4f46e5, #818cf8);
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
    --green-gradient: linear-gradient(135deg, #10b981, #059669);
    --blur-strength: 20px;

    /* Hỗ trợ tiếp cận */
    --focus-ring: 0 0 0 3px rgba(139, 92, 246, 0.5);
    --focus-ring-light: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* ===== HỖ TRỢ TIẾP CẬN ===== */

/* Kiểu focus cho điều hướng bàn phím */
*:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 8px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Liên kết bỏ qua đến nội dung chính (cho trình đọc màn hình) */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #8b5cf6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
}

/* Hỗ trợ chế độ tương phản cao */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(31, 41, 55, 0.95);
        --glass-border: rgba(75, 85, 99, 0.8);
    }
}



/* Hỗ trợ giảm chuyển động */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Thanh cuộn tùy chỉnh --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* --- Các khối nền hoạt hình --- */
.bg-gradient-1,
.bg-gradient-2 {
    position: fixed;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    animation: blobFloat 20s infinite alternate;
}

.bg-gradient-1 {
    top: -10%;
    left: -10%;
    background: var(--accent-gradient);
}

.bg-gradient-2 {
    bottom: -10%;
    right: -10%;
    background: var(--primary-gradient);
    animation-delay: -10s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10vw, 5vh) scale(1.1);
    }

    66% {
        transform: translate(-5vw, 15vh) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

[data-theme="light"] {
    /* Màu cơ bản - Giao diện sáng */
    --bg-base: #f1f5f9;
    --bg-gradient: linear-gradient(-45deg, #f1f5f9, #e2e8f0, #cbd5e1, #f1f5f9);
    --text-primary: #0f172a;
    /* Đậm hơn nhiều */
    --text-secondary: #475569;
    /* Đậm hơn nhiều */
    --glass-bg: rgba(255, 255, 255, 0.95);
    /* Gần như đặc */
    --glass-border: #cbd5e1;
    --input-bg: #ffffff;
    --input-border: #94a3b8;
    --badge-bg: rgba(0, 0, 0, 0.05);

    /* Ghi đè Gradient hằng số cho tương phản */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
}

body {
    background-color: var(--bg-base);
    background-image: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Làm mờ nền */
.bg-gradient-1 {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: float 10s infinite alternate;
}

.bg-gradient-2 {
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: float 12s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Tiện ích */
.container {
    max-width: 1000px;
    /* Container chặt hơn giống tham chiếu */
    margin: 0 auto;
    padding: 0 20px;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.glass-effect-sm {
    background: var(--badge-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* --- Tải dạng Skeleton --- */
.sk-item {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sk-line {
    background: linear-gradient(90deg, var(--badge-bg) 25%, var(--glass-border) 50%, var(--badge-bg) 75%);
    background-size: 200% 100%;
    animation: sk-loading 1.5s infinite;
    border-radius: 4px;
}

.sk-line.h-1 {
    height: 18px;
    width: 40%;
}

.sk-line.h-2 {
    height: 24px;
    width: 85%;
}

.sk-line.h-3 {
    height: 16px;
    width: 60%;
}

@keyframes sk-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Tiêu đề */
header {
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: var(--bg-base);
    /* Đảm bảo tương phản */
    border-bottom: 1px solid var(--glass-border);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #ffffff;
    /* Icon thương hiệu luôn màu trắng */
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 30px;
    }
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    font-size: 0.95rem;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.theme-toggle-btn,
.notif-btn,
.lang-btn,
.account-btn,
.install-btn,
.shortcuts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--badge-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 10px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.theme-toggle-btn,
.notif-btn {
    width: 48px;
    position: relative;
    padding: 0;
}

.lang-btn,
.account-btn {
    padding: 0 16px;
    gap: 8px;
}

.shortcuts-btn,
.install-btn {
    width: 48px;
    padding: 0;
}

@media (max-width: 768px) {

    .account-btn span,
    .lang-btn span,
    .logo span {
        display: none;
    }

    .account-btn,
    .lang-btn {
        padding: 0;
        width: 48px;
    }

    .header-actions {
        gap: 8px;
    }
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.notif-btn i,
.account-btn i {
    font-size: 1.1rem;
}

.theme-toggle-btn:hover,
.notif-btn:hover,
.lang-btn:hover,
.account-btn:hover,
.install-btn:hover,
.shortcuts-btn:hover {
    background: var(--glass-border);
    transform: translateY(-1px);
}

/* Nút thông báo giờ khớp với các nút header khác */

.mobile-only {
    display: block;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
}

.menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Nội dung chính */
.main-content {
    padding-top: 60px;
    padding-bottom: 20px;
    /* Giảm từ 60px */
}

.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.main-title .highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-title {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Bảng điều khiển Email */
.email-control-panel {
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.email-input-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-main-group {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

#cc-name-input {
    flex: 1.8;
    height: 48px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    color: var(--text-primary);
    padding: 0 16px;
    font-size: 1rem;
    font-weight: 500;
    min-width: 0;
    outline: none;
    text-align: left;
    border-radius: 8px;
    transition: all 0.3s;
}

#cc-name-input:focus {
    border-color: #6366f1;
}

.at-symbol {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    opacity: 0.7;
    margin: 0 8px;
}

.cc-select-wrapper {
    flex: 1.2;
    position: relative;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 8px;
    height: 48px;
    transition: all 0.3s;
}

.cc-select-wrapper:focus-within,
#cc-name-input:focus {
    border-color: #6366f1;
    background: var(--badge-bg);
}

#cc-domain-select {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    height: 100%;
    padding: 0 40px 0 16px;
    font-size: 1rem;
    font-weight: 500;
    /* Khớp tên người dùng */
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

#cc-domain-select option {
    background-color: var(--bg-base);
    color: var(--text-primary);
    padding: 12px;
}

.inline-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}

@media (max-width: 768px) {
    .inline-actions {
        grid-template-columns: 1fr;
    }
}

.inline-actions .action-btn {
    padding: 12px 24px;
    height: 48px;
    border-radius: 8px;
}

.new-btn {
    background: #6366f1;
    /* Màu chàm từ tham chiếu */
    box-shadow: none;
}

/* Đã xóa bộ đếm giờ */

/* Thanh thông tin trạng thái nét đứt */
.status-info-bar-dashed {
    margin-top: 24px;
    padding: 16px;
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    background: var(--badge-bg);
}

.status-text-dashed {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    user-select: text;
}

/* Đã gộp các kiểu ở trên */

.cc-select-wrapper i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-primary);
    /* Làm mũi tên theo chủ đề */
    pointer-events: none;
    font-size: 0.8rem;
    opacity: 0.8;
}

@media (max-width: 800px) {
    .input-main-group {
        min-width: 100%;
    }

    #cc-name-input {
        text-align: left;
    }

    .inline-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* Khu vực nút */
.control-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 16px;
}

.action-btn {
    position: relative;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    /* Nút rực rỡ thường giữ chữ trắng */
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
    transform: scale(0.98);
}

.copy-btn {
    background: var(--green-gradient);
}

.copy-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.refresh-btn:hover {
    background: var(--glass-border);
}

.new-btn {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.qr-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    height: 48px;
    border-radius: 12px;
    padding: 0 16px;
    /* Thêm padding cho văn bản */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    /* Khớp với các nút khác */
    gap: 8px;
    /* Khoảng cách giữa icon và chữ */
}

.qr-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.qr-modal-container {
    max-width: 350px !important;
    text-align: center;
    padding: 30px !important;
}

.qr-frame {
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    margin: 20px auto;
    width: fit-content;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.qr-frame img {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 4px;
}

.new-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.3);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Dòng thời gian */
.timer-line {
    height: 3px;
    background: var(--badge-bg);
    margin-top: -2px;
    /* Kéo vào viền */
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.timer-progress {
    height: 100%;
    width: 100%;
    background: var(--primary-gradient);
    transform-origin: left;
    animation: countdown 10s linear infinite;
}

@keyframes countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.secondary-actions {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.text-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.text-link:hover {
    color: var(--text-primary);
}

.divider {
    margin: 0 10px;
    color: var(--glass-border);
}

/* --- Phần Hộp thư (Giao diện cập nhật) --- */
.inbox-section {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    /* Thêm khoảng cách */
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    /* width: 100%; Đã xóa chiều rộng cứng để flex tự xử lý */
}

.inbox-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbox-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.inbox-controls {
    display: flex;
    gap: 8px;
}

.icon-btn-small {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn-small:hover {
    background: var(--text-primary);
    color: var(--bg-base);
}

.icon-btn-small.delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.badg-count {
    background: var(--badge-bg);
    padding: 2px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.inbox-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.inbox-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mục Email (Thiết kế mới) */
.email-item {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.email-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.email-item-left {
    flex-shrink: 0;
}

.email-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #059669);
    /* Xanh mặc định */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.email-item-content {
    flex-grow: 1;
    min-width: 0;
    /* Sửa lỗi cắt ngắn */
}

.e-sender {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.e-subject {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.e-snippet {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #9ca3af;
    position: absolute;
    top: 16px;
    right: 16px;
}


.e-time {
    color: var(--text-secondary);
}

.e-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Trạng thái trống */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    background: var(--badge-bg);
}

.empty-icon {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.03);
}

.email-item .sender {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.email-item .subject {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.email-item .time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Lưới tính năng */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.feature-item {
    padding: 24px;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: inline-block;
}

.i-shield {
    color: #8b5cf6;
}

.i-flash {
    color: #eab308;
}

.i-globe {
    color: #3b82f6;
}

.feature-item h4 {
    margin-bottom: 8px;
    font-weight: 600;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Đáp ứng thiết bị di động */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.8rem;
    }

    .control-actions {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .email-display-wrapper {
        margin-bottom: 20px;
    }

    #email-address {
        font-size: 1rem;
        word-break: break-all;
    }

    .status-info-bar-dashed {
        padding: 12px;
    }

    #status-text-dashed {
        font-size: 1.1rem;
    }

    .notif-dropdown {
        width: 90vw;
        right: 5vw;
        top: 60px;
    }

    .email-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .e-view-header {
        padding: 16px;
    }

    .e-view-alerts {
        padding: 0 16px;
    }

    .e-view-content-wrapper {
        padding: 0 16px 16px 16px;
    }

    .email-white-paper {
        padding: 20px;
    }

    #email-view-subject {
        font-size: 1.2rem;
    }
}




/* Chân trang */
.glass-effect-footer {
    border-top: 1px solid var(--glass-border);
    background: var(--badge-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 50px 0;
    margin-top: 100px;
    position: relative;
    overflow: hidden;
}

.glass-effect-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
}

.footer-layout {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.footer-links-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.footer-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-card:hover {
    background: var(--glass-bg);
    border-color: var(--primary-gradient);
    transform: translateY(-2px);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 16px;
    transition: all 0.3s;
}

.i-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Xanh dương */
.i-book {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

/* Tím */
.i-tele {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

/* Xanh trời */
.i-code {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

/* Hồng */

.footer-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.link-info {
    flex-grow: 1;
}

.link-title {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.link-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.arrow-icon {
    color: var(--text-secondary);
    opacity: 0.5;
    transition: 0.3s;
}

.footer-card:hover .arrow-icon {
    opacity: 1;
    color: var(--text-primary);
    transform: translateX(4px);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.footer-bottom strong {
    color: var(--text-primary);
    font-weight: 600;
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.5;
}

.notification-bar {
    margin-bottom: 30px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    /* Thuộc tính chữ chạy mới */
    overflow: hidden;
    padding: 0;
    height: 54px;
    display: flex;
    align-items: center;
}

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: max-content;
    padding-left: 100%;
    animation: marquee 35s linear infinite;
    /* Cháº­m láº¡i má»™t chÃºt Ä‘á»ƒ dá»… Ä‘á»c cÃ¢u dÃ i */
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.marquee-spacer {
    width: 150px;
    /* Khoảng cách rộng ra để không bị sát nhau */
    flex-shrink: 0;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Biểu tượng */
.notification-bar i.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 8px;
}

.notification-bar .fa-star {
    margin-left: 8px;
}

.divider {
    display: inline-block;
    width: 50px;
}

kbd {
    background: var(--badge-bg);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
}



/* --- Phần tạo tùy chỉnh --- */
.custom-create-section {
    width: 100%;
    /* đã xóa max-width để khớp chiều rộng đầy đủ của bảng điều khiển email */
    margin: 0 auto 30px auto;

    /* Layout */
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 30px;
    position: relative;
    z-index: 10;
}

/* Các kiểu tích hợp đã chuyển sang phần component */





/* --- Menu thả xuống thông báo --- */
.notif-dropdown {
    position: absolute;
    top: 88px;
    right: 20px;
    width: 380px;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    /* Ẩn theo mặc định */
    padding: 16px;
    overflow: hidden;
}

.notif-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.h-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.h-header h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.mark-read-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.mark-read-btn:hover {
    color: #34d399;
    /* Hover màu xanh */
    text-decoration: none;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Kiểu cụ thể cho các loại thông báo */
.item-warning {
    border-color: rgba(234, 179, 8, 0.2);
    /* Tông vàng */
}

.item-warning .n-icon {
    color: #eab308;
    background: rgba(234, 179, 8, 0.1);
}

.item-info {
    border-color: rgba(59, 130, 246, 0.2);
    /* Tông xanh */
}

.item-info .n-icon {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.n-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.n-content {
    flex-grow: 1;
}

.n-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.n-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Trạng thái đã đọc - Logic mới */
.notif-item .n-title .fa-check {
    display: none;
    /* Hidden by default */
    color: #10b981;
    /* Màu xanh thành công */
    opacity: 1 !important;
    /* Ghi đè style nội tuyến nếu có */
}

.notif-item.read .n-title .fa-check {
    display: inline-block;
    /* Hiện khi đã đọc */
}

.notif-item.read {
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.05);
    /* Viền mờ */
    background: rgba(15, 17, 26, 0.5);
    /* Nền mờ */
}

/* --- Header Bảng & Huy hiệu Trạng thái --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Đã xóa Huy hiệu */

/* --- Cải tiến Trình xem Email Pro --- */
.e-view-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.viewer-btn {
    flex: 1;
    min-width: 140px;
    padding: 10px;
    border-radius: 8px;
    background: var(--badge-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.viewer-btn:hover {
    background: var(--glass-border);
    transform: translateY(-2px);
}

.image-protection-bar {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #fbbf24;
}

.image-protection-bar button {
    background: #fbbf24;
    color: #000;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Ẩn ảnh trong trình xem theo mặc định khi được bảo vệ */
.protected-content img {
    display: none !important;
}

.protected-content .img-placeholder {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: var(--badge-bg);
    border: 1px dashed var(--text-secondary);
    margin: 5px;
    border-radius: 4px;
}

/* --- Modal & Lớp phủ --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-container {
    width: 500px;
    max-width: 90%;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

#confirm-modal {
    z-index: 10005;
    /* Đảm bảo luôn nằm trên Email Modal (9999) */
}

.confirm-modal-container {
    max-width: 400px;
    text-align: center;
}

.modal-icon-header {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.confirm-icon-danger {
    color: #ef4444;
}

.confirm-icon-success {
    color: #10b981;
}

.confirm-icon-warning {
    color: #f59e0b;
}

.confirm-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.confirm-modal-message {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions button {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-confirm-ok {
    background: #ef4444;
    border: none;
    color: white;
}

.btn-confirm-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Nút đóng */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    background: var(--badge-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

/* Giao diện (Đăng nhập/Đăng ký) */
.auth-view {
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.3s ease;
}

.auth-view.active {
    display: block;
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-right: 40px;
    /* Khoảng trống cho nút đóng */
}

.auth-header i {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.auth-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-form-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.auth-input:focus {
    border-color: #8b5cf6;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: filter 0.2s;
}

.submit-btn:hover {
    filter: brightness(1.1);
}

.btn-purple {
    background: #8b5cf6;
    /* Màu đăng nhập */
}

.btn-green {
    background: #10b981;
    /* Màu đăng ký */
}

.auth-footer-link {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.auth-footer-link a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s;
}

.auth-footer-link a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

/* --- Modal Xem Email (Thiết kế cao cấp) --- */
.email-modal-container {
    width: 800px;
    max-width: 95%;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    padding: 0;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Header */
.e-view-header {
    background: var(--bg-base);
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.e-view-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#email-view-subject {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    padding-right: 20px;
}

/* Selector cố định */
.cc-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.e-view-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-download {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-delete-mail {
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-mail:hover {
    background: #ef4444;
    color: white;
}

.modal-close-static {
    width: 36px;
    height: 36px;
    background: var(--badge-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-static:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

.e-view-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.meta-line strong {
    color: var(--text-primary);
    margin-right: 6px;
}

/* Cảnh báo */
.e-view-alerts {
    padding: 0 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.alert-box {
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Cảnh báo xanh */
.green-alert {
    background: rgba(16, 185, 129, 0.1);
    /* Xanh mềm */
    border: 1px solid #10b981;
}

.green-alert .alert-icon {
    color: #10b981;
    font-size: 1.2rem;
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.green-alert .alert-title {
    color: #059669;
    font-weight: 700;
    font-size: 0.95rem;
}

.green-alert .alert-sub {
    color: #10b981;
    font-size: 0.8rem;
}

/* Cảnh báo vàng */
.yellow-alert {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid #eab308;
    justify-content: space-between;
}

.alert-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.yellow-alert .alert-icon {
    color: #facc15;
    font-size: 1.2rem;
}

.yellow-alert .alert-title {
    color: #854d0e;
    font-weight: 700;
    font-size: 0.95rem;
}

.yellow-alert .alert-sub {
    color: #a16207;
    font-size: 0.8rem;
}

.btn-load-img {
    background: #eab308;
    color: #1a202c;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-load-img:hover {
    background: #facc15;
}

/* Bao bọc nội dung */
.e-view-content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 32px 32px 32px;
    background: var(--bg-base);
}

.email-white-paper {
    background: white;
    border-radius: 8px;
    padding: 40px;
    color: #1a202c;
    min-height: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Đặt lại màu chữ trong giấy trắng */
.email-white-paper p,
.email-white-paper h1,
.email-white-paper h2,
.email-white-paper h3,
.email-white-paper li {
    color: #1a202c;
}

/* Thanh cuộn tùy chỉnh cho giấy trắng nếu cần */
.email-white-paper::-webkit-scrollbar {
    width: 0;
}



.skeleton {
    background: var(--badge-bg);
    background: linear-gradient(to right,
            var(--badge-bg) 8%,
            var(--glass-border) 18%,
            var(--badge-bg) 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-item {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- Giao diện Hồ sơ --- */
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 24px;
}

.profile-avatar-box {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.profile-info-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#profile-username {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.profile-badge-vip {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 50px;
    width: fit-content;
}

.profile-content {
    padding-top: 0;
}

.section-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Sửa lỗi Giao diện Hồ sơ --- */
.my-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Tăng khoảng cách */
    margin-bottom: 24px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Thanh cuộn tùy chỉnh cho danh sách */
.my-inbox-list::-webkit-scrollbar {
    width: 4px;
}

.my-inbox-list::-webkit-scrollbar-track {
    background: transparent;
}

.my-inbox-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.my-inbox-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.saved-inbox-item {
    background: rgba(255, 255, 255, 0.02);
    /* Má» hÆ¡n */
    border: 1px solid transparent;
    /* áº¨n viá»n máº·c Ä‘á»‹nh */
    padding: 12px;
    /* Gá»n hÆ¡n */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.item-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    /* Chống tràn */
}

.my-inbox-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    /* Tím đậm giống mẫu */
    color: white;
    border-radius: 10px;
    /* Bo góc vuông như mẫu */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(139, 92, 246, 0.3);
}

.inbox-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    /* Sửa tràn flex */
    margin-right: 12px;
}

.saved-inbox-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
    /* Hiệu ứng trượt nhẹ sang phải thay vì nổi lên */
}

.saved-inbox-item.active {
    border-color: var(--primary-purple);
    background: rgba(139, 92, 246, 0.1);
}

/* Thanh dá»c chá»‰ hiá»‡n khi active */
.saved-inbox-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background: var(--primary-purple);
    border-radius: 0 4px 4px 0;
}

.inbox-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    /* Chiếm phần còn lại */
    min-width: 0;
    /* Sửa tràn flex */
    margin-right: 12px;
}

.inbox-info .email-text {
    font-size: 0.95rem;
    /* To hơn chút như mẫu */
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-info .status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.inbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.btn-item-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    /* Ná»n má» */
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-item-action:hover {
    background: var(--primary-purple);
    color: white;
}

.btn-item-action.delete:hover {
    background: #ef4444;
    color: white;
}

.saved-inbox-item i {
    font-size: 0.9rem;
}

/* --- Sửa UI theo yêu cầu người dùng --- */
/* Styling nút 'Đổi mật khẩu' cho hợp theme */
#show-change-pwd {
    width: 100%;
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    backdrop-filter: blur(4px);
}

#show-my-inboxes {
    width: 100%;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    backdrop-filter: blur(4px);
}

#show-change-pwd:hover {
    background: #8b5cf6;
    color: white;
    transform: scale(1.02);
}

#show-my-inboxes:hover {
    background: #10b981;
    color: white;
    transform: scale(1.02);
}

/* Kiểu phân trang */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.02);
}

.auth-view {
    display: none;
}

.auth-view.active {
    display: block;
}

/* Huy hiệu thông báo */
.notif-btn {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    background: #ef4444;
    border-radius: 50%;
    /* Làm cho nó thành hình tròn hoàn hảo */
    display: none;
    /* JS sẽ chuyển sang flex */
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: #ffffff !important;
    border: 2px solid var(--bg-base, #0f0f23);
    padding: 0;
    /* padding đôi khi xung đột với căn giữa flex trong container kích thước cố định */
    z-index: 100;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-base);
    /* Viền giả để hòa trộn tốt hơn */
}



/* ==========================================================================
   THÔNG BÁO TOAST (Kiểu cổ điển - Hợp nhất)
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    min-width: 320px;
    position: relative;
    animation: toastSlideIn 0.3s ease-out forwards;
}

@media (max-width: 768px) {
    .toast-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .toast {
        min-width: auto;
        width: 100%;
        animation: toastSlideInMobile 0.3s forwards;
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s forwards;
}

.toast-icon {
    width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #3b82f6;
}

.toast.error .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    padding-right: 20px;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
    color: #fff;
}

.toast-msg {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #fff;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideInMobile {
    from {
        transform: translateY(120%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes toastSlideOutMobile {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(120%);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .toast.hiding {
        animation: toastSlideOutMobile 0.3s forwards;
    }
}

/* --- Modal Thông báo Hệ thống --- */
.sys-notif-modal-container {
    max-width: 500px;
    padding: 0;
}

.sys-notif-modal-container .modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.sys-notif-modal-container .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.sys-notif-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sys-notif-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.sys-notif-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.sys-notif-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sys-notif-modal-container .modal-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.sys-notif-modal-container .modal-body p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.sys-notif-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

.sys-notif-modal-container .modal-close-static {
    position: static;
    background: var(--badge-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- Kiểu Trợ giúp Phím tắt --- */
.shortcuts-modal-container {
    max-width: 450px;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.shortcut-key {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    border: 1px solid var(--text-secondary);
    box-shadow: 0 2px 0 var(--text-secondary);
}

/* --- Kiểu Công tắc Chuyển đổi --- */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
}

.setting-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    gap: 10px;
}

.setting-label i {
    color: #8b5cf6;
    width: 20px;
    text-align: center;
}

/* Switch - hộp xung quanh thanh trượt */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

/* Ẩn checkbox HTML mặc định */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Thanh trượt */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-image: linear-gradient(135deg, #4f46e5, #818cf8);
}

input:focus+.slider {
    box-shadow: 0 0 1px #8b5cf6;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.shortcut-desc {
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Attachments */
.attachment-container {
    padding: 15px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 220px;
    gap: 12px;
    transition: all 0.2s;
    cursor: default;
}

.attachment-item:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.att-icon {
    font-size: 1.5rem;
    color: #8b5cf6;
    width: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.att-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.att-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.att-download {
    background: var(--badge-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-download:hover {
    background: #8b5cf6;
    color: #fff;
    border-color: #8b5cf6;
}