/* ============================================
   MATERIAL DESIGN THEME - Examination Platform
   ============================================ */

/* Material Icons - Google Fonts CDN (font local không tồn tại nên dùng CDN) */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
/* Font tiếng Việt hiển thị tốt (dấu, ký tự) */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;600;700&display=swap');

/* Local Fonts - Roboto */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/fonts/roboto/roboto-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/roboto/roboto-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/roboto/roboto-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/roboto/roboto-700.woff2') format('woff2');
}

/* Local Fonts - Roboto Slab */
@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/roboto-slab/roboto-slab-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/roboto-slab/roboto-slab-700.woff2') format('woff2');
}

/* Material Icons: font load từ Google CDN qua @import phía trên */

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   CSS Variables - Material Design Palette
   ============================================ */
:root {
    --md-primary: #1565c0;
    --md-primary-light: #5e92f3;
    --md-primary-dark: #003c8f;
    --md-accent: #ff6d00;
    --md-accent-light: #ff9e40;
    --md-accent-dark: #c43e00;
    --md-background: #f5f5f5;
    --md-surface: #ffffff;
    --md-error: #d32f2f;
    --md-success: #2e7d32;
    --md-warning: #f9a825;
    --md-on-primary: #ffffff;
    --md-on-surface: #212121;
    --md-on-surface-medium: #666666;
    --md-on-surface-light: #9e9e9e;
    --md-divider: #e0e0e0;
    --md-shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --md-shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --md-shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --md-shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    --md-radius: 8px;
    --md-radius-lg: 16px;
    --md-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Base & Reset - Web + Mobile
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    min-height: 100vh;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Be Vietnam Pro', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--md-background);
    color: var(--md-on-surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    height: 100%;
    display: flex;
    flex-direction: column;
}

body > .container-fluid {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Phần trên footer không bị co */
.container-fluid > div:not(.footer-wrapper) {
    flex-shrink: 0;
}

/* Footer luôn dính đáy — trang ngắn (không scroll) hoặc dài đều đúng */
.container-fluid > .footer-wrapper,
body > .container-fluid > div:last-child {
    margin-top: auto;
    flex-shrink: 0;
}

/* Trang chủ (màn đếm thời gian): footer nằm xuống dưới thêm 100px */
.home-hero + .footer-wrapper {
    padding-top: 100px;
}

/* Touch optimization - giảm delay 300ms trên mobile */
a, button {
    touch-action: manipulation;
}

/* Safe area cho iPhone X+ (notch) */
@supports (padding: env(safe-area-inset-left)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Slab', 'Roboto', sans-serif;
    font-weight: 500;
    color: var(--md-on-surface);
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--md-primary);
    text-decoration: none;
    transition: var(--md-transition);
}

a:hover {
    color: var(--md-primary-dark);
}

/* ============================================
   Container & Layout
   ============================================ */
.container-fluid {
    position: relative;
}

/* ============================================
   Page layouts - Nội dung chính các màn hình
   ============================================ */
.page-content {
    min-height: 50vh;
    padding: 32px 5%;
    background: linear-gradient(180deg, #f5f7fa 0%, #eef2f7 50%, #f8fafc 100%);
}
.page-content--narrow {
    max-width: 720px;
    margin: 0 auto;
}

/* Auth cards - Đăng nhập, Đăng ký */
.auth-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(165deg, #e0e8f2 0%, #dce5f0 30%, #e8eef5 60%, #f0f4f9 100%);
    background-attachment: fixed;
    position: relative;
}
.auth-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 50%, rgba(255,255,255,0.2) 100%);
    pointer-events: none;
}
.auth-wrap .auth-card { position: relative; z-index: 1; }
/* Nền trang đăng nhập - hình trang trí */
.auth-wrap-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.auth-wrap-bg::before,
.auth-wrap-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 101, 192, 0.12) 0%, transparent 70%);
    animation: authFloat 8s ease-in-out infinite;
}
.auth-wrap-bg::before {
    width: 280px; height: 280px;
    top: 10%; left: -5%;
    animation-delay: 0s;
}
.auth-wrap-bg::after {
    width: 200px; height: 200px;
    bottom: 15%; right: -3%;
    animation-delay: -4s;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
}
@keyframes authFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, -20px) scale(1.05); }
}
/* Card đăng nhập - entrance */
.auth-card-enter {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-card-enter.auth-card-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.auth-card .card-header .auth-card-icon {
    transition: transform 0.35s ease;
}
.auth-card-visible .auth-card-header .auth-card-icon {
    animation: authIconIn 0.6s ease 0.2s backwards;
}
@keyframes authIconIn {
    from { opacity: 0; transform: rotate(-20deg) scale(0.8); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}
/* Input focus - viền sáng */
.auth-card .mb-3.input-focused .form-control {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}
.auth-card .mb-3 { transition: transform 0.2s ease; }
.auth-card .mb-3.input-focused { transform: translateY(-1px); }
/* Nút đăng nhập */
.btn-login-submit {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(21, 101, 192, 0.4) !important;
}
.btn-login-submit.btn-login-click {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3) !important;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid rgba(21, 101, 192, 0.06);
}
.auth-card .card-header {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #5b21b6 100%);
    color: white;
    padding: 24px 28px;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
}
.auth-card .card-header .material-icons,
.auth-card .card-header .auth-card-icon {
    font-size: 28px;
    opacity: 0.95;
}
.auth-card .card-body {
    padding: 28px 28px 32px;
}
.auth-card .form-label {
    font-weight: 600;
    color: #37474f;
    margin-bottom: 6px;
}
.auth-card .form-control {
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    padding: 14px 18px;
    min-height: 48px;
    font-size: 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) inset, 0 1px 3px rgba(0, 0, 0, 0.06);
}
.auth-card .form-control:hover {
    border-color: #c7d2fe;
}
.auth-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 1px 2px rgba(0, 0, 0, 0.04) inset;
    outline: none;
    background-image: none;
    background-color: #ffffff;
}
.auth-card .btn-primary {
    padding: 14px 24px;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 28px;
    margin-top: 8px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}
.auth-card .btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}
.auth-card .alert {
    border-radius: 14px;
    border: none;
}
.auth-card .alert-danger { background: #ffebee; color: #b71c1c; }
.auth-card .alert-success { background: #e8f5e9; color: #1b5e20; }
.auth-footer-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-weight: 500;
    color: #4f46e5;
    transition: color 0.2s ease;
}
.auth-footer-link:hover { color: #4338ca; }
.auth-note {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #78909c;
}

/* Register page - form rộng hơn */
.register-wrap {
    padding: 36px 20px 48px;
    background: linear-gradient(165deg, #e0e8f2 0%, #dce5f0 30%, #e8eef5 60%, #f0f4f9 100%);
    background-attachment: fixed;
    position: relative;
}
.register-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 50%, rgba(255,255,255,0.2) 100%);
    pointer-events: none;
}
.register-wrap .register-card { position: relative; z-index: 1; }
.register-card {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid rgba(21, 101, 192, 0.06);
}
.register-card .card-header {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: white;
    padding: 24px 28px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
}
.register-card .card-body { padding: 28px 32px 36px; }
.register-card .form-control {
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    padding: 3px 18px;
    min-height: 48px;
    font-size: 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) inset, 0 1px 3px rgba(0, 0, 0, 0.06);
}
.register-card .form-control:hover {
    border-color: #c7d2fe;
}
.register-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 1px 2px rgba(0, 0, 0, 0.04) inset;
    outline: none;
    background-image: none;
    background-color: #ffffff;
}
.register-hint {
    display: block;
    font-size: 12px;
    color: #78909c;
    margin-top: 4px;
}
.register-card .btn-primary {
    padding: 14px 24px;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 28px;
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.35);
}
.register-card .alert { border-radius: 14px; border: none; }
.register-support {
    text-align: center;
    color: #1565c0;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 20px;
}

