/**
 * PUMKIN.DEV Academic Design System - Components Stylesheet
 * Layer: 3 - Components (80/20 Quiz Player, Options, Nav Matrix, Analytics, 5 Question Types, Modals, Print)
 */

/* 80% QUESTION / 20% NAVIGATOR LAYOUT */
.player-main-layout {
    display: grid;
    grid-template-columns: calc(80% - 14px) calc(20% - 14px);
    gap: 28px;
    padding: 24px 32px 40px;
    background: #f8fafc;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* QUESTION SECTION (80% WIDTH) */
.player-question-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 48px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    min-height: 650px;
    box-sizing: border-box;
}

.question-top-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid #f1f5f9;
}

.q-meta-primary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.q-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.question-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 6px 16px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.q-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.q-type-single {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.q-type-tf {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}
.q-type-short {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.q-type-drag {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}
.q-type-step {
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.q-topic-title {
    font-size: 14.5px;
    font-weight: 600;
    color: #475569;
    line-height: 1.4;
}

.q-meta-dna-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 6px;
}

.question-flag-btn {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-flag-btn:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    transform: translateY(-1px);
}

.question-flag-btn.flagged {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.question-body-text {
    font-size: 18px;
    line-height: 1.85;
    color: #1e293b;
    margin-bottom: 30px;
    font-weight: 500;
    letter-spacing: 0.15px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
    flex-grow: 1;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 22px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.option-card:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.08);
}

.option-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 6px 16px rgba(37, 99, 235, 0.12);
}

.option-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #475569;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.option-card.selected .option-circle {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.option-text {
    font-size: 17px;
    color: #1e293b;
    line-height: 1.7;
    flex-grow: 1;
    padding-top: 3px;
}

.player-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1.5px solid #f1f5f9;
    gap: 16px;
}

.player-bottom-controls .btn {
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.player-keyboard-guide {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    font-size: 12.5px;
    color: #64748b;
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.kb-chip {
    background: #e2e8f0;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    color: #334155;
}

/* NAVIGATOR SIDEBAR & SUBMIT (20% WIDTH) */
.player-nav-sidebar {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 80px;
    height: calc(100vh - 105px);
    max-height: calc(100vh - 105px);
    box-sizing: border-box;
}

.nav-sidebar-header {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary, #1e3a8a);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #f1f5f9;
    letter-spacing: 0.3px;
}

.nav-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #f8fafc;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 11.5px;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-answered { background: var(--success, #16a34a); }
.dot-unanswered { background: #cbd5e1; }
.dot-flagged { background: var(--warning, #f59e0b); }
.dot-current { background: #2563eb; }

.nav-grid-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 16px;
}

.nav-cell-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    color: #475569;
}

.nav-cell-btn:hover {
    border-color: #2563eb;
    background: #f1f5f9;
    transform: scale(1.06);
}

.nav-cell-btn.status-answered {
    background: #ecfdf5;
    border-color: #34d399;
    color: #065f46;
}

.nav-cell-btn.status-flagged {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #92400e;
}

.nav-cell-btn.status-current {
    border: 2.5px solid #2563eb !important;
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    background: #eff6ff;
    color: #1d4ed8;
    transform: scale(1.05);
}

.sidebar-submit-btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    letter-spacing: 0.5px;
}

.sidebar-submit-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
    transform: translateY(-2px);
}

.btn-topbar-submit {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 800 !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.28) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.btn-topbar-submit:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4) !important;
}

/* DARK MODE OPTIMIZATIONS FOR 80/20 IMMERSIVE EXAM */
body.dark-mode.exam-mode-active {
    background: #0b0f19 !important;
}

body.dark-mode .exam-player-container {
    background: #0b0f19 !important;
}

body.dark-mode .exam-player-topbar {
    background: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
}

body.dark-mode .player-main-layout {
    background: #0b0f19 !important;
}

