:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-canvas: #090d16;
    /* Thiết lập hiệu ứng Glassmorphism trong suốt nhẹ */
    --bg-surface: rgba(30, 41, 59, 0.45);
    --bg-surface-hover: rgba(51, 65, 85, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    /* Bóng mờ 3 lớp cho chiều sâu tối đa */
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
    display: none !important;
}

html {
    overflow-x: hidden;
}

body {
    background-color: #0c111e;
    background-image: 
        /* Lớp bụi sao mịn (Fine Stardust) */
        radial-gradient(0.8px 0.8px at 12% 18%, rgba(255, 255, 255, 0.45) 100%, transparent),
        radial-gradient(0.6px 0.6px at 28% 62%, rgba(255, 255, 255, 0.35) 100%, transparent),
        radial-gradient(0.9px 0.9px at 44% 33%, rgba(255, 255, 255, 0.4) 100%, transparent),
        radial-gradient(0.7px 0.7px at 68% 79%, rgba(255, 255, 255, 0.3) 100%, transparent),
        radial-gradient(0.8px 0.8px at 82% 14%, rgba(255, 255, 255, 0.45) 100%, transparent),
        radial-gradient(0.5px 0.5px at 91% 53%, rgba(255, 255, 255, 0.3) 100%, transparent),
        /* Nebula Glows sáng và nổi bật hơn */
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.28) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.22) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(219, 39, 119, 0.12) 0px, transparent 60%);
    background-size: 350px 350px, 350px 350px, 350px 350px, 350px 350px, 350px 350px, 350px 350px, 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-x: hidden;
    position: relative;
}

/* Bầu trời sao lấp lánh và dải thiên hà */
body::before,
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -2;
}