/* Content pages - Thông tin, Kết quả (nền transient) */
.content-page-wrap {
    min-height: 50vh;
    padding: 32px 5%;
    background: linear-gradient(165deg, #e8eef5 0%, #e0e8f2 30%, #e8eef5 60%, #f0f4f9 100%);
    background-attachment: fixed;
    position: relative;
}
.content-page-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 50%, rgba(255,255,255,0.25) 100%);
    pointer-events: none;
}
.content-page-wrap .container {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    padding: 36px 40px;
    border: 1px solid rgba(21, 101, 192, 0.06);
    overflow-x: auto;
    position: relative;
    z-index: 1;
}

/* Bảng trong nội dung CKEditor - scroll ngang trên mobile */
.content-page-wrap table,
.infoExam table,
.examResult table {
    max-width: 100%;
}
.content-page-wrap .container {
    -webkit-overflow-scrolling: touch;
}

/* Home page - Hero & CTA (nền transient bóng bẩy) */
.home-hero {
    padding: 40px 5% 48px;
    background: linear-gradient(165deg, #e8eef5 0%, #dce5f0 20%, #e3eaf2 40%, #f0f4f9 60%, #e8eef5 80%, #dce5f0 100%);
    background-attachment: fixed;
    position: relative;
    flex: 1;
}
.home-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, transparent 30%, transparent 70%, rgba(255,255,255,0.3) 100%);
    pointer-events: none;
}
.home-hero .uk-child-width-1-1,
.home-hero .infoHome,
.home-hero .kkv-countdown,
.home-hero .home-cta {
    position: relative;
    z-index: 1;
}

/* Wrapper countdown giữa trang */
.home-hero .uk-grid-margin .kkv-countdown {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}
.home-hero .infoHome {
    font-size: inherit;
    color: var(--md-on-surface);
}
.home-hero .infoHome h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0d47a1;
    margin-bottom: 8px;
}
.home-hero .kkv-date-end {
    color: #546e7a;
    font-size: 1rem;
}
.home-cta {
    margin-top: 36px;
}
.home-cta .btn {
    padding: 16px 52px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 28px;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-cta .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(211, 47, 47, 0.45);
}
.home-cta .btn .material-icons { font-size: 24px; }

/* History exam card (fragment) */
.history-exam-wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px;
}
.history-exam-wrap h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1565c0;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 24px;
}
.history-exam-wrap h4 .material-icons { font-size: 28px; }
.history-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid rgba(21, 101, 192, 0.06);
}
.history-card-row {
    display: flex;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
}
.history-card-row:last-child { border-bottom: none; }
.history-card-label {
    font-size: 12px;
    color: #78909c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.history-card-value {
    font-size: 17px;
    font-weight: 600;
    color: #37474f;
}
.history-card-value--primary { color: #1565c0; font-size: 1.5rem; }
.history-card-value--success { color: #2e7d32; font-size: 1.5rem; }
.history-card-row .material-icons {
    font-size: 32px;
    margin-right: 4px;
}

/* User info card (fragment) - đồng bộ với giao diện mới */
#content .user-info-card {
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid rgba(21, 101, 192, 0.06);
}
#content .user-info-header {
    padding: 22px 28px;
    font-size: 1.1rem;
}
#content {
    background: linear-gradient(180deg, #f5f7fa 0%, #eef2f7 50%, #f8fafc 100%);
    min-height: 60vh;
    padding: 24px 5%;
}

