:root {
    --qp-primary: #00288e;
    --qp-primary-strong: #1e40af;
    --qp-primary-soft: #dde1ff;
    --qp-primary-soft-dim: #b8c4ff;
    --qp-surface: #fbf8ff;
    --qp-surface-card: #ffffff;
    --qp-surface-muted: #f4f2fc;
    --qp-surface-muted-2: #eeedf7;
    --qp-border: #d9d9e6;
    --qp-text: #1a1b22;
    --qp-muted: #444653;
    --qp-danger: #ba1a1a;
    --qp-danger-soft: #ffdad6;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--qp-surface);
    color: var(--qp-text);
}

main {
    min-width: 0;
}

/* Custom color utilities used by the Razor views. This keeps pages consistent even when a standalone view misses Tailwind config. */
.bg-primary { background-color: var(--qp-primary) !important; }
.bg-primary-container { background-color: var(--qp-primary-strong) !important; }
.bg-primary-fixed { background-color: var(--qp-primary-soft) !important; }
.bg-primary-fixed-dim { background-color: var(--qp-primary-soft-dim) !important; }
.bg-surface { background-color: var(--qp-surface) !important; }
.bg-background { background-color: var(--qp-surface) !important; }
.bg-surface-container-lowest { background-color: var(--qp-surface-card) !important; }
.bg-surface-container-low { background-color: var(--qp-surface-muted) !important; }
.bg-surface-container { background-color: var(--qp-surface-muted-2) !important; }
.bg-surface-container-high { background-color: #e8e7f1 !important; }
.bg-surface-variant { background-color: #e9e7f3 !important; }
.bg-error-container { background-color: var(--qp-danger-soft) !important; }
.text-primary { color: var(--qp-primary) !important; }
.text-on-primary { color: #ffffff !important; }
.text-on-primary-container { color: #ffffff !important; }
.text-on-background,
.text-on-surface { color: var(--qp-text) !important; }
.text-on-surface-variant { color: var(--qp-muted) !important; }
.text-error { color: var(--qp-danger) !important; }
.border-primary { border-color: var(--qp-primary) !important; }
.border-outline-variant { border-color: var(--qp-border) !important; }
.border-outline { border-color: #757684 !important; }

.material-symbols-outlined {
    vertical-align: middle;
    line-height: 1;
}

/* App shell */
#sidebarPanel {
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

#sidebarPanel a {
    min-height: 44px;
}

.sidebar-overlay {
    backdrop-filter: blur(2px);
}

@media (min-width: 768px) {
    .md\:ml-\[320px\] {
        margin-left: 280px !important;
    }

    .md\:ml-\[280px\] {
        margin-left: 280px !important;
    }
}

@media (max-width: 767px) {
    main {
        width: 100%;
    }

    header.sticky h1,
    header h1 {
        max-width: 60vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Tables and forms */
.table-responsive,
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    font-weight: 700;
    color: var(--qp-muted);
}

input,
select,
textarea {
    max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--qp-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 40, 142, 0.12) !important;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.card-surface {
    background: var(--qp-surface-card);
    border: 1px solid var(--qp-border);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

/* Landing page polish */
.nav-link:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(0, 40, 142, 0.28);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .text-5xl { font-size: 2.25rem !important; line-height: 1.15 !important; }
    .text-4xl { font-size: 2rem !important; line-height: 1.2 !important; }
    .px-10 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
}

/* Public layout: keep the navbar usable on small screens. */
@media (max-width: 767px) {
    body.pt-\[80px\] {
        padding-top: 72px !important;
    }

    body > header.fixed {
        height: 72px !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        gap: .75rem;
    }

    body > header.fixed .text-xl {
        font-size: .95rem !important;
        line-height: 1.15 !important;
    }

    body > header.fixed .material-symbols-outlined {
        font-size: 28px !important;
    }

    body > header.fixed .flex.items-center.gap-3 a {
        padding: .55rem .85rem !important;
        font-size: .78rem !important;
        white-space: nowrap;
    }
}

@media (max-width: 420px) {
    body > header.fixed .flex.items-center.gap-2 span:last-child {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body > header.fixed .flex.items-center.gap-3 {
        gap: .4rem !important;
    }
}

/* =========================================================
   QUIZPRO ACADEMY - Vibrant redesign pack
   Mục tiêu: giao diện nổi bật, sinh động, hiện đại hơn nhưng
   không ảnh hưởng logic Razor/Controller hiện tại.
   ========================================================= */
:root {
    --qp-primary: #2563eb;
    --qp-primary-strong: #1d4ed8;
    --qp-primary-deep: #0f172a;
    --qp-accent: #7c3aed;
    --qp-accent-2: #06b6d4;
    --qp-warm: #f97316;
    --qp-success: #16a34a;
    --qp-surface: #f6f8ff;
    --qp-surface-card: rgba(255,255,255,.88);
    --qp-surface-muted: #eef4ff;
    --qp-surface-muted-2: #e8efff;
    --qp-border: rgba(37, 99, 235, .16);
    --qp-text: #0f172a;
    --qp-muted: #64748b;
    --qp-shadow-sm: 0 10px 30px rgba(15, 23, 42, .07);
    --qp-shadow-md: 0 22px 60px rgba(30, 64, 175, .14);
    --qp-shadow-lg: 0 34px 90px rgba(30, 64, 175, .22);
    --qp-radius: 24px;
}

body {
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, .13), transparent 34rem),
        radial-gradient(circle at 85% 10%, rgba(6, 182, 212, .16), transparent 34rem),
        linear-gradient(180deg, #f8fbff 0%, #eef4ff 52%, #f8fbff 100%) !important;
    color: var(--qp-text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(37,99,235,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 78%);
}

/* Color utility refresh */
.bg-primary { background-color: var(--qp-primary) !important; }
.bg-primary-container { background-color: var(--qp-primary-strong) !important; }
.bg-primary-fixed { background: linear-gradient(135deg, #dbeafe, #ede9fe) !important; }
.bg-surface, .bg-background { background: transparent !important; }
.bg-surface-container-lowest, .bg-white {
    background: var(--qp-surface-card) !important;
}
.bg-surface-container-low, .bg-surface-container, .bg-surface-variant {
    background: rgba(239, 246, 255, .82) !important;
}
.text-primary { color: var(--qp-primary) !important; }
.text-on-primary-container { color: #dbeafe !important; }
.text-on-surface-variant { color: var(--qp-muted) !important; }
.border-outline-variant, .border-outline { border-color: var(--qp-border) !important; }

/* Glass navbar */
body > header.fixed {
    background: rgba(255,255,255,.78) !important;
    border-bottom: 1px solid rgba(37,99,235,.14) !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(18px) saturate(160%);
}
body > header.fixed .material-symbols-outlined.text-primary {
    background: linear-gradient(135deg, var(--qp-primary), var(--qp-accent));
    -webkit-background-clip: text;
    color: transparent !important;
}
body > header.fixed .text-xl,
body > header.fixed .text-2xl {
    background: linear-gradient(135deg, var(--qp-primary), var(--qp-accent));
    -webkit-background-clip: text;
    color: transparent !important;
}
.nav-link::after {
    height: 3px !important;
    background: linear-gradient(90deg, var(--qp-primary), var(--qp-accent-2)) !important;
}

/* Buttons */
a.rounded-full, button.rounded-full,
a.rounded-lg, button.rounded-lg,
a.rounded-xl, button.rounded-xl {
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease !important;
}
a.rounded-full:hover, button.rounded-full:hover,
a.rounded-lg:hover, button.rounded-lg:hover,
a.rounded-xl:hover, button.rounded-xl:hover {
    transform: translateY(-2px);
}
.bg-primary, .bg-blue-700 {
    background: linear-gradient(135deg, var(--qp-primary), var(--qp-accent)) !important;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .26) !important;
}
.bg-green-700 { background: linear-gradient(135deg, #16a34a, #06b6d4) !important; }
.bg-red-50 { background: rgba(254, 226, 226, .82) !important; }
.bg-green-50 { background: rgba(220, 252, 231, .82) !important; }
.bg-blue-50 { background: rgba(219, 234, 254, .9) !important; }
.bg-orange-50 { background: rgba(255, 237, 213, .9) !important; }
.bg-purple-50 { background: rgba(237, 233, 254, .9) !important; }
.bg-yellow-50 { background: rgba(254, 249, 195, .9) !important; }

/* Cards, tables, forms */
.card-surface,
.rounded-xl.border,
.rounded-2xl.border,
.rounded-3xl.border,
.bg-white.rounded-xl,
.bg-white.rounded-2xl,
.bg-white.rounded-3xl {
    border-color: rgba(37,99,235,.13) !important;
    box-shadow: var(--qp-shadow-sm) !important;
    backdrop-filter: blur(16px) saturate(150%);
}
.bg-white.rounded-xl:hover,
.bg-white.rounded-2xl:hover,
.rounded-xl.border:hover,
.rounded-2xl.border:hover {
    box-shadow: var(--qp-shadow-md) !important;
}
.shadow-sm { box-shadow: var(--qp-shadow-sm) !important; }
.shadow-md { box-shadow: var(--qp-shadow-md) !important; }
.shadow-lg { box-shadow: var(--qp-shadow-lg) !important; }

input, select, textarea {
    border-radius: 16px !important;
    background: rgba(255,255,255,.92) !important;
    border-color: rgba(37,99,235,.16) !important;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--qp-primary) !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,.15) !important;
}

table thead tr, thead.bg-surface-container-low {
    background: linear-gradient(135deg, rgba(219,234,254,.9), rgba(237,233,254,.9)) !important;
}
tbody tr { transition: background .18s ease, transform .18s ease; }
tbody tr:hover {
    background: rgba(219,234,254,.34) !important;
}

/* App shell */
main.flex-1 {
    background: transparent !important;
}
main > header.sticky {
    height: 68px !important;
    background: rgba(255,255,255,.76) !important;
    border-bottom: 1px solid rgba(37,99,235,.12) !important;
    box-shadow: 0 14px 45px rgba(15,23,42,.06) !important;
    backdrop-filter: blur(18px) saturate(150%);
}
main > header.sticky h1 {
    letter-spacing: -.02em;
}
main > div.flex-1.p-4,
main > div.flex-1.p-6 {
    position: relative;
}
main > div.flex-1.p-4::before,
main > div.flex-1.p-6::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 240px;
    z-index: -1;
    background: linear-gradient(135deg, rgba(37,99,235,.09), rgba(124,58,237,.07), rgba(6,182,212,.07));
    border-radius: 0 0 40px 40px;
}

/* Sidebars */
#sidebarPanel {
    width: 292px !important;
    background:
        radial-gradient(circle at 30% 0%, rgba(96,165,250,.32), transparent 13rem),
        linear-gradient(180deg, #0f172a 0%, #1e1b4b 54%, #111827 100%) !important;
    color: #fff !important;
    border-right: 1px solid rgba(255,255,255,.12) !important;
    box-shadow: 26px 0 70px rgba(15, 23, 42, .22) !important;
}
#sidebarPanel .border-b { border-color: rgba(255,255,255,.12) !important; }
#sidebarPanel .bg-primary,
#sidebarPanel .bg-primary-container {
    background: linear-gradient(135deg, #60a5fa, #a78bfa) !important;
    color: white !important;
    box-shadow: 0 12px 28px rgba(96,165,250,.22) !important;
}
#sidebarPanel .text-primary,
#sidebarPanel .text-on-surface,
#sidebarPanel .text-on-background {
    color: #fff !important;
}
#sidebarPanel .text-on-surface-variant,
#sidebarPanel p,
#sidebarPanel span:not(.material-symbols-outlined) {
    color: rgba(226,232,240,.78) !important;
}
#sidebarPanel a {
    color: rgba(226,232,240,.82) !important;
    border: 1px solid transparent;
    border-radius: 16px !important;
    position: relative;
    overflow: hidden;
}
#sidebarPanel a:hover {
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(255,255,255,.12) !important;
    color: #fff !important;
    transform: translateX(4px);
}
#sidebarPanel a.bg-primary,
#sidebarPanel a[class*="bg-primary"] {
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    border-color: rgba(255,255,255,.2) !important;
    color: #fff !important;
    box-shadow: 0 14px 36px rgba(37,99,235,.34) !important;
}
#sidebarPanel a.bg-primary .material-symbols-outlined,
#sidebarPanel a[class*="bg-primary"] .material-symbols-outlined {
    color: #fff !important;
}
@media (min-width: 768px) {
    .md\:ml-\[320px\], .md\:ml-\[280px\] { margin-left: 292px !important; }
}

/* Hero/banner sections */
.bg-gradient-to-r.from-primary,
.bg-gradient-to-br.from-primary-container,
.bg-gradient-to-br.from-primary,
.bg-gradient-to-r.from-primary.to-primary-container {
    background:
        radial-gradient(circle at 80% 18%, rgba(255,255,255,.22), transparent 11rem),
        radial-gradient(circle at 20% 86%, rgba(6,182,212,.28), transparent 15rem),
        linear-gradient(135deg, #2563eb 0%, #7c3aed 52%, #06b6d4 100%) !important;
    box-shadow: var(--qp-shadow-md);
}

/* Dashboard stat cards */
.grid > .bg-white.rounded-xl,
.grid > .bg-white.rounded-2xl {
    position: relative;
    overflow: hidden;
}
.grid > .bg-white.rounded-xl::after,
.grid > .bg-white.rounded-2xl::after {
    content: "";
    position: absolute;
    right: -38px;
    top: -44px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(37,99,235,.11), rgba(124,58,237,.11));
    pointer-events: none;
}
.grid > .bg-white.rounded-xl .material-symbols-outlined,
.grid > .bg-white.rounded-2xl .material-symbols-outlined {
    filter: drop-shadow(0 8px 16px rgba(37,99,235,.16));
}

/* Auth pages */
body.min-h-screen.flex > .hidden.lg\:flex,
body.min-h-screen.flex > .hidden.lg\:flex.lg\:w-1\/2 {
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,.28), transparent 12rem),
        radial-gradient(circle at 80% 80%, rgba(6,182,212,.36), transparent 15rem),
        linear-gradient(145deg, #0f172a 0%, #1d4ed8 50%, #7c3aed 100%) !important;
}
body.min-h-screen.flex > .hidden.lg\:flex::after {
    content: "";
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 32px;
    pointer-events: none;
}
.max-w-\[420px\], .max-w-\[480px\], .max-w-\[520px\] {
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(37,99,235,.14);
    border-radius: 28px;
    box-shadow: var(--qp-shadow-lg);
    backdrop-filter: blur(20px) saturate(150%);
}
.max-w-\[420px\] { padding: 32px; }

/* Public footer */
footer {
    background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(238,244,255,.94)) !important;
    border-top: 1px solid rgba(37,99,235,.12) !important;
}

@media (max-width: 767px) {
    #sidebarPanel { width: 286px !important; }
    main > header.sticky { height: 62px !important; }
    .max-w-\[420px\] { padding: 24px; }
    .grid > .bg-white.rounded-xl::after,
    .grid > .bg-white.rounded-2xl::after { width: 86px; height: 86px; }
}