body.dark-mode .player-question-section {
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .player-nav-sidebar {
    background: #111827 !important;
    border: 1px solid #1f2937 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .nav-sidebar-header {
    border-bottom: 1.5px solid #1f2937 !important;
    color: #60a5fa !important;
}

body.dark-mode .nav-legend {
    background: #1f2937 !important;
    color: #94a3b8 !important;
}

body.dark-mode .nav-cell-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.dark-mode .nav-cell-btn:hover {
    background: #334155 !important;
    border-color: #60a5fa !important;
}

body.dark-mode .nav-cell-btn.status-answered {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

body.dark-mode .nav-cell-btn.status-flagged {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: #f59e0b !important;
    color: #fcd34d !important;
}

body.dark-mode .nav-cell-btn.status-current {
    border: 2.5px solid #60a5fa !important;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3) !important;
    background: #1e3a8a !important;
    color: #ffffff !important;
}

body.dark-mode .player-keyboard-guide {
    background: #111827 !important;
    border-color: #1f2937 !important;
    color: #94a3b8 !important;
}

body.dark-mode .kb-chip {
    background: #1f2937 !important;
    color: #e2e8f0 !important;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 992px) {
    .player-main-layout {
        grid-template-columns: 1fr !important;
        padding: 16px 16px 30px !important;
    }
    .player-question-section {
        padding: 24px 20px !important;
    }
    .player-nav-sidebar {
        height: auto !important;
        max-height: none !important;
        position: static !important;
        order: 2;
    }
    .exam-player-topbar {
        padding: 10px 16px !important;
    }
}

/* ==========================================================================
   RESULTS & REVIEW SCREEN
   ========================================================================== */
.result-header-card {
    background: #0f172a;
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.score-main-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-circle-badge {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 3px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.score-circle-badge small {
    font-size: 11px;
    opacity: 0.85;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.stat-box-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-box-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Topic Breakdown Card */
.analytics-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 22px 25px;
    margin-bottom: 30px;
}

.topic-row {
    margin-bottom: 14px;
}

.topic-row-info {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 5px;
}

.progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-bar-fill.high { background: var(--success); }
.progress-bar-fill.medium { background: var(--warning); }
.progress-bar-fill.low { background: var(--danger); }

/* Review Question Card */
.review-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.review-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.review-card.correct { border-left: 5px solid var(--success); }
.review-card.wrong { border-left: 5px solid var(--danger); }
.review-card.skipped { border-left: 5px solid #94a3b8; }

.review-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.status-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.badge-correct { background: var(--success-bg); color: var(--success); }
.badge-wrong { background: var(--danger-bg); color: var(--danger); }
.badge-skipped { background: #f1f5f9; color: #64748b; }

.explanation-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 18px;
    margin-top: 16px;
    font-size: 14px;
}

.explanation-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   EXAM GENERATOR FORM
   ========================================================================== */
.generator-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.radio-pill-card {
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
}

.radio-pill-card:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.radio-pill-card.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.checkbox-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13.5px;
    background: #ffffff;
    transition: all 0.2s;
}

.checkbox-card:hover {
    background: #f8fafc;
}

.checkbox-card input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Modal Backdrop */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 580px;
    width: 100%;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Responsive tweaks */
@media (max-width: 860px) {
    .player-main-layout {
        grid-template-columns: 1fr;
    }
    .player-nav-sidebar {
        order: 2;
    }
    .exam-player-topbar {
        padding: 10px 15px;
    }
}

/* ==========================================================================
   ADVANCED QUESTION TYPES & MOTION DESIGN EXTENSIONS (PUMKIN.DEV 2.0)
   ========================================================================== */

/* Motion Animation System */
@keyframes questionSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-question-section {
    animation: questionSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Question Type Badges */
.q-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.q-type-single {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.q-type-tf {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #f0abfc;
}

.q-type-short {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.q-type-step {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

/* Dạng 2: Đúng / Sai dạng chùm 4 ý (True / False Group) */
.tf-group-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.tf-item-card {
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tf-item-card:hover {
    border-color: #93c5fd;
    background: #fafbfc;
}

.tf-item-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.tf-item-label {
    font-weight: 800;
    color: var(--primary);
    background: #eff6ff;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 13.5px;
    flex-shrink: 0;
}

.tf-item-text {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-main);
}

.tf-buttons-group {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tf-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 72px;
    text-align: center;
    user-select: none;
}

.tf-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.tf-btn.active-true {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.tf-btn.active-false {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.tf-item-card.tf-item-answered {
    border-color: #3b82f6;
    background: #f8faff;
    border-left: 4px solid #2563eb;
}

.tf-item-status-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.2px;
}
.tf-item-status-pill.status-empty {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}
.tf-item-status-pill.status-true {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}
.tf-item-status-pill.status-false {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

/* Dạng 3: Điền đáp số ngắn (Short Answer) */
.short-answer-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 24px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    flex-grow: 1;
}

.short-answer-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.short-answer-input {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Segoe UI', monospace, sans-serif;
    padding: 12px 18px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: var(--primary);
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.short-answer-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.short-answer-helper {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.math-pad-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.math-pad-btn {
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 700;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.math-pad-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: var(--primary);
    transform: translateY(-1px);
}

/* Dạng 4: Tự luận theo bước (Step Solution) */
.step-solution-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.step-item-block {
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    border-radius: 8px;
    padding: 14px 18px;
    border-left: 4px solid var(--accent);
}

.step-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

/* Dạng 5: Kéo thả đáp án vào chỗ trống (Drag & Drop Cloze) */
.q-type-badge.q-type-drag {
    background: #fdf4ff;
    color: #a21caf;
    border: 1px solid #f0abfc;
}

.drag-drop-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.drag-text-board {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    font-size: 15px;
    line-height: 2.3;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pumkin-drop-zone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    min-height: 36px;
    padding: 2px 12px;
    margin: 0 4px;
    border: 2px dashed #94a3b8;
    background: #f8fafc;
    border-radius: 8px;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

.pumkin-drop-zone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.pumkin-drop-zone.drag-over {
    border-color: #2563eb;
    background: #dbeafe;
    transform: scale(1.03);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.pumkin-drop-zone.filled {
    border: 2px solid #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}

.drop-slot-placeholder {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.drop-slot-filled-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.drop-slot-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 800;
    margin-left: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.drop-slot-remove-btn:hover {
    background: #fca5a5;
}

/* Kho thẻ kéo thả (Pool) */
.drag-pool-wrapper {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
}

.drag-pool-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.drag-pool-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.drag-item-card {
    padding: 9px 16px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    cursor: grab;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.drag-item-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.18);
}

.drag-item-card:active {
    cursor: grabbing;
}

.drag-item-card.selected-to-place {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.drag-item-card.is-placed {
    opacity: 0.4;
    background: #e2e8f0;
    border-color: #cbd5e1;
    cursor: not-allowed;
    text-decoration: line-through;
    transform: none !important;
    box-shadow: none !important;
}

/* Dark mode additions */
body.dark-mode .drag-text-board {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
body.dark-mode .pumkin-drop-zone {
    background: #0f172a;
    border-color: #475569;
}
body.dark-mode .pumkin-drop-zone.filled {
    background: #1e3a8a;
    border-color: #60a5fa;
    color: #93c5fd;
}
body.dark-mode .drag-pool-wrapper {
    background: #0f172a;
    border-color: #334155;
}
body.dark-mode .drag-item-card {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}
body.dark-mode .drag-item-card.selected-to-place {
    background: #1e3a8a;
    border-color: #60a5fa;
    color: #93c5fd;
}
body.dark-mode .drag-item-card.is-placed {
    background: #0f172a;
    border-color: #334155;
    color: #64748b;
}

/* Keyboard guide footer in exam player */
.player-keyboard-guide {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 12.5px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.kb-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 700;
    font-size: 12px;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Watermark tinh tế đa lớp */
.pumkin-card-watermark {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    user-select: none;
}

.brand-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
}

/* Định dạng in ấn PDF (@media print) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
    }
    body::before {
        content: "PUMKIN.DEV • NỀN TẢNG KHẢO THÍ & DỮ LIỆU TOÁN HỌC CHUẨN HÓA (BẢN IN PDF)";
        display: block;
        text-align: center;
        font-weight: bold;
        font-size: 11pt;
        color: #1e3a8a;
        border-bottom: 2px solid #1e3a8a;
        padding-bottom: 6px;
        margin-bottom: 18px;
    }
    .pumkin-nav-container,
    .player-bottom-controls,
    .player-nav-sidebar,
    .player-keyboard-guide,
    .btn,
    .modal-overlay,
    .review-filter-tabs {
        display: none !important;
    }
    .wrapper {
        box-shadow: none !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    .review-card, .player-question-section {
        border: 1px solid #94a3b8 !important;
        page-break-inside: avoid;
        margin-bottom: 20px !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   NEW MODULES: AUTH, KNOWLEDGE HUB, FORMULA CHEATSHEET, QBANK, LEARNING PATH
   ========================================================================== */

/* Auth Navbar Button */
.btn-nav-auth {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-nav-auth:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Auth Modal Form */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form-group {
    margin-bottom: 16px;
}

.auth-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.auth-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.auth-alert-box {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.auth-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}