@media (max-width: 768px) {
    .auth-wrap { padding: 24px 16px; }
    .auth-card .card-body { padding: 24px 20px 28px; }
    .auth-card { margin: 0 12px; }
    .register-wrap { padding: 24px 16px 36px; }
    .register-card .card-body { padding: 24px 20px 28px; }
    .register-card { margin: 0 12px; }
    .content-page-wrap { padding: 20px 12px; }
    .content-page-wrap .container { padding: 24px 20px; border-radius: 16px; }
    .home-hero { padding: 28px 12px 36px; }
    .home-hero .infoHome h2 { font-size: 1.35rem; }
    .home-cta .btn { padding: 14px 40px; font-size: 16px; min-height: 48px; }
    #content { padding: 16px 12px; }
    .history-exam-wrap { padding: 16px 12px; }
    .history-card-row { padding: 16px 20px; flex-wrap: wrap; }
    .dropdown .dropdown-menu {
        min-width: 200px;
        max-width: calc(100vw - 32px);
        right: 0;
        left: auto;
    }
    .dropdown .btn-danger {
        margin: 8px 12px !important;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   Header / Banner
   ============================================ */
.header {
    width: 100%;
    overflow: hidden;
    box-shadow: var(--md-shadow-1);
}

.header-image {
    width: 100%;
    display: block;
    object-fit: cover;
}

@media (max-width: 768px) {
    .header {
        height: 60px;
    }
    .header-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* ============================================
   Navigation Bar - Material App Bar (chỉ áp cho .navbar, không dùng #sidebar để tránh đè admin)
   ============================================ */
.navbar.navbar-expand-lg {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    background: linear-gradient(120deg, #0d47a1 0%, #1565c0 25%, #1976d2 50%, #1565c0 75%, #0d47a1 100%) !important;
    background-size: 200% 100%;
    border: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    padding: 0 16px !important;
    height: 56px !important;
    min-height: 56px;
    box-shadow: 0 4px 20px rgba(13, 71, 161, 0.35), 0 1px 0 rgba(255,255,255,0.1) inset;
    position: relative;
    z-index: 100;
    gap: 4px;
}
.navbar.navbar-expand-lg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    border-radius: inherit;
}

.navbar.navbar-expand-lg a {
    color: rgba(255,255,255,0.87) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 24px;
    transition: background 0.25s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    position: relative;
}

.navbar.navbar-expand-lg a:not(.btn-danger):hover {
    background: rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Không áp nền trắng cho link trong dropdown (ví dụ Đăng xuất .btn-danger) */
.navbar.navbar-expand-lg a:not(.btn-danger):focus,
.navbar.navbar-expand-lg a:not(.btn-danger):focus-visible {
    outline: none;
    background: rgba(255,255,255,0.25) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
    transform: translateY(-2px) scale(1.02);
}

.navbar.navbar-expand-lg a:not(.btn-danger):active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.navbar li {
    margin: 0;
    border-bottom: none;
}

.navbar li a:hover,
.navbar li a.active {
    border-bottom: none;
}

/* Nav Icons - Material Icons (thay thế ico PNG) */
.navbar .nav-icon {
    font-size: 22px !important;
    width: 22px;
    height: 22px;
    opacity: 0.95;
    vertical-align: middle;
    margin-right: 6px;
}
.navbar .nav-icon-sm {
    font-size: 20px !important;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    opacity: 0.9;
}
.dropdown-menu .nav-icon-sm {
    margin-right: 10px;
}

/* Dropdown trong navbar: luôn chữ tối, không kế thừa color white của .navbar a */
.navbar .dropdown-menu .dropdown-item,
.navbar .dropdown-menu a.dropdown-item,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item,
.navbar.navbar-expand-lg .dropdown-menu a.dropdown-item {
    color: #1a1a1a !important;
}
.navbar .dropdown-menu .dropdown-item .material-icons,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item .material-icons {
    color: #4338ca !important;
}
.navbar .dropdown-menu .dropdown-item:hover,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:hover {
    color: #4f46e5 !important;
}
.navbar .dropdown-menu .dropdown-item:hover .material-icons,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:hover .material-icons {
    color: #4f46e5 !important;
}
.navbar .dropdown-menu .dropdown-item:focus,
.navbar .dropdown-menu .dropdown-item:focus-visible,
.navbar .dropdown-menu .dropdown-item:active,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:focus,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:focus-visible,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:active {
    color: #1e1b4b !important;
}
.navbar .dropdown-menu .dropdown-item:focus .material-icons,
.navbar .dropdown-menu .dropdown-item:active .material-icons,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:focus .material-icons,
.navbar.navbar-expand-lg .dropdown-menu .dropdown-item:active .material-icons {
    color: #4338ca !important;
}

.hamburger .material-icons {
    font-size: 28px !important;
    color: white;
}

/* Legacy img icons (fallback nếu template còn dùng) */
.icon-home,
.icon-infomation,
.icon-information {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}
.icon-user {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    padding-right: 4px;
}
.icon-shut-down {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    margin-right: 4px;
}

/* ============================================
   Dropdown - Material Menu
   ============================================ */
.dropdown {
    position: absolute;
    right: 16px;
}
.dropdown-toggle {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
    border-radius: 24px !important;
    padding: 10px 14px 10px 18px !important;
    min-height: 44px;
    font-size: 15px;
    font-weight: 500;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.dropdown-toggle {
    padding-right: 28px !important;
}

.dropdown-toggle:hover {
    background: rgba(255,255,255,0.22) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dropdown-toggle:focus,
.dropdown-toggle:focus-visible {
    outline: none !important;
    background: rgba(255,255,255,0.28) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.45) !important;
    transform: translateY(-2px) scale(1.03);
}

.dropdown-toggle:active {
    transform: translateY(0) scale(0.98);
}

.dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    background-color: #ffffff;
    border: 1px solid var(--md-divider);
    border-radius: var(--md-radius);
    box-shadow: var(--md-shadow-3);
    padding: 8px 0;
    margin-top: 8px;
    min-width: 220px;
    left: auto !important;
    right: 0 !important;
    max-width: min(320px, calc(100vw - 24px));
    animation: mdMenuOpen 0.2s ease-out;
}

.dropdown-menu .dropdown-item,
.dropdown-menu .dropdown-item:link,
.dropdown-menu .dropdown-item:visited {
    color: #212121 !important;
}
/* Ghi đè Bootstrap: không bao giờ nền trắng khi focus/active */
.dropdown-menu a.dropdown-item:focus,
.dropdown-menu a.dropdown-item:focus-visible,
.dropdown-menu a.dropdown-item:active,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item:focus-visible,
.dropdown-menu .dropdown-item:active {
    background: linear-gradient(105deg, rgba(79, 70, 229, 0.22) 0%, rgba(99, 102, 241, 0.14) 50%, rgba(129, 140, 248, 0.08) 100%) !important;
    background-color: rgba(79, 70, 229, 0.15) !important;
    color: #1e1b4b !important;
}

@keyframes mdMenuOpen {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.dropdown-menu .dropdown-item {
    color: var(--md-on-surface);
    padding: 14px 20px;
    min-height: 48px;
    font-size: 15px;
    font-weight: 400;
    display: flex;
    align-items: center;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    border-radius: 0;
    border-left: 3px solid transparent;
}

.dropdown-menu .dropdown-item:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.12) 0%, transparent 100%);
    color: #4f46e5;
    padding-left: 24px;
    border-left-color: #4f46e5;
}

/* Focus/Active: hiệu ứng transient, tuyệt đối không nền trắng — chữ luôn đậm, rõ */
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item:focus-visible,
.dropdown-menu .dropdown-item:active {
    outline: none !important;
    background: linear-gradient(105deg, rgba(79, 70, 229, 0.25) 0%, rgba(99, 102, 241, 0.16) 50%, rgba(129, 140, 248, 0.1) 100%) !important;
    background-color: rgba(79, 70, 229, 0.14) !important; /* ghi đè Bootstrap, không dùng trắng */
    color: #1e1b4b !important;
    padding-left: 24px;
    border-left-color: #4f46e5;
    border-left-width: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 6px rgba(79, 70, 229, 0.15);
}
.dropdown-menu .dropdown-item:focus .material-icons,
.dropdown-menu .dropdown-item:focus-visible .material-icons,
.dropdown-menu .dropdown-item:active .material-icons {
    color: #4338ca !important;
}

.dropdown-menu .btn-danger {
    margin: 8px 16px !important;
    border-radius: 24px !important;
    font-size: 13px !important;
    padding: 8px 20px !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Đăng xuất: hover — đỏ (ghi đè .navbar a:hover nền trắng) */
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:hover {
    background: linear-gradient(135deg, #b71c1c 0%, var(--md-error) 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.45) !important;
}
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:hover .material-icons {
    color: #fff !important;
}

/* Đăng xuất: focus — đỏ opacity 0.8 (ghi đè .navbar a:focus trắng) */
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:focus,
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:focus-visible,
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:active,
.dropdown-menu .btn-danger:focus,
.dropdown-menu .btn-danger:focus-visible,
.dropdown-menu .btn-danger:active {
    outline: none !important;
    color: #fff !important;
    border-color: transparent !important;
    transform: none !important;
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.8) 0%, rgba(239, 83, 80, 0.8) 100%) !important;
    background-color: rgba(211, 47, 47, 0.8) !important;
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.4) !important;
}
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:focus .material-icons,
.navbar.navbar-expand-lg .dropdown-menu a.btn-danger:focus-visible .material-icons {
    color: #fff !important;
}

.navbar a.nodisp {
    display: none;
}

/* Menu items */
.menu-information,
.menu-information1 {
    display: flex;
    align-items: center;
}

.menu-information a,
.menu-information1 a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   Mobile Navigation
   ============================================ */
.desktop-only {
    display: none;
}

.mobile-only {
    display: none;
}

@media (min-width: 769px) {
    .desktop-only {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .navbar a.nodisp {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .mobile-navbar {
        margin-left: auto;
    }

    .hamburger {
        font-size: 28px;
        color: white;
        cursor: pointer;
        text-align: right;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: var(--md-transition);
    }

    .hamburger:hover {
        background: rgba(255,255,255,0.2);
        transform: scale(1.05);
    }
    .hamburger:focus,
    .hamburger:focus-visible {
        outline: none;
        background: rgba(255,255,255,0.25);
        box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
    }
    .hamburger:active {
        background: rgba(255,255,255,0.15);
        transform: scale(0.98);
    }

    .mobile-menu {
        display: none;
        background: #ffffff !important;
        position: absolute;
        right: 8px;
        top: 52px;
        width: 260px;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
        z-index: 9999;
        overflow: hidden;
        animation: mdMenuOpen 0.2s ease-out;
        border: 1px solid #e0e0e0;
    }

    .mobile-menu ul {
        list-style-type: none;
        margin: 0;
        padding: 12px 0;
        display: block !important;
        background: #ffffff !important;
    }

    .mobile-menu ul li {
        margin: 0;
        background: #ffffff !important;
    }

    .mobile-menu ul li a,
    .mobile-menu ul li a:link,
    .mobile-menu ul li a:visited {
        color: #1a1a1a !important;
        background: #ffffff !important;
        padding: 16px 20px !important;
        min-height: 48px;
        display: flex;
        align-items: center;
        font-size: 15px;
        font-weight: 500;
        border-radius: 0 !important;
        transition: background 0.25s ease, color 0.2s ease, padding-left 0.2s ease;
        border-left: 4px solid transparent;
    }

    .mobile-menu ul li a:hover {
        background: #eef2ff !important;
        color: #4f46e5 !important;
        padding-left: 24px !important;
        border-left-color: #6366f1 !important;
    }

    .mobile-menu ul li a:focus,
    .mobile-menu ul li a:focus-visible {
        outline: none !important;
        background: #e0e7ff !important;
        color: #4338ca !important;
        padding-left: 24px !important;
        border-left-color: #4f46e5 !important;
        box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.2);
    }

    .mobile-menu ul li a:active {
        background: #c7d2fe !important;
    }

    .mobile-menu .material-icons {
        color: #4f46e5 !important;
    }

    .mobile-menu li a:hover,
    .mobile-menu li a:focus {
        border-bottom: none;
    }

    .navbar.navbar-expand-lg {
        padding: 0 8px !important;
    }
}

/* ============================================
   Buttons - Material Design
   ============================================ */
.btn {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 24px;
    padding: 10px 28px;
    font-size: 14px;
    border: none;
    transition: var(--md-transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--md-primary-dark) 0%, var(--md-primary) 100%);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.45);
    transform: translateY(-1px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--md-error) 0%, #ef5350 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.35);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b71c1c 0%, var(--md-error) 100%);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.45);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--md-surface);
    color: var(--md-on-surface);
    border: 1px solid var(--md-divider);
    box-shadow: var(--md-shadow-1);
}

.btn-secondary:hover {
    background: #f5f5f5;
    box-shadow: var(--md-shadow-2);
    color: var(--md-on-surface);
}

.btn-accent {
    background: linear-gradient(135deg, var(--md-accent) 0%, var(--md-accent-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 109, 0, 0.35);
}

.btn-accent:hover {
    box-shadow: 0 4px 12px rgba(255, 109, 0, 0.45);
    transform: translateY(-1px);
}

/* ============================================
   Cards - Material Design
   ============================================ */
.card {
    background: var(--md-surface);
    border: none;
    border-radius: var(--md-radius-lg);
    box-shadow: var(--md-shadow-1);
    transition: var(--md-transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--md-shadow-2);
}

.card-header {
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-light) 100%);
    color: white;
    font-weight: 500;
    font-size: 18px;
    padding: 20px 24px;
    border-bottom: none;
    letter-spacing: 0.3px;
}

