/* ══════════════════════════════════════════════════
   1. RESET & BASE
══════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f7f8fb;
    color: #475569;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    font-family: 'Quicksand', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

input,
select,
textarea {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-family: 'Quicksand', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ══════════════════════════════════════════════════
   2. SCROLLBAR — LIGHT mode (default)
══════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ══════════════════════════════════════════════════
   3. HEADER — BASE (light mode = default)
══════════════════════════════════════════════════ */
.main-header {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 9999;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.88),
            rgba(255, 255, 255, 0.80));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 10px 35px rgba(15, 23, 42, 0.08),
        0 2px 10px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transition:
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}

.main-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ── Scrolled state ── */
#main-header.header-scrolled .main-header,
.main-header.header-scrolled {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.94),
            rgba(255, 255, 255, 0.88));
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.12),
        0 4px 14px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* ══════════════════════════════════════════════════
   4. HEADER — LAYOUT
══════════════════════════════════════════════════ */
.hdr-inner {
    position: relative;
    z-index: 2;
    height: 64px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hdr-left,
.hdr-right {
    display: flex;
    align-items: center;
}

.hdr-left {
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}

.hdr-right {
    gap: 8px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   5. HEADER — LOGO
══════════════════════════════════════════════════ */
.logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s ease, opacity 0.22s ease;
    text-decoration: none;
}

.logo-wrap:hover {
    transform: translateY(-1px) scale(1.02);
    opacity: 0.96;
}

.logo-box {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff8a1f 0%, #f97316 100%);
    box-shadow:
        0 10px 18px rgba(249, 115, 22, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.logo-box::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.22);
    pointer-events: none;
}

.logo-img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* ══════════════════════════════════════════════════
   6. HEADER — NAV
══════════════════════════════════════════════════ */
.hdr-nav {
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.hdr-home {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f97316;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid rgba(251, 146, 60, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: all 0.22s ease;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
}

.hdr-home:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    box-shadow:
        0 8px 18px rgba(249, 115, 22, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.hdr-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hdr-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 7px;
    height: 2px;
    border-radius: 999px;
    color: #f97316;
    background: linear-gradient(90deg, #fb923c 0%, #f97316 100%);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease;
}

.hdr-link:hover {
    color: #f97316;
    background: rgba(248, 250, 252, 0.95);
    transform: translateY(-1px);
}

.hdr-link:hover::after,
.hdr-link.active::after {
    transform: scaleX(1);
}

.hdr-link.active {
    color: #ea580c;
    background: rgba(255, 247, 237, 0.95);
}

/* ══════════════════════════════════════════════════
   7. HEADER — BUTTONS
══════════════════════════════════════════════════ */
.hdr-icon-btn {
    width: 38px;
    height: 38px;
}

.hdr-icon-btn,
.hdr-user-btn {
    min-width: 38px;
    min-height: 38px;
    border-radius: 12px;
    border: 1px solid transparent;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: transform 0.22s ease, background 0.22s ease,
        color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    flex-shrink: 0;
}

.hdr-icon-btn:hover,
.hdr-user-btn:hover {
    transform: translateY(-1px);
    color: #0f172a;
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}



.has-badge .hdr-badge {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 2px #fff;
}

/* ══════════════════════════════════════════════════
   8. THEME ICONS — hiện/ẩn theo class trên <html>
══════════════════════════════════════════════════ */
/* Light mode (mặc định): hiện mặt trăng (bấm → tối) */
.icon-sun {
    display: none;
}

.icon-moon {
    display: block;
}

/* ══════════════════════════════════════════════
   XÓA HẾT CÁI NÀY:
   @media (prefers-color-scheme: dark) { ... }
   THAY BẰNG bên dưới
══════════════════════════════════════════════ */

/* ── DARK: Body ── */
.dark body {
    background: #09090b;
    color: #334155;
}

/* ── DARK: Header base ── */
.dark #main-header {
    background: linear-gradient(180deg,
            rgba(24, 24, 27, 0.88),
            rgba(24, 24, 27, 0.80));
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.30),
        0 2px 10px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── DARK: Header scrolled ── */
.dark #main-header.header-scrolled {
    background: linear-gradient(180deg,
            rgba(30, 30, 35, 0.94),
            rgba(24, 24, 27, 0.88));
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.40),
        0 4px 14px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── DARK: Nav links ── */
.dark .hdr-link {
    color: #ffffff;
}

.dark .hdr-link:hover {
    color: #fb923c;
    background: rgba(30, 41, 59, 0.80);
}

.dark .hdr-link.active {
    color: #fb923c;
    background: rgba(249, 115, 22, 0.12);
}

/* ── DARK: Home button ── */
.dark .hdr-home {
    background: rgba(249, 115, 22, 0.10);
    border-color: rgba(249, 115, 22, 0.30);
}

.dark .hdr-home:hover {
    background: rgba(249, 115, 22, 0.18);
    box-shadow:
        0 8px 18px rgba(249, 115, 22, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ── DARK: Icon/User buttons ── */
.dark .hdr-icon-btn,
.dark .hdr-user-btn {
    color: #94a3b8;
}

.dark .hdr-icon-btn:hover,
.dark .hdr-user-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.20);
}


/* ── DARK: Badge ── */
.dark .has-badge .hdr-badge {
    box-shadow: 0 0 0 2px #1e293b;
}

/* ── DARK: Scrollbar ── */
.dark ::-webkit-scrollbar-track {
    background: #1e1e24;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* ══════════════════════════════════════════════════
   10. MOBILE — HEADER
══════════════════════════════════════════════════ */
@media (max-width: 1023.98px) {
    .hdr-inner {
        height: 60px;
        padding: 0 14px;
    }

    .logo-box {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
}

@media (max-width: 639.98px) {
    .main-header {
        border-radius: 20px;
    }

    .hdr-inner {
        gap: 10px;
    }

    .hdr-right {
        gap: 4px;
    }
}

/* ══════════════════════════════════════════════════
   11. MOBILE MENU
══════════════════════════════════════════════════ */
.mobile-menu-open {
    overflow: hidden;
}

.mobile-overlay {
    transition: opacity 0.3s ease;
}

.mobile-drawer {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════
   12. ANIMATIONS & UTILS
══════════════════════════════════════════════════ */
@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.65;
    }
}

.text-darkText {
    color: #1f2a44;
}

html.dark .text-darkText {
    color: #e2e8f0;
}