/* Lớp sao 1 (nhỏ, lấp lánh nhanh - Mật độ cao) */
body::before {
    background-image:
        radial-gradient(1px 1px at 8% 12%, #fff 100%, transparent),
        radial-gradient(1.5px 1.5px at 18% 34%, rgba(255, 255, 255, 0.95) 100%, transparent),
        radial-gradient(1px 1px at 27% 19%, #fff 100%, transparent),
        radial-gradient(2px 2px at 39% 74%, rgba(255, 255, 255, 0.9) 100%, transparent),
        radial-gradient(1px 1px at 48% 42%, #fff 100%, transparent),
        radial-gradient(1.5px 1.5px at 56% 81%, rgba(255, 255, 255, 0.85) 100%, transparent),
        radial-gradient(1px 1px at 67% 53%, #fff 100%, transparent),
        radial-gradient(2.2px 2.2px at 78% 23%, #fff 100%, transparent),
        radial-gradient(1.2px 1.2px at 88% 64%, rgba(255, 255, 255, 0.95) 100%, transparent),
        radial-gradient(1.5px 1.5px at 94% 87%, #fff 100%, transparent),
        radial-gradient(1px 1px at 15% 70%, #fff 100%, transparent),
        radial-gradient(1.8px 1.8px at 45% 15%, rgba(255, 255, 255, 0.9) 100%, transparent),
        radial-gradient(1px 1px at 62% 28%, #fff 100%, transparent),
        radial-gradient(1.5px 1.5px at 83% 71%, rgba(255, 255, 255, 0.85) 100%, transparent);
    background-size: 400px 400px;
    animation: twinkling 6s infinite ease-in-out;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    margin-left: var(--bg-parallax-x1, 0px);
    margin-top: var(--bg-parallax-y1, 0px);
    transition: margin 0.15s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: margin, opacity;
}

/* Lớp sao 2 (to rõ hơn, lấp lánh chậm - Mật độ cao) */
body::after {
    background-image:
        radial-gradient(2.2px 2.2px at 12% 14%, rgba(255, 255, 255, 0.95) 100%, transparent),
        radial-gradient(1.8px 1.8px at 32% 48%, #fff 100%, transparent),
        radial-gradient(2.5px 2.5px at 52% 22%, rgba(255, 255, 255, 0.9) 100%, transparent),
        radial-gradient(1.5px 1.5px at 72% 61%, #fff 100%, transparent),
        radial-gradient(3px 3px at 87% 83%, rgba(255, 255, 255, 0.98) 100%, transparent),
        radial-gradient(2px 2px at 22% 78%, rgba(255, 255, 255, 0.85) 100%, transparent),
        radial-gradient(1.8px 1.8px at 63% 89%, #fff 100%, transparent),
        radial-gradient(2.5px 2.5px at 77% 38%, rgba(255, 255, 255, 0.9) 100%, transparent);
    background-size: 600px 600px;
    animation: twinkling 12s infinite ease-in-out reverse;
    opacity: 0.75;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    margin-left: var(--bg-parallax-x2, 0px);
    margin-top: var(--bg-parallax-y2, 0px);
    transition: margin 0.15s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: margin, opacity;
}

@keyframes twinkling {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.95;
    }

    100% {
        opacity: 0.3;
    }
}

/* Dải thiên hà tĩnh mượt mà, không dùng filter blur động tránh lag */
.galaxy-nebula-1,
.galaxy-nebula-2 {
    position: fixed;
    border-radius: 50%;
    z-index: -2;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.35;
    animation: pulseNebula 12s infinite alternate ease-in-out;
    will-change: opacity;
}

.galaxy-nebula-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 55%, transparent 75%);
    top: -100px;
    left: -100px;
}

.galaxy-nebula-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(219, 39, 119, 0.1) 0%, rgba(79, 70, 229, 0.03) 55%, transparent 75%);
    bottom: -150px;
    right: -150px;
    animation-duration: 18s;
}

@keyframes pulseNebula {
    0% {
        opacity: 0.25;
    }

    100% {
        opacity: 0.45;
    }
}

.app-container {
    width: 100%;
    max-width: 1100px;
    min-height: calc(100vh - 80px);
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border-radius: 6px;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-cols: 280px 1fr;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    background: transparent;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-header {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title span {
    font-size: 12px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.active-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 4px;
    height: 220px;   /* default desktop - inline style đã bị xóa khỏi HTML */
}

.active-list::-webkit-scrollbar {
    width: 5px;
}

.active-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.active-item {
    margin-bottom: 10px;
}

.active-link {
    display: block;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
}

.active-link:hover,
.active-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: none;
}

.active-link:hover span,
.active-link.active span {
    color: #fff !important;
}

.btn-copy-sidebar {
    opacity: 0.4;
    transition: all 0.2s ease;
}

.active-link:hover .btn-copy-sidebar {
    opacity: 0.85;
}

.btn-copy-sidebar:hover {
    opacity: 1 !important;
    color: #818cf8 !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* MAIN CONTENT */
.main-content {
    display: flex;
    flex-direction: column;
    padding: 32px;
    background: transparent;
}

.header-section {
    margin-bottom: 32px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.generator-card {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(30, 41, 59, 0.25);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.generator-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.generator-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.random-email-display {
    flex-grow: 1;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    height: 38px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-copy:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.btn-action {
    position: relative;
    width: 200px;
    flex-shrink: 0;
    padding: 8px 20px 8px 36px;
    background: var(--primary);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
}

.btn-action svg,
.btn-submit svg {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.btn-action:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* COUNTDOWN AREA */
.countdown-info {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-timer {
    color: #ef4444;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* FORM */
.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.input-group {
    position: relative;
    flex-grow: 1;
}

.search-input {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    height: 36px;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2),
        inset 0 4px 8px rgba(0, 0, 0, 0.65);
}

.btn-submit {
    position: relative;
    width: 200px;
    flex-shrink: 0;
    padding: 0 20px 0 36px;
    background: var(--primary);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* MAILBOX HEADER */
.mailbox-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mailbox-title span {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* EMAIL LIST */
.email-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 28px;
}

.email-list::before {
    content: '';
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 10px;
    width: 2px;
    background: linear-gradient(to bottom, #6366f1, rgba(99, 102, 241, 0.05));
    border-radius: 9999px;
}

.email-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.email-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 36px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    border: 2px solid #030712;
    box-shadow: 0 0 10px #6366f1;
    z-index: 2;
    transition: all 0.3s ease;
}

.email-item:hover::before {
    background: #a855f7;
    box-shadow: 0 0 12px #a855f7;
    transform: scale(1.2);
}

.email-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.email-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.email-sender {
    font-weight: 600;
    color: #818cf8;
}

.email-time {
    color: var(--text-muted);
}

.email-subject {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.email-body {
    background: var(--bg-canvas);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    overflow-x: auto;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
}

/* RESPONSIVE - mobile web */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .app-container {
        grid-template-columns: 1fr;
        border-radius: 8px;
        row-gap: 16px;    /* khoảng cách giữa sidebar và main content */
    }

    /* Sidebar xếp lên trên, dùng flex+gap để 2 khối cách nhau */
    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 16px;               /* khoảng cách giữa dropdown và countdown */
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }

    /* Override margin-top: auto của countdown (inline style) */
    .countdown-info-sidebar {
        margin-top: 0 !important;
    }

    /* List email: tự co giãn theo nội dung, không tạo ô trống thừa */
    .active-list {
        height: auto !important;     /* bỏ height cố định */
        max-height: 160px !important; /* vẫn giới hạn khi nhiều email */
    }

    .main-content {
        padding: 16px;
    }

    /* Generator row: xếp dọc */
    .generator-row {
        flex-direction: column;
        gap: 10px;
    }

    .random-email-display {
        width: 100%;
        height: auto;
        min-height: 40px;
        padding: 8px 12px;
    }

    /* Các nút bấm: full width */
    .btn-action,
    .btn-submit {
        width: 100%;
        height: 42px;
        padding-left: 0;
        justify-content: center;
    }

    .btn-action svg,
    .btn-submit svg {
        position: static;
        transform: none;
    }

    /* Search form: xếp dọc */
    .search-form {
        flex-direction: column;
        gap: 10px;
    }

    /* Mailbox title: xếp dọc, nút xóa full width */
    .mailbox-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        overflow: hidden;    /* tránh email address tràn ngang */
        width: 100%;
    }

    /* Span chứa email address: ellipsis thay vì cắt thô */
    .mailbox-title > span {
        overflow: hidden;
        width: 100%;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mailbox-title > button {
        width: 100%;
        justify-content: center;
    }

    /* Subtitle không bị cắt ngang */
    .header-subtitle {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Main content không tràn ngang */
    .main-content {
        overflow: hidden;
        min-width: 0;
    }

    /* Email list: thu padding timeline */
    .email-list {
        padding-left: 20px;
    }

    .email-list::before {
        left: 5px;
    }

    .email-item {
        padding: 14px;
    }

    .email-item::before {
        left: -19px;
        top: 26px;
    }

    /* Subject & body: bỏ padding-left (do đã dùng column) */
    .email-subject,
    .email-item > div[style*="padding-left: 52px"] {
        padding-left: 0 !important;
    }

    /* Nội dung email trong iframe: cho phép scroll ngang nếu cần */
    .email-body-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* API docs code block: scroll ngang riêng, không đẩy cả trang */
    .api-docs-container pre {
        font-size: 11px !important;
        padding: 10px !important;
        white-space: pre-wrap !important;   /* tự xuống dòng */
        word-break: break-all !important;   /* bẻ từ dài */
        overflow-x: auto !important;
        max-width: 100% !important;
    }

    /* API docs container không tràn */
    .api-docs-container {
        overflow: hidden;
        max-width: 100%;
    }

    /* Các thẻ code inline trong API docs */
    .api-docs-container code {
        word-break: break-all;
        white-space: normal;
    }

    /* Header title nhỏ lại */
    .header-title {
        font-size: 17px;
    }

    .header-subtitle {
        font-size: 13px;
    }
}

/* Hiệu ứng Sao băng (Shooting Stars) */
.shooting-stars-container {
    position: fixed;
    top: -35px;
    left: -35px;
    width: calc(100% + 70px);
    height: calc(100% + 70px);
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    margin-left: var(--bg-parallax-x3, 0px);
    margin-top: var(--bg-parallax-y3, 0px);
    transition: margin 0.15s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: margin;
}

.shooting-star {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 1px;
    background: linear-gradient(-45deg, #6366f1, #a5b4fc, #ffffff);
    border-radius: 999px;
    filter: drop-shadow(0 0 3px rgba(129, 140, 248, 0.45));
    animation: tail 3s ease-in-out infinite, shooting 3s ease-in-out infinite;
    will-change: transform, width;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: calc(50% - 0.5px);
    right: 0;
    height: 1px;
    background: linear-gradient(-45deg, rgba(0, 0, 0, 0), #a5b4fc, rgba(0, 0, 0, 0));
    transform: translateX(50%) rotate(45deg);
    border-radius: 100%;
}

.shooting-star:nth-child(1) {
    top: -10%;
    left: 90%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.shooting-star:nth-child(2) {
    top: 10%;
    left: 110%;
    animation-delay: 1.5s;
    animation-duration: 3.5s;
}

.shooting-star:nth-child(3) {
    top: -20%;
    left: 60%;
    animation-delay: 3s;
    animation-duration: 2.8s;
}

.shooting-star:nth-child(4) {
    top: 30%;
    left: 120%;
    animation-delay: 0.8s;
    animation-duration: 3.2s;
}

.shooting-star:nth-child(5) {
    top: -15%;
    left: 40%;
    animation-delay: 2.2s;
    animation-duration: 4s;
}

.shooting-star:nth-child(6) {
    top: 20%;
    left: 100%;
    animation-delay: 4.5s;
    animation-duration: 3s;
}

.shooting-star:nth-child(7) {
    top: -5%;
    left: 75%;
    animation-delay: 5.5s;
    animation-duration: 3.3s;
}

.shooting-star:nth-child(8) {
    top: 40%;
    left: 130%;
    animation-delay: 6.5s;
    animation-duration: 2.6s;
}

.shooting-star:nth-child(9) {
    top: -10%;
    left: 50%;
    animation-delay: 1.2s;
    animation-duration: 2.5s;
}

.shooting-star:nth-child(10) {
    top: 15%;
    left: 85%;
    animation-delay: 2.5s;
    animation-duration: 3.4s;
}

.shooting-star:nth-child(11) {
    top: -25%;
    left: 70%;
    animation-delay: 0.5s;
    animation-duration: 2.9s;
}

.shooting-star:nth-child(12) {
    top: 25%;
    left: 105%;
    animation-delay: 3.8s;
    animation-duration: 3.1s;
}

.shooting-star:nth-child(13) {
    top: -18%;
    left: 30%;
    animation-delay: 4.8s;
    animation-duration: 4.2s;
}

.shooting-star:nth-child(14) {
    top: 35%;
    left: 115%;
    animation-delay: 1.8s;
    animation-duration: 2.7s;
}

.shooting-star:nth-child(15) {
    top: -8%;
    left: 65%;
    animation-delay: 5.2s;
    animation-duration: 3.6s;
}

.shooting-star:nth-child(16) {
    top: 45%;
    left: 125%;
    animation-delay: 0.2s;
    animation-duration: 3.3s;
}

.shooting-star:nth-child(17) {
    top: -12%;
    left: 80%;
    animation-delay: 6.2s;
    animation-duration: 2.8s;
}

.shooting-star:nth-child(18) {
    top: 50%;
    left: 140%;
    animation-delay: 3.1s;
    animation-duration: 3.9s;
}

.shooting-star:nth-child(19) {
    top: -30%;
    left: 95%;
    animation-delay: 4.0s;
    animation-duration: 3.2s;
}

.shooting-star:nth-child(20) {
    top: 5%;
    left: 55%;
    animation-delay: 2.0s;
    animation-duration: 2.6s;
}

.shooting-star:nth-child(21) {
    top: -22%;
    left: 85%;
    animation-delay: 5.8s;
    animation-duration: 3.5s;
}

.shooting-star:nth-child(22) {
    top: 55%;
    left: 135%;
    animation-delay: 0.9s;
    animation-duration: 4.1s;
}

.shooting-star:nth-child(23) {
    top: -15%;
    left: 45%;
    animation-delay: 6.8s;
    animation-duration: 3.0s;
}

.shooting-star:nth-child(24) {
    top: 60%;
    left: 150%;
    animation-delay: 3.5s;
    animation-duration: 2.7s;
}

@keyframes tail {
    0% {
        width: 0;
    }

    30% {
        width: 45px;
    }

    100% {
        width: 0;
    }
}

@keyframes shooting {
    0% {
        transform: rotate(-45deg) translateX(0);
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: rotate(-45deg) translateX(-150vw);
        opacity: 0;
    }
}

/* Hiệu ứng Hố đen (Gargantua Black Hole) */
.black-hole-cursor {
    width: 32px;
    height: 32px;
    background: #000000;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 0 2px #000000,
        0 0 10px 4px rgba(245, 158, 11, 0.95),
        0 0 20px 8px rgba(236, 72, 153, 0.5),
        0 0 35px 15px rgba(99, 102, 241, 0.25),
        inset 0 0 10px rgba(255, 255, 255, 0.15);
    will-change: left, top;
}

.black-hole-cursor::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 12px;
    background: radial-gradient(ellipse at center, rgba(251, 146, 60, 0.95) 0%, rgba(244, 63, 94, 0.5) 45%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    filter: blur(0.5px);
    box-shadow: 0 0 12px rgba(251, 146, 60, 0.8);
    animation: rotateDisk 6s linear infinite;
}

.black-hole-cursor::after {
    content: "";
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    border: 1px solid rgba(251, 146, 60, 0.15);
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 62%, rgba(251, 146, 60, 0.15) 72%, rgba(236, 72, 153, 0.05) 90%);
    filter: blur(1px);
    animation: warpLight 8s ease-in-out infinite alternate;
}

@keyframes rotateDisk {
    0% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(0.95);
    }

    50% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(0.95);
    }
}

@keyframes warpLight {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.08) rotate(360deg);
        opacity: 1;
    }
}

#stardust-canvas {
    position: fixed;
    top: -25px;
    left: -25px;
    width: calc(100% + 50px);
    height: calc(100% + 50px);
    z-index: -1;
    pointer-events: none;
    margin-left: var(--bg-parallax-x2, 0px);
    margin-top: var(--bg-parallax-y2, 0px);
    transition: margin 0.15s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: margin;
}

/* Custom Pulse Dot */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-dot-anim 1.6s infinite;
}

@keyframes pulse-dot-anim {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Custom Mail Status Dot (Chấm thông báo mới nhận thư) */
.mail-status-dot {
    animation: mail-status-glow 1.8s infinite ease-in-out;
}

@keyframes mail-status-glow {

    0%,
    100% {
        opacity: 0.6;
        box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.9);
    }
}

/* Hiệu ứng Đang lắng nghe thư chuyển động */
.listening-text {
    animation: glow-pulse 2s infinite ease-in-out;
}

.listening-dots::after {
    content: '...';
    display: inline-block;
    width: 12px;
    text-align: left;
    animation: dots-wave 1.5s infinite steps(4);
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.75;
        text-shadow: 0 0 4px rgba(16, 185, 129, 0.2);
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    }
}

@keyframes dots-wave {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

/* Card Mouse Tracking Glow */
.generator-card::after,
.email-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(99, 102, 241, 0.08), transparent 50%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.generator-card:hover::after,
.email-item:hover::after {
    opacity: 1;
}

/* ===================== UTILITY CLASSES ===================== */
.flex-row-gap8 { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.overflow-hidden { overflow: hidden; }
.text-ellipsis { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; flex-grow: 1; text-align: left; }
.icon-inline { display: inline-block; vertical-align: middle; }

/* Sidebar */
.sidebar-header { margin-bottom: 16px; }
.sidebar-title { display: flex; align-items: center; gap: 8px; color: #818cf8; }
.sidebar-dropdown {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.015);
    margin-bottom: 20px;
}
.sidebar-dropdown-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.badge-count {
    font-size: 11px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.active-list { margin-top: 14px; overflow-y: auto; list-style: none; }
.active-item { margin-bottom: 8px; }
.active-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; }
.list-index { color: var(--text-muted); font-weight: 700; font-size: 11px; min-width: 14px; }
.dot-active {
    margin-left: auto;
    width: 8px; height: 8px;
    flex-shrink: 0;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}
.dot-inactive {
    margin-left: auto;
    width: 8px; height: 8px;
    flex-shrink: 0;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #ef4444;
}
.empty-list-item {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* Countdown */
.countdown-info-sidebar { border-top: 1px solid var(--border-color); padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.countdown-row { display: flex; flex-direction: column; gap: 6px; }
.countdown-label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.countdown-timer { color: #10b981; font-weight: 700; font-size: 14px; text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.countdown-bar-container { width: 100%; height: 5px; background: rgba(255,255,255,0.06); border-radius: 9999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.03); margin-top: 4px; }
.countdown-bar-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #10b981, #6366f1); transition: width 1s linear; border-radius: 9999px; }
.auto-check-wrapper { min-height: 20px; }
.auto-check-status { color: #10b981; font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 6px; }

/* Generator */
.generator-card--transparent { background: transparent !important; border: none !important; backdrop-filter: none !important; padding: 0 !important; margin-bottom: 20px; box-shadow: none !important; }

/* Search */
.search-form { margin-bottom: 24px; }
.search-input { padding-left: 42px; height: 36px; font-size: 13px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); opacity: 0.8; pointer-events: none; z-index: 1; }

/* Mailbox */
.mailbox-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.btn-danger { background: rgba(239, 68, 68, 0.2) !important; border-color: rgba(239, 68, 68, 0.4) !important; color: #f87171 !important; }
.empty-icon { display: flex; justify-content: center; align-items: center; }

/* Email item */
.email-item { margin-bottom: 24px; position: relative; }
.email-header-glow { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sender-avatar-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
    border: 1.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}
.email-sender { font-weight: 600; color: #f8fafc; font-size: 14px; }
.email-time { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.badge-otp {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    font-size: 10px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.email-subject { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text-main); padding-left: 52px; }
.email-body-wrapper { padding-left: 52px; }
.email-body-container { width: 100%; background: rgba(255, 255, 255, 0.98); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.06); }

/* API Docs */
.api-docs-container { margin-top: 40px; border-top: 1px solid var(--border-color); padding-top: 30px; }
.api-details { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; max-width: 100%; }
.api-summary { font-size: 14px; font-weight: 600; color: #818cf8; cursor: pointer; display: flex; align-items: center; gap: 8px; outline: none; user-select: none; padding: 16px; }
.api-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; padding: 0 16px 16px 16px; }
.api-intro-text { margin-bottom: 12px; font-weight: 500; color: var(--text-main); }
.api-endpoint { background: rgba(0, 0, 0, 0.3); padding: 12px; border-radius: 6px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.03); }
.api-endpoint--last { margin-bottom: 16px; }
.api-method { color: #34d399; font-weight: 600; }
.api-url { color: #f8fafc; font-family: monospace; word-break: break-all; }
.api-code-label { margin-bottom: 8px; font-weight: 500; color: var(--text-main); }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); z-index: 10000; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.modal-box { background: rgba(15, 23, 42, 0.95); border: 1px solid rgba(99, 102, 241, 0.3); border-radius: 8px; width: 90%; max-width: 540px; padding: 24px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); transform: scale(0.9); transition: transform 0.3s ease; text-align: center; }
.modal-icon-wrapper { margin-bottom: 16px; display: flex; justify-content: center; }
.modal-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(239, 68, 68, 0.15); border: 1.5px solid rgba(239, 68, 68, 0.4); display: flex; align-items: center; justify-content: center; color: #ef4444; }
.modal-title { font-size: 16px; font-weight: 600; color: #f8fafc; margin-bottom: 8px; }
.modal-message { font-size: 13px; color: #94a3b8; line-height: 1.5; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-btn { flex: 1; padding: 10px; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.modal-btn--cancel { border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); color: #94a3b8; }
.modal-btn--confirm { border: none; background: #ef4444; color: #fff; }

/* Custom Select Dropdown Styling */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    min-width: 270px;
    height: 38px;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    height: 100%;
}

.custom-select-wrapper:hover .custom-select-trigger,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.45),
                inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-select-trigger .arrow-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .arrow-icon {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 250px;
    overflow-y: auto;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    padding: 10px 16px;
    color: #94a3b8;
    transition: all 0.2s ease;
    text-align: left;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

.custom-option:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    box-shadow: inset 0 0 8px rgba(99, 102, 241, 0.3);
    border-left-color: rgba(99, 102, 241, 0.4);
}

.custom-option.selected {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.15);
    font-weight: 700;
    border-left-color: #818cf8;
    text-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
}

/* Custom Scrollbar for Options List */
.custom-options::-webkit-scrollbar {
    width: 6px !important;
    display: block !important;
}
.custom-options::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}
.custom-options::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}
.custom-options::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}