.card-body {
    padding: 28px 24px;
}

/* ============================================
   Forms - Material Design
   ============================================ */
.form-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--md-on-surface-medium);
    margin-bottom: 6px;
    display: block;
}

/* Input, textbox - UI bóng bẩy, hiệu ứng đẹp */
.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    min-height: 48px;
    font-size: 16px;
    line-height: 1.4;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--md-on-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) inset, 0 1px 3px rgba(0, 0, 0, 0.06);
}
.form-control:hover {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}
.form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 1px 2px rgba(0, 0, 0, 0.04) inset;
    outline: none;
    /* Không dùng shorthand background — sẽ reset background-repeat và làm icon select lặp lại */
    background-image: none;
    background-color: #ffffff;
}
.form-control::placeholder {
    color: #94a3b8;
}

.form-control.has-error {
    border-color: #dc2626;
    background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
}
.form-control.has-error:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2), 0 1px 2px rgba(0, 0, 0, 0.04) inset;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
    border-radius: 14px;
}

/* Select — padding dọc gọn; mũi tên SVG (không lặp khi .form-control:hover/:focus dùng shorthand background) */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%234f46e5' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 18px;
    padding-right: 44px;
    min-height: 40px;
    line-height: 1.4;
    background-color: transparent;
}
select.form-control:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%234338ca' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-color: #ffffff;
}
select.form-control:hover {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%234f46e5' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    background-repeat: no-repeat;
    background-position: right 14px center, 0 0;
    background-size: auto, 100% 100%;
}

.text-danger {
    color: var(--md-error) !important;
    font-size: 13px;
    margin-top: 4px;
}

.txt-has-error {
    color: var(--md-error);
}

/* ============================================
   Alerts - Material Design
   ============================================ */
.alert {
    border: none;
    border-radius: var(--md-radius);
    padding: 16px 20px;
    font-size: 14px;
    box-shadow: var(--md-shadow-1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #b71c1c;
    border-left: 4px solid var(--md-error);
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #1b5e20;
    border-left: 4px solid var(--md-success);
}

.alert-heading {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0;
}

/* ============================================
   Modal - Material Design Dialog
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
}

.modal-content {
    border: none;
    border-radius: var(--md-radius-lg);
    box-shadow: var(--md-shadow-4);
    overflow: hidden;
}

.modal-header {
    background: var(--md-surface);
    border-bottom: 1px solid var(--md-divider);
    padding: 20px 24px;
}

.modal-title {
    font-weight: 500;
    font-size: 18px;
}

.modal-body {
    padding: 24px;
    font-size: 15px;
    color: var(--md-on-surface-medium);
}

.modal-footer {
    border-top: 1px solid var(--md-divider);
    padding: 16px 24px;
}
.modal-footer .btn {
    min-height: 44px;
    padding: 10px 24px;
}

.modal .close {
    opacity: 0.6;
    font-size: 24px;
    transition: var(--md-transition);
}

.modal .close:hover {
    opacity: 1;
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 12px;
        max-width: calc(100% - 24px);
    }
    .modal-content { border-radius: 16px; }
    .modal-header, .modal-body, .modal-footer {
        padding: 16px 20px;
    }
    .modal .close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   Tables - Material Design
   ============================================ */
.table {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--md-surface);
    border-radius: var(--md-radius);
    overflow: hidden;
    box-shadow: var(--md-shadow-1);
}

.table thead {
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-light) 100%);
}

.table thead th {
    color: white;
    font-weight: 500;
    font-size: 14px;
    padding: 14px 16px;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--md-divider);
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: rgba(21, 101, 192, 0.04);
}

.table.updateUserInfo {
    border-radius: var(--md-radius);
    overflow: hidden;
}

.table.updateUserInfo th {
    background: #f8f9fa;
    color: var(--md-on-surface-medium);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--md-divider);
}

.table.updateUserInfo td {
    font-size: 14px;
}

.table.updateUserInfo .btn {
    padding: 6px 16px;
    font-size: 12px;
}

.bg-primary {
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-light) 100%) !important;
}

/* ============================================
   Footer - Luôn hiển thị cuối trang
   ============================================ */
footer {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1976d2 100%) !important;
    color: #ffffff !important;
    padding: 18px 2px !important;
    width: 100% !important;
    text-align: center;
    position: relative !important;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    margin-top: auto;
    flex-shrink: 0;
}

