/* ==========================================
   CSS ĐỘC LẬP CHO TRANG QUIZ.HTML
   ========================================== */
html,
body {
    width: 100%;
    max-width: 100vw;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body {
    padding-bottom: 60px !important;
}

/* ==========================================
   1. GIAO DIỆN BẢNG XẾP HẠNG & THÔNG TIN
   ========================================== */
.top-rank-alert {
    background-color: #d1fae5;
    color: #059669;
    padding: 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 20px;
    border: 2px dashed #10b981;
}

.score-time {
    font-size: 13px;
    color: #64748b;
    font-weight: normal;
}

.student-info-card {
    background: #e0f2fe;
    box-shadow: inset 6px 6px 12px #bae6fd, inset -6px -6px 12px #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: left;
    margin-bottom: 30px;
    border-left: 5px solid #39b2ee;
}

.student-info-card p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #0f172a;
}

.student-info-card small {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
    display: block;
    margin-top: 10px;
}

.leaderboard-section {
    margin-top: 30px;
    text-align: left;
}

.lb-title {
    font-size: 18px;
    font-weight: 800;
    color: #39b2ee;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
}

.lb-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 8px 8px 16px #bae6fd, -8px -8px 16px #ffffff;
    transition: transform 0.2s;
}

.lb-item:hover {
    transform: scale(1.02);
}

.lb-rank {
    font-size: 22px;
    font-weight: 800;
    width: 45px;
    color: #64748b;
    text-align: center;
}

.lb-info {
    flex: 1;
}

.lb-name {
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
}

.lb-class {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    margin-left: 5px;
}

.lb-score {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-pts {
    font-weight: 900;
    color: #ef4444;
    font-size: 18px;
}

/* Hiệu ứng đặc biệt cho Top 1, 2, 3 */
.rank-gold {
    background: linear-gradient(135deg, #fffde7 0%, #fde047 100%) !important;
    border: 2px solid #facc15 !important;
    box-shadow: 0 8px 20px rgba(250, 204, 21, 0.45) !important;
    transform: scale(1.04);
    margin-bottom: 15px;
    z-index: 3;
    position: relative;
}

.rank-gold .lb-name,
.rank-gold .score-pts {
    color: #854d0e !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.rank-gold .lb-rank {
    color: #ca8a04 !important;
    font-size: 28px !important;
    text-shadow: 1px 1px 0 #fff;
}

.rank-silver {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border: 2px solid #94a3b8 !important;
    box-shadow: 0 6px 15px rgba(148, 163, 184, 0.4) !important;
    transform: scale(1.02);
    margin-bottom: 12px;
    z-index: 2;
    position: relative;
}

.rank-silver .lb-name,
.rank-silver .score-pts {
    color: #334155 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
}

.rank-silver .lb-rank {
    color: #64748b !important;
    font-size: 25px !important;
    text-shadow: 1px 1px 0 #fff;
}

.rank-bronze {
    background: linear-gradient(135deg, #ffedd5 0%, #fdba74 100%) !important;
    border: 2px solid #f97316 !important;
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.35) !important;
    transform: scale(1.01);
    margin-bottom: 12px;
    z-index: 1;
    position: relative;
}

.rank-bronze .lb-name,
.rank-bronze .score-pts {
    color: #7c2d12 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
}

.rank-bronze .lb-rank {
    color: #c2410c !important;
    font-size: 24px !important;
    text-shadow: 1px 1px 0 #fff;
}

.rank-gold:hover {
    transform: scale(1.06);
}

.rank-silver:hover {
    transform: scale(1.04);
}

.rank-bronze:hover {
    transform: scale(1.03);
}

/* ==========================================
   2. GIAO DIỆN FORM TRẮC NGHIỆM & CÂU HỎI
   ========================================== */
.quiz-container {
    border-radius: 24px !important;
    box-shadow: 0 15px 40px rgba(18, 78, 232, 0.08) !important;
    max-width: 500px !important;
    padding: 40px 35px !important;
    margin: 8vh auto 20px auto !important;
    background-color: #ffffff;
}

.quiz-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px dashed #cbd5e1 !important;
}

.student-name-badge {
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
}

.quiz-top-bar .badge {
    background-color: #f1f5f9 !important;
    color: var(--primary-blue) !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-weight: 800 !important;
    font-size: 12px !important;
    box-shadow: none !important;
}

#quiz-content h2,
#quiz-content h1,
#quiz-content h3 {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--text-dark) !important;
    margin-bottom: 10px !important;
    text-align: center;
}

#quiz-content p {
    font-size: 14px !important;
    color: var(--text-muted) !important;
    margin-bottom: 25px !important;
    line-height: 1.5 !important;
    text-align: center;
}

#quiz-content label {
    display: block !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: var(--text-dark) !important;
    margin-bottom: 8px !important;
    margin-top: 15px !important;
    text-align: left !important;
}

#quiz-content input,
#quiz-content select {
    width: 100% !important;
    padding: 15px 20px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: var(--text-dark) !important;
    background-color: #f8fafc !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

#quiz-content input:focus,
#quiz-content select:focus {
    border-color: var(--primary-blue) !important;
    background-color: white !important;
    box-shadow: 0 0 0 4px rgba(57, 178, 238, 0.15) !important;
}

#quiz-content button {
    width: 100% !important;
    padding: 16px !important;
    background: linear-gradient(135deg, #124ee8, #39b2ee) !important;
    color: white !important;
    border: none !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 25px rgba(18, 78, 232, 0.3) !important;
    transition: all 0.3s ease !important;
    margin-top: 25px !important;
}

#quiz-content button:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 30px rgba(18, 78, 232, 0.5) !important;
}

#quiz-content button:active {
    transform: translateY(2px) !important;
    box-shadow: 0 5px 15px rgba(18, 78, 232, 0.3) !important;
}

.quiz-exit {
    margin-top: 25px !important;
}

.quiz-exit .back-link {
    color: var(--text-muted) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.quiz-exit .back-link:hover {
    color: var(--danger-red) !important;
}

/* Khu vực hiển thị câu hỏi trắc nghiệm */
.question-box {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--text-dark) !important;
    margin-bottom: 30px !important;
    line-height: 1.5 !important;
    text-align: center !important;
}

#quiz-content .option-btn {
    width: 100% !important;
    text-align: left !important;
    padding: 16px 20px !important;
    margin-bottom: 15px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    color: var(--text-dark) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#quiz-content .option-btn:hover {
    border-color: #93c5fd !important;
    background: #f0f9ff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12) !important;
}

#quiz-content .option-btn.selected {
    background: linear-gradient(135deg, #124ee8, #39b2ee) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px rgba(18, 78, 232, 0.3) !important;
}

#quiz-content button:not(.option-btn) {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

#quiz-content button:not(.option-btn):hover {
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4) !important;
}

/* ==========================================
   3. PHẢN HỒI MÀN HÌNH NHỎ (MOBILE)
   ========================================== */
@media (max-width: 480px) {
    .quiz-container {
        padding: 20px 15px !important;
        margin-top: 4vh !important;
    }

    .question-box {
        font-size: 16px !important;
        margin-bottom: 20px !important;
    }

    #quiz-content .option-btn {
        font-size: 13px !important;
        padding: 12px 15px !important;
        margin-bottom: 10px !important;
        line-height: 1.4 !important;
    }

    #quiz-content button:not(.option-btn) {
        font-size: 14px !important;
        padding: 14px !important;
        margin-top: 15px !important;
    }

    #quiz-content h2,
    #quiz-content h1,
    #quiz-content h3 {
        font-size: 18px !important;
    }
}