/* Yêu Hóa Học Quiz App - Premium UI / UX */
:root {
    --yhh-primary: #0ea5e9;
    --yhh-primary-dark: #0284c7;
    --yhh-primary-light: #e0f2fe;
    --yhh-secondary: #8b5cf6;
    --yhh-success: #22c55e;
    --yhh-danger: #ef4444;
    --yhh-bg: #ffffff;
    --yhh-bg-alt: #f8fafc;
    --yhh-text: #0f172a;
    --yhh-text-muted: #64748b;
    --yhh-border: #e2e8f0;
    --yhh-shadow: 0 10px 30px rgba(14, 165, 233, 0.08);
    --yhh-shadow-hover: 0 20px 40px rgba(14, 165, 233, 0.15);
    --yhh-radius: 20px;
}

#yhh-quiz-container {
    max-width: 768px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--yhh-text);
    background: var(--yhh-bg);
    border-radius: var(--yhh-radius);
    box-shadow: var(--yhh-shadow);
    overflow: hidden;
    position: relative;
    min-height: 450px;
    border: 1px solid rgba(14, 165, 233, 0.1);
}

.yhh-screen {
    display: none;
    padding: 3rem 2.5rem;
    animation: yhhFadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.yhh-screen.active {
    display: block;
}

@keyframes yhhFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.yhh-loader {
    text-align: center;
    padding: 5rem 2rem;
    font-weight: 700;
    color: var(--yhh-primary);
    font-size: 1.25rem;
    animation: yhhPulse 1.5s infinite;
}
@keyframes yhhPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Typography & Forms */
.yhh-screen h2 { 
    margin-top: 0; 
    text-align: center; 
    color: var(--yhh-text); 
    font-size: 1.75rem; 
    font-weight: 800; 
    margin-bottom: 2rem;
}

.yhh-form-group { margin-bottom: 1.75rem; }
.yhh-form-group label { 
    display: block; 
    font-weight: 700; 
    margin-bottom: 0.75rem; 
    color: var(--yhh-text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.yhh-form-group select { 
    width: 100%; 
    padding: 1rem 1.25rem; 
    border: 2px solid var(--yhh-border); 
    border-radius: 12px; 
    font-size: 1.05rem; 
    font-weight: 600;
    color: var(--yhh-text);
    background-color: var(--yhh-bg-alt);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    transition: all 0.2s;
}
.yhh-form-group select:focus {
    outline: none;
    border-color: var(--yhh-primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Buttons */
.yhh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(135deg, var(--yhh-primary), #3b82f6);
    color: #fff;
    border: none;
    padding: 1.1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}
.yhh-btn:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4); 
}
.yhh-btn:active {
    transform: translateY(1px);
}
.yhh-btn-outline {
    background: transparent;
    color: var(--yhh-primary);
    border: 2px solid var(--yhh-primary);
    box-shadow: none;
}
.yhh-btn-outline:hover {
    background: var(--yhh-primary-light);
    box-shadow: none;
}
.yhh-btn-secondary { 
    background: var(--yhh-bg-alt); 
    color: var(--yhh-text-muted);
    border: 2px solid var(--yhh-border);
    box-shadow: none;
}
.yhh-btn-secondary:hover { 
    background: #e2e8f0; 
    border-color: #cbd5e1;
    color: var(--yhh-text);
    box-shadow: none;
}

/* Quiz Header & Progress */
.yhh-progress-wrapper {
    background: var(--yhh-bg-alt);
    border-radius: 10px;
    height: 10px;
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}
.yhh-progress-fill { 
    height: 100%; 
    background: linear-gradient(90deg, var(--yhh-primary), #3b82f6); 
    width: 0%; 
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); 
    border-radius: 10px;
}
.yhh-quiz-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1.5rem; 
    font-size: 1.05rem; 
    font-weight: 700; 
    color: var(--yhh-text-muted); 
}
.yhh-timer-badge {
    background: var(--yhh-primary-light);
    color: var(--yhh-primary-dark);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Question Area */
.yhh-question-content { 
    font-size: 1.35rem; 
    font-weight: 700; 
    margin-bottom: 2.5rem; 
    line-height: 1.6; 
    color: var(--yhh-text); 
}

/* Options */
.yhh-options { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    margin-bottom: 2.5rem; 
}
.yhh-option {
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--yhh-border);
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    background: var(--yhh-bg);
}
.yhh-option:hover { 
    border-color: #bae6fd; 
    background: var(--yhh-bg-alt); 
    transform: translateX(4px);
}
.yhh-option.selected { 
    border-color: var(--yhh-primary); 
    background: var(--yhh-primary-light); 
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}
.yhh-option input { display: none; }
.yhh-option-char { 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; 
    height: 32px; 
    border: 2px solid var(--yhh-border); 
    border-radius: 50%; 
    margin-right: 1.25rem; 
    font-size: 0.9rem; 
    font-weight: 800; 
    color: var(--yhh-text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}
.yhh-option.selected .yhh-option-char { 
    background: var(--yhh-primary); 
    border-color: var(--yhh-primary); 
    color: #fff; 
}

/* Quiz Nav */
.yhh-quiz-nav { display: flex; gap: 1rem; }
.yhh-quiz-nav .yhh-btn { flex: 1; }

/* Result Screen */
.yhh-result-header { text-align: center; margin-bottom: 3rem; }
.yhh-score-circle { 
    width: 140px; 
    height: 140px; 
    border-radius: 50%; 
    background: var(--yhh-primary-light); 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 2rem; 
    position: relative;
    box-shadow: inset 0 0 0 10px var(--yhh-primary);
}
.yhh-score-val {
    font-size: 3rem; 
    font-weight: 900; 
    color: var(--yhh-primary-dark); 
    line-height: 1;
}
.yhh-score-lbl {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--yhh-primary);
    margin-top: 5px;
    text-transform: uppercase;
}

.yhh-result-stats { 
    display: flex; 
    justify-content: center; 
    gap: 3rem; 
    margin-bottom: 2rem; 
}
.yhh-stat-item { 
    text-align: center; 
    color: var(--yhh-text-muted); 
    font-size: 1rem; 
    font-weight: 600;
    padding: 1rem 2rem;
    background: var(--yhh-bg-alt);
    border-radius: 16px;
}
.yhh-stat-item.stat-correct span { color: var(--yhh-success); }
.yhh-stat-item.stat-incorrect span { color: var(--yhh-danger); }
.yhh-stat-item span { 
    display: block; 
    font-size: 2rem; 
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.yhh-review-list { margin-bottom: 3rem; }
.yhh-review-list h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: center;
}
.yhh-review-item { 
    padding: 1.5rem; 
    border: 2px solid var(--yhh-border); 
    border-radius: 16px; 
    margin-bottom: 1.25rem; 
    background: var(--yhh-bg);
}
.yhh-review-item.correct { 
    border-color: #bbf7d0; 
    background: #f0fdf4;
}
.yhh-review-item.incorrect { 
    border-color: #fecaca;
    background: #fef2f2;
}
.yhh-review-q { 
    font-weight: 700; 
    font-size: 1.15rem;
    margin-bottom: 1.25rem; 
    line-height: 1.5;
}
.yhh-review-ans { 
    font-size: 1rem; 
    margin-bottom: 0.75rem; 
    padding-left: 1rem;
    border-left: 3px solid var(--yhh-border);
}
.yhh-review-item.correct .yhh-review-ans { border-left-color: var(--yhh-success); }
.yhh-review-item.incorrect .yhh-review-ans { border-left-color: var(--yhh-danger); }

.yhh-review-exp { 
    background: #fff; 
    padding: 1.25rem; 
    border-radius: 12px; 
    font-size: 0.95rem; 
    margin-top: 1.25rem; 
    color: var(--yhh-text); 
    border: 1px solid var(--yhh-border);
    line-height: 1.6;
}
.yhh-review-exp strong {
    color: var(--yhh-primary-dark);
}

@media (max-width: 768px) {
    .yhh-screen { padding: 2rem 1.5rem; }
    .yhh-score-circle { width: 120px; height: 120px; box-shadow: inset 0 0 0 8px var(--yhh-primary); }
    .yhh-score-val { font-size: 2.5rem; }
    .yhh-result-stats { gap: 1rem; flex-direction: column; }
    .yhh-quiz-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .yhh-quiz-nav { flex-direction: column-reverse; }
}