footer p {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    color: #ffffff !important;
}
footer p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    footer {
        padding: 22px 16px !important;
        padding-bottom: max(22px, env(safe-area-inset-bottom)) !important;
        margin-top: 32px;
    }
    footer p { font-size: 14px; }
}

/* ============================================
   Back Link - Nút quay lại (exam + đăng ký dùng chung)
   ============================================ */
.back-link {
    margin: 14px 0 0 12px;
    display: inline-block;
}

.back-link a {
    font-family: 'Be Vietnam Pro', 'Roboto', 'Segoe UI', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    min-height: 46px;
    border-radius: 14px;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    color: #1e40af;
    font-weight: 600;
    font-size: 15px;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    text-decoration: none !important;
}

.back-link a:hover,
.back-link a:active,
.back-link a:focus,
.back-link a:focus-visible,
.back-link a:visited {
    text-decoration: none !important;
}

.back-link a:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    border-color: #60a5fa;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
    transform: translateX(-2px);
}

.back-link a:focus,
.back-link a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.back-link .material-icons,
.back-link .nav-icon-sm {
    font-size: 22px;
    color: #2563eb;
}

.back-link a:hover .material-icons,
.back-link a:hover .nav-icon-sm {
    color: #1d4ed8;
}

.back-link img {
    width: 22px;
    height: 22px;
}

@media (max-width: 768px) {
    .back-link { margin: 12px 0 0 12px; }
    .back-link a { padding: 10px 18px; font-size: 14px; }
}

/* ============================================
   Home Page - Countdown Timer (Material)
   ============================================ */
.infoHome {
    font-size: inherit;
    font-family: 'Roboto', sans-serif;
    color: var(--md-on-surface);
}

/* Countdown - 4 ô ngày, giờ, phút, giây ở giữa, cách nhau 10px */
.kkv-countdown {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

.kkv-countdown ul,
.kkv-countdown ul.uk-grid {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    width: auto;
}

.kkv-countdown ul li,
.kkv-countdown .uk-grid > * {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: auto !important;
    padding-left: 0 !important;
}

.kkv-countdown-top {
    background: linear-gradient(135deg, var(--md-accent) 0%, var(--md-accent-light) 100%);
    color: white;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-height: 56px;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -2px 8px rgba(255, 109, 0, 0.3);
    box-sizing: border-box;
}
.kkv-countdown-top .uk-countdown-number,
.kkv-countdown-top [class*="uk-countdown"] {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.kkv-countdown-top:before {
    content: none;
}

.uk-countdown-number {
    font-variant-numeric: tabular-nums;
    font-size: 1.85rem;
    line-height: 1.2;
    letter-spacing: 1px;
}

.kkv-countdown-bottom {
    background: var(--md-primary-dark);
    color: rgba(255,255,255,0.95);
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    min-height: 34px;
    border-radius: 0 0 14px 14px;
    box-sizing: border-box;
}
.kkv-countdown-bottom .uk-countdown-label {
    display: block;
    text-align: center;
    line-height: 1.2;
}

.kkv-countdown-bottom:before,
.kkv-countdown-bottom:after {
    content: none;
}

@media (max-width: 576px) {
    .kkv-countdown ul,
    .kkv-countdown ul.uk-grid {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .kkv-countdown ul li {
        flex: 0 0 auto;
    }
    .kkv-countdown-top {
        width: 60px !important;
        min-height: 48px !important;
        font-size: 1.4rem !important;
        border-radius: 12px 12px 0 0;
    }
    .kkv-countdown-bottom {
        width: 60px !important;
        min-height: 30px !important;
        font-size: 0.7rem !important;
        border-radius: 0 0 12px 12px;
    }
    .uk-countdown-number { font-size: 1.4rem !important; }
}

/* UIkit grid overrides */
.uk-grid {
    margin: 0;
    padding: 0;
    list-style: none;
}

.uk-child-width-auto > * {
    width: auto;
}

[class*=uk-child-width] > * {
    box-sizing: border-box;
    width: 100%;
}

.uk-grid > * {
    padding-left: 16px;
    margin: 0;
}

.uk-text-center {
    text-align: center !important;
}

.uk-grid > * > :last-child {
    margin-bottom: 0;
}

*+.uk-grid-margin, .uk-grid+.uk-grid, .uk-grid>.uk-grid-margin {
    margin-top: 30px;
}

@media (min-width: 769px) {
    .uk-grid-stack {
        margin-left: 0;
    }
    .uk-grid > * {
        padding-left: 20px;
    }
}

@media (max-width: 768px) {
    .uk-grid-stack {
        margin-left: 0;
    }
    .uk-grid > * {
        padding-left: 8px;
    }
}

.uk-first-column {
    padding-left: 0;
}

/* ============================================
   Do Exam - Phong cách mới mẻ (Fresh style)
   ============================================ */
.do-exam-start {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: 50vh;
}
.do-exam-alert {
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}
.do-exam-card {
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    border: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}
.do-exam-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 64px -16px rgba(79, 70, 229, 0.2), 0 0 0 1px rgba(79, 70, 229, 0.06);
}
.do-exam-card-header {
    background: linear-gradient(160deg, #4f46e5 0%, #6366f1 40%, #818cf8 100%);
    padding: 40px 36px 44px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.do-exam-card-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 45%);
    pointer-events: none;
}
.do-exam-card-header::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 180px; height: 120px;
    background: rgba(255,255,255,0.06);
    border-radius: 100% 0 0 0;
    pointer-events: none;
}
.do-exam-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #c7d2fe;
    background: rgba(255,255,255,0.18);
    padding: 8px 16px;
    border-radius: 999px;
    margin-bottom: 14px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.do-exam-icon {
    font-size: 72px !important;
    display: block;
    margin-bottom: 14px;
    opacity: 1;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.2));
    transition: transform 0.35s ease;
    position: relative;
    z-index: 1;
}
.do-exam-card:hover .do-exam-icon {
    transform: scale(1.08) rotate(-3deg);
}
.do-exam-title {
    font-family: 'Be Vietnam Pro', 'Roboto', 'Segoe UI', sans-serif !important;
    color: white !important;
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}
.do-exam-card-header .do-exam-badge {
    font-family: 'Be Vietnam Pro', 'Roboto', sans-serif !important;
}
.do-exam-card-body {
    padding: 40px 36px 44px;
    text-align: center;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}
.do-exam-tips {
    background: #fff;
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 32px;
    text-align: left;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
.do-exam-tip {
    margin: 18px 0;
    color: #334155;
    font-size: 15px;
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    border-left: 4px solid #6366f1;
    transition: background 0.2s ease;
}
.do-exam-tip:first-child { margin-top: 0; }
.do-exam-tip:last-child { margin-bottom: 0; }
.do-exam-tip:hover { background: #f8fafc; }
.do-exam-tip .material-icons {
    font-size: 28px;
    flex-shrink: 0;
    padding: 10px;
    border-radius: 14px;
    margin-top: -2px;
}
.do-exam-tip--info {
    border-left-color: #4f46e5;
    background: #eef2ff;
}
.do-exam-tip--info .material-icons { color: #4338ca; background: #c7d2fe; }
.do-exam-tip--time {
    border-left-color: #d97706;
    background: #fef3c7;
}
.do-exam-tip--time .material-icons { color: #b45309; background: #fde68a; }
.do-exam-tip--check {
    border-left-color: #059669;
    background: #d1fae5;
}
.do-exam-tip--check .material-icons { color: #047857; background: #a7f3d0; }
.do-exam-ready {
    color: #64748b;
    font-size: 1.05rem;
    margin-bottom: 36px;
    font-weight: 500;
}
.do-exam-btn-start {
    padding: 20px 60px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4) !important;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border: none !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.do-exam-btn-start:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(79, 70, 229, 0.45) !important;
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
}
.do-exam-btn-start .material-icons {
    font-size: 28px;
}
.do-exam-closed {
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.1);
    padding: 60px 44px;
    text-align: center;
    border: 2px solid #fde68a;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 30%);
}
.do-exam-closed-icon {
    font-size: 80px !important;
    color: #d97706;
    display: block;
    margin-bottom: 24px;
    opacity: 0.95;
}
.do-exam-closed-text {
    color: #78350f !important;
    font-size: 1.2rem !important;
    margin: 0 !important;
    font-weight: 600;
    line-height: 1.5;
}

/* ============================================
   Exam Page - Material Design
   ============================================ */
.exam {
    padding: 24px 5%;
}

@media (min-width: 769px) {
    .exam {
        padding: 24px 12%;
    }
}

.exam h1 {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--md-primary-dark);
    margin-bottom: 8px;
}

/* Timer */
#timer {
    font-family: 'Roboto', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--md-error);
    background: #ffebee;
    padding: 8px 24px;
    border-radius: 24px;
    display: inline-block;
    min-width: 120px;
    text-align: center;
    box-shadow: var(--md-shadow-1);
    letter-spacing: 2px;
}

/* Radio custom */
.radio-custom {
    display: block;
    position: relative;
    cursor: pointer;
    font-size: 20px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.radio-custom input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: -12px;
    left: -16px;
    height: 32px;
    width: 32px;
    background-color: #e8eaf6;
    border-radius: 50%;
    transition: var(--md-transition);
    border: 2px solid transparent;
}

.radio-custom:hover input ~ .checkmark {
    background-color: #c5cae9;
    border-color: var(--md-primary-light);
}

.radio-custom input:checked ~ .checkmark {
    background-color: var(--md-primary);
    border-color: var(--md-primary);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.4);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.radio-custom input:checked ~ .checkmark:after {
    display: block;
}

.radio-custom .checkmark:after {
    top: 9px;
    left: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    border: none;
}

.title-lbl-question {
    font-size: 18px;
    font-weight: 500;
    color: var(--md-on-surface);
}

.lbl-under-text {
    color: var(--md-primary-dark);
    text-decoration: none;
    font-weight: 700;
}

/* Question Area */
.area-question {
    display: flex;
    align-items: center;
    margin-top: 12px;
    transition: var(--md-transition);
}

.choose-question {
    width: 80px;
    height: 48px;
    display: flex;
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-light) 100%);
    align-items: center;
    border: none;
    border-radius: 12px 0 0 12px;
    justify-content: center;
    box-shadow: var(--md-shadow-1);
    z-index: 2;
    flex-shrink: 0;
}

.choose-question-correct {
    width: 80px;
    height: 48px;
    display: flex;
    background: linear-gradient(135deg, var(--md-success) 0%, #66bb6a 100%);
    align-items: center;
    border: none;
    border-radius: 12px 0 0 12px;
    justify-content: center;
    box-shadow: var(--md-shadow-1);
    z-index: 2;
    flex-shrink: 0;
}

.choose-question-wrong {
    width: 80px;
    height: 48px;
    display: flex;
    background: linear-gradient(135deg, var(--md-error) 0%, #ef5350 100%);
    align-items: center;
    border: none;
    border-radius: 12px 0 0 12px;
    justify-content: center;
    box-shadow: var(--md-shadow-1);
    z-index: 2;
    flex-shrink: 0;
}

.sub-choose-question {
    margin-right: 16px;
    margin-left: -8px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.content-question {
    width: 100%;
    height: auto;
    min-height: 48px;
    margin-left: 0;
    padding: 14px 16px 14px 20px;
    border: 2px solid var(--md-divider);
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: var(--md-surface);
    box-shadow: var(--md-shadow-1);
    z-index: 1;
    display: flex;
    align-items: center;
    font-size: 15px;
    transition: var(--md-transition);
}

.content-question-correct {
    width: 100%;
    height: auto;
    min-height: 48px;
    margin-left: 0;
    padding: 14px 16px 14px 20px;
    border: 2px solid var(--md-success);
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: #e8f5e9;
    box-shadow: var(--md-shadow-1);
    z-index: 1;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #1b5e20;
    font-weight: 500;
}

.content-question-wrong {
    width: 100%;
    height: auto;
    min-height: 48px;
    margin-left: 0;
    padding: 14px 16px 14px 20px;
    border: 2px solid var(--md-error);
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: #ffebee;
    box-shadow: var(--md-shadow-1);
    z-index: 1;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #b71c1c;
    font-weight: 500;
}

/* Area question hover effect */
.area-question:hover .content-question {
    border-color: var(--md-primary-light);
    background: #f3f7ff;
}

/* Next Button */
.area-btn-next {
    margin-top: 24px;
    float: right;
}

.area-btn-next .btn {
    padding: 10px 24px;
    font-size: 14px;
}

/* Question list */
.area-lst-question {
    margin: 40px 0 0 0;
    padding: 20px;
    background: var(--md-surface);
    border-radius: var(--md-radius-lg);
    box-shadow: var(--md-shadow-1);
}

.area-lst-question .title-lbl-question {
    margin-bottom: 12px;
    display: block;
}

.area-lst-question div.area-answer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.area-lst-question div.area-btn-answer {
    width: 80px;
    text-align: center;
}

.area-lst-question button {
    width: 48px;
    height: 48px;
    margin: 4px;
    border-radius: 50% !important;
    font-weight: 500;
    font-size: 14px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--md-transition);
}

.area-lst-question button.selected {
    background: var(--md-primary) !important;
    color: white !important;
    border: none;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.4);
}

.area-lst-question button.btn-primary {
    background: var(--md-primary) !important;
    color: white !important;
}

.area-lst-question span.lbl-answer {
    margin-right: 12px;
    color: var(--md-success);
    font-size: 16px;
    font-weight: 700;
}

.area-lst-question span.lbl-answer-wrong {
    margin-right: 12px;
    color: var(--md-error);
    font-size: 16px;
    font-weight: 700;
}

/* Prediction area */
.area-txt-predict {
    margin: 24px 0 0 0;
    padding: 20px;
    background: var(--md-surface);
    border-radius: var(--md-radius-lg);
    box-shadow: var(--md-shadow-1);
}

.area-info-question {
    margin-top: 60px;
    padding: 16px 20px;
    background: #fff8e1;
    border-radius: var(--md-radius);
    border-left: 4px solid var(--md-warning);
}

.lbl-answer-correct {
    color: var(--md-success);
    font-weight: 700;
}

.lbl-answer-wrong {
    color: var(--md-error);
    font-weight: 700;
}

.area-info-question .answer-correct {
    color: var(--md-success);
    font-weight: 700;
}

/* ============================================
   Exam Start Page (doExam)
   ============================================ */
.examTitle {
    font-family: 'Roboto Slab', 'Roboto', sans-serif;
    font-size: 22px !important;
    font-weight: 500;
    color: var(--md-on-surface);
    margin-top: 24px;
}

/* ============================================
   Result Page
   ============================================ */
.result-detail {
    margin: 30px auto;
    max-width: 600px;
    padding: 28px;
    font-size: 16px;
    font-weight: 500;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    border-radius: var(--md-radius-lg);
    font-family: 'Roboto', sans-serif;
    box-shadow: var(--md-shadow-2);
    border-left: 5px solid var(--md-primary);
}

.result-detail div {
    padding: 6px 0;
    border-bottom: 1px solid rgba(21, 101, 192, 0.15);
}

.result-detail div:last-child {
    border-bottom: none;
}

.result-detail a.back-result-detail {
    color: var(--md-primary);
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.result-detail a.back-result-detail:hover {
    color: var(--md-primary-dark);
}

/* ============================================
   Info Page - Thông tin cuộc thi (banner như trang kết quả)
   ============================================ */
.info-page {
    padding-top: 24px;
    padding-bottom: 48px;
}
.info-page-header {
    text-align: center;
    padding: 36px 24px 32px;
    margin-bottom: 24px;
    background: linear-gradient(160deg, #0d9488 0%, #14b8a6 40%, #2dd4bf 100%);
    color: white;
    border-radius: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.35);
    position: relative;
    overflow: hidden;
}
.info-page-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 45%);
    pointer-events: none;
}
.info-page-header .material-icons,
.info-page-header .info-page-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.95;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
.info-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.info-page-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.92;
}
.info-page-decoration {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    border-radius: 0 0 24px 24px;
    animation: infoShine 2.5s ease-in-out infinite;
}
@keyframes infoShine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.info-page-header {
    animation: infoHeaderIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.info-page-header .info-page-icon {
    animation: resultIconBounce 0.8s ease 0.3s backwards;
}
@keyframes infoHeaderIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.info-page .container.infoExam {
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(13, 148, 136, 0.06);
    border: 1px solid rgba(13, 148, 136, 0.1);
    animation: resultContentIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}
@media (max-width: 768px) {
    .info-page-header {
        padding: 28px 20px 24px;
        border-radius: 20px;
        margin-bottom: 20px;
    }
    .info-page-header .info-page-icon { font-size: 48px; }
    .info-page-header h1 { font-size: 1.35rem; }
    .info-page-header p { font-size: 0.95rem; }
}

/* ============================================
   Result Page - Phong cách mới mẻ (Fresh)
   ============================================ */
.result-page {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #fafbff 100%);
    padding-top: 24px;
    padding-bottom: 48px;
}
.result-page-header {
    text-align: center;
    padding: 36px 24px 32px;
    margin-bottom: 24px;
    background: linear-gradient(160deg, #4f46e5 0%, #6366f1 40%, #818cf8 100%);
    color: white;
    border-radius: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}
.result-page-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.12) 0%, transparent 45%);
    pointer-events: none;
}
.result-page-header .material-icons {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.95;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
.result-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.result-page-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}
.result-page-decoration {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    border-radius: 0 0 24px 24px;
    animation: resultShine 2.5s ease-in-out infinite;
}
@keyframes resultShine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
/* Màn hình thông báo kết quả - hiệu ứng entrance */
.result-page-header {
    animation: resultHeaderIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.result-page-header .material-icons,
.result-page-header .result-trophy-icon {
    animation: resultIconBounce 0.8s ease 0.3s backwards;
}
@keyframes resultHeaderIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes resultIconBounce {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}
.result-page .container.examResult {
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.08);
    animation: resultContentIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}
@keyframes resultContentIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-page .examResult h1,
.result-page .examResult h2,
.result-page .examResult table {
    animation: resultFadeIn 0.5s ease backwards;
}
.result-page .examResult h1 { animation-delay: 0.3s; }
.result-page .examResult h2 { animation-delay: 0.4s; }
.result-page .examResult table { animation-delay: 0.5s; }
@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .result-page-header {
        padding: 28px 20px 24px;
        border-radius: 20px;
        margin-bottom: 20px;
    }
    .result-page-header .material-icons { font-size: 48px; }
    .result-page-header h1 { font-size: 1.35rem; }
    .result-page-header p { font-size: 0.95rem; }
}

/* ============================================
   Info & Result Pages
   ============================================ */
.infoExam,
.examResult,
.infoResult {
    font-size: inherit;
    font-family: 'Roboto', sans-serif;
    color: #334155;
    line-height: 1.75;
}

.infoExam table,
.examResult table {
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px;
    margin: 20px auto;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.examResult table th {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    color: #3730a3 !important;
    font-weight: 600;
    padding: 14px 18px !important;
    border-bottom: 2px solid #c7d2fe !important;
}
.examResult table td {
    padding: 12px 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
.examResult table tr:hover td {
    background: #fafbff !important;
}
.examResult h1, .examResult h2, .examResult h3 {
    color: #1e1b4b;
    font-weight: 700;
}
.examResult h1 { font-size: 1.5rem; margin-bottom: 16px; }
.examResult h2 { font-size: 1.25rem; margin: 24px 0 12px 0; }
.examResult h3 { font-size: 1.1rem; margin: 16px 0 8px 0; }
.examResult p { margin-bottom: 12px; }
.examResult a { color: #4f46e5; font-weight: 500; }
.examResult a:hover { color: #4338ca; text-decoration: underline; }

/* ============================================
   Carousel Overrides
   ============================================ */
.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%231565c0' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E");
    width: 30px;
    height: 48px;
}

.carousel-control-next-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%231565c0' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E");
    width: 30px;
    height: 48px;
}

/* ============================================
   User Info Page
   ============================================ */
.updateUserInfo {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .updateUserInfo tr td.email {
        word-break: break-all;
    }

    .updateUserInfo th,
    .updateUserInfo td {
        font-size: 13px;
        padding: 10px 8px;
    }

    .updateUserInfo .btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

.updateQuestion th, .updateQuestion td {
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   CKEditor Overrides
   ============================================ */
div.ck-editor__editable {
    min-height: 500px;
}

/* ============================================
   Responsive Container Padding
   ============================================ */
@media (min-width: 768px) {
    .container-fluid {
        padding-bottom: 160px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding-bottom: 180px;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ============================================
   Login Page Enhancement
   ============================================ */
.login-wrapper {
    min-height: 500px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
}

/* ============================================
   Register Page Enhancement
   ============================================ */
.register-hint {
    color: var(--md-primary);
    font-style: italic;
    font-size: 13px;
    margin-top: 4px;
}

/* ============================================
   Sidebar (Admin) - Layout dọc cố định
   ============================================ */
.admin-layout .sidebar,
nav.sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px !important;
    max-width: 260px !important;
    z-index: 1000;
    padding: 24px 0 80px 0 !important;
    margin: 0 !important;
    background: linear-gradient(180deg, #0d47a1 0%, #1565c0 100%) !important;
    color: #fff;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.admin-layout .sidebar .position-sticky,
nav.sidebar .position-sticky {
    flex: 1;
}

.admin-layout .sidebar .nav,
nav.sidebar .nav {
    flex-direction: column !important;
    padding: 0 12px;
}

.admin-layout .sidebar .nav-item,
nav.sidebar .nav-item {
    font-size: 14px;
    margin: 2px 0;
}

.admin-layout .sidebar a.nav-link,
nav.sidebar a.nav-link {
    color: rgba(255,255,255,0.9) !important;
    border-radius: 12px;
    padding: 12px 16px;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    border-left: 3px solid transparent;
}

.admin-layout .sidebar a.nav-link:hover,
nav.sidebar a.nav-link:hover {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
    transform: translateX(4px);
    border-left-color: rgba(255,255,255,0.5);
}

.admin-layout .sidebar a.nav-link:focus,
.admin-layout .sidebar a.nav-link:focus-visible,
nav.sidebar a.nav-link:focus,
nav.sidebar a.nav-link:focus-visible {
    outline: none !important;
    background: rgba(255,255,255,0.28) !important;
    color: white !important;
    transform: translateX(6px);
    border-left-color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.admin-layout .sidebar a.nav-link.active,
nav.sidebar a.nav-link.active {
    background: rgba(255,255,255,0.25) !important;
    color: white !important;
    font-weight: 600;
    border-left-color: white;
}

.admin-layout .sidebar .logout-btn-admin,
nav.sidebar .logout-btn-admin {
    padding: 16px 12px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.admin-layout .sidebar .logout-btn-admin .btn,
nav.sidebar .logout-btn-admin .btn {
    width: 100%;
    border-radius: 12px;
    padding: 10px 16px;
}

.admin-layout #content {
    margin-left: 260px !important;
    padding: 24px;
    min-height: 80vh;
    transition: margin-left 0.2s ease;
    min-width: 0;
}

/* Bảng admin nhiều cột: cuộn ngang trong khung (không bị cắt cột Action) */
.admin-layout .admin-table-scroll,
.admin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.admin-layout .admin-table-scroll > table,
.admin-table-scroll > table {
    width: max-content;
    max-width: none;
    margin-bottom: 1rem;
}

/* Bảng danh sách câu hỏi: max-content → có scroll ngang khi rộng hơn khung; min-width 100% khi nội dung hẹp */
.admin-layout .admin-table-scroll > table.updateQuestion,
.admin-table-scroll > table.updateQuestion {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    max-width: none;
}

.admin-table-scroll .table.updateQuestion th:nth-child(1),
.admin-table-scroll .table.updateQuestion td:nth-child(1) {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    box-sizing: border-box;
}

.admin-table-scroll .table.updateQuestion th:nth-child(2),
.admin-table-scroll .table.updateQuestion td:nth-child(2) {
    /* ~1/3 độ rộng so với 50% trước đây (≈ 16.67% bảng) */
    width: calc(50% / 3);
    max-width: calc(50% / 3);
    min-width: 0;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Danh sách câu hỏi: cột đáp án A–E 120px */
.admin-table-scroll .table.updateQuestion th:nth-child(3),
.admin-table-scroll .table.updateQuestion th:nth-child(4),
.admin-table-scroll .table.updateQuestion th:nth-child(5),
.admin-table-scroll .table.updateQuestion th:nth-child(6),
.admin-table-scroll .table.updateQuestion th:nth-child(7),
.admin-table-scroll .table.updateQuestion td:nth-child(3),
.admin-table-scroll .table.updateQuestion td:nth-child(4),
.admin-table-scroll .table.updateQuestion td:nth-child(5),
.admin-table-scroll .table.updateQuestion td:nth-child(6),
.admin-table-scroll .table.updateQuestion td:nth-child(7) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: inherit;
    line-height: inherit;
    padding: 0.5rem 0.4rem;
    vertical-align: top;
}

/* Đáp án Đúng: 30px (một ký tự A–E); tooltip đầy đủ trên th */
.admin-table-scroll .table.updateQuestion th:nth-child(8),
.admin-table-scroll .table.updateQuestion td:nth-child(8) {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    box-sizing: border-box;
    padding: 2px 1px;
    text-align: center;
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 0.75rem;
    line-height: 1.15;
    vertical-align: middle;
}

/* Action: 2% */
.admin-table-scroll .table.updateQuestion th:nth-child(9),
.admin-table-scroll .table.updateQuestion td:nth-child(9) {
    width: 2%;
    min-width: 2%;
    max-width: 2%;
    box-sizing: border-box;
    white-space: nowrap;
    vertical-align: middle;
}

/* Admin: input/textarea — padding chuẩn; select tách riêng (padding 5px + mũi tên) */
.admin-layout #content .form-control:not(select),
.admin-layout .form-control:not(select) {
    min-height: 48px !important;
    padding: 14px 18px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    border-radius: 14px;
}
.admin-layout #content select.form-control,
.admin-layout select.form-control {
    min-height: 40px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    padding-left: 18px !important;
    padding-right: 44px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    border-radius: 14px;
}
.admin-layout #content textarea.form-control,
.admin-layout textarea.form-control {
    min-height: 100px;
    padding: 14px 18px !important;
}
/* Dropdown menu trong admin (nếu có) */
.admin-layout .dropdown-menu .dropdown-item {
    min-height: 48px !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
    display: flex;
    align-items: center;
}
.admin-layout .dropdown-toggle {
    min-height: 44px !important;
    padding: 10px 18px !important;
    display: inline-flex !important;
    align-items: center !important;
}

@media (max-width: 767px) {
    .admin-layout .sidebar,
    nav.sidebar {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        position: relative !important;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px !important;
    }
    .admin-layout .sidebar .nav,
    nav.sidebar .nav {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 4px;
    }
    .admin-layout .sidebar .nav-item,
    nav.sidebar .nav-item {
        margin: 0;
    }
    .admin-layout #content {
        margin-left: 0 !important;
        padding: 16px;
    }
}

.content {
    margin-left: 260px;
    padding: 15px;
}

.logout-btn {
    position: absolute;
    right: 20px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.4s ease-out;
}

.exam,
.result {
    animation: fadeInUp 0.3s ease-out;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--md-on-surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-on-surface-medium);
}

/* ============================================
   Selection Color
   ============================================ */
::selection {
    background: rgba(21, 101, 192, 0.2);
    color: var(--md-primary-dark);
}

/* ============================================
   Cloudflare Turnstile
   ============================================ */
.cf-turnstile {
    margin: 16px 0;
}

/* ============================================
   Utility
   ============================================ */
.font-italic {
    font-style: italic;
}

.nodisp {
    display: none;
}

@media (max-width: 768px) {
    .nodisp {
        display: block !important;
    }
    .navbar a.nodisp {
        display: none;
    }

    /* doExam - responsive mobile */
    .do-exam-card-header {
        padding: 20px 16px;
    }
    .do-exam-icon {
        font-size: 48px !important;
        margin-bottom: 10px;
    }
    .do-exam-title {
        font-size: 1.15rem !important;
    }
    .do-exam-badge {
        font-size: 9px;
        padding: 6px 12px;
    }
    .do-exam-card-body {
        padding: 20px 14px 24px;
    }
    .do-exam-tips {
        padding: 14px 12px;
        border-radius: 14px;
        margin-bottom: 20px;
    }
    .do-exam-tip {
        gap: 10px;
        padding: 12px 10px;
        border-radius: 12px;
        margin: 12px 0;
        font-size: 14px;
    }
    .do-exam-tip .material-icons {
        font-size: 22px;
        padding: 7px;
        border-radius: 10px;
    }
    .do-exam-ready {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }
    .do-exam-btn-start {
        padding: 14px 36px !important;
        font-size: 1rem !important;
    }
    .do-exam-closed {
        padding: 30px 16px;
    }
    .do-exam-closed-icon {
        font-size: 48px !important;
    }
}
