/* ===== Quiz Intro Screen ===== */
.quiz-intro-screen {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.quiz-intro-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    position: relative;
}

.back-link {
    position: absolute;
    top: -1rem;
    left: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.quiz-intro-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.quiz-intro-content h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.quiz-intro-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.start-btn {
    margin-top: 1.5rem;
}

/* ===== Countdown Screen ===== */
.countdown-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.countdown-label {
    font-size: 1.25rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.countdown-number {
    font-size: 8rem;
    font-weight: 900;
    animation: pulse 1s ease-in-out infinite;
}

.countdown-skip {
    position: absolute;
    bottom: 4rem;
    font-size: 0.875rem;
    opacity: 0.5;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-pill);
    transition: opacity 0.2s;
    background: transparent;
    color: white;
}

.countdown-skip:hover {
    opacity: 1;
}

/* ===== Question Screen ===== */
.question-screen {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.quiz-header {
    background: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: var(--primary);
}

.quiz-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
}

.quiz-counter {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
}

.segments-progress {
    display: flex;
    gap: 3px;
    flex: 1;
    margin: 0 0.75rem;
}

.segment {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    transition: background 0.3s;
}

.segment.completed {
    background: var(--primary);
}

.segment.current {
    background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 100%);
    animation: pulse-segment 1.5s ease-in-out infinite;
}

.timer-circle {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.35rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.timer-circle.warning {
    border-top-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
    animation: gentle-pulse 1s ease-in-out infinite;
}

.question-main {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    color: var(--text);
}

.question-text strong {
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

@media (min-width: 480px) {
    .answers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.answer-btn {
    padding: 0.875rem 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.answer-btn:active {
    transform: scale(0.98);
}

.answer-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.answer-btn.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.answer-btn.wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

.answer-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.answer-letter {
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.answer-btn.selected .answer-letter,
.answer-btn:hover .answer-letter {
    background: var(--primary);
    color: white;
}

.answer-btn.correct .answer-letter {
    background: var(--success);
    color: white;
}

.answer-btn.wrong .answer-letter {
    background: var(--danger);
    color: white;
}

/* ===== Feedback Screen ===== */
.feedback-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.feedback-screen.correct {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.feedback-screen.wrong {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.feedback-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feedback-screen.correct .feedback-title {
    color: var(--success);
}

.feedback-screen.wrong .feedback-title {
    color: var(--danger);
}

.streak-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: streak-pop 0.5s ease-out;
}

.fact-box {
    background: rgba(255,255,255,0.8);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    max-width: 400px;
}

.fact-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.fact-text {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.next-btn {
    padding: 0.875rem 2.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    min-width: 200px;
    margin-top: auto;
}

.feedback-screen.correct .next-btn {
    background: var(--success);
    color: white;
}

.feedback-screen.wrong .next-btn {
    background: var(--danger);
    color: white;
}

/* ===== Results Screen ===== */
.results-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    padding: 1.5rem;
    position: relative;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

.results-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 2;
}

.results-nav-btn {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.results-nav-btn:hover {
    background: rgba(255,255,255,0.2);
}

.trophy {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
    position: relative;
    z-index: 2;
}

.results-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 2;
}

.results-message {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.score-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: conic-gradient(#22c55e 0% 80%, rgba(255,255,255,0.1) 80% 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 95px;
    height: 95px;
    background: #1e1b4b;
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 1.75rem;
    font-weight: 900;
}

.score-graph {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.375rem;
    height: 50px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.score-bar {
    width: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px 4px 0 0;
    position: relative;
}

.score-bar.current {
    background: linear-gradient(to top, #22c55e, #4ade80);
}

.score-bar-label {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.625rem;
    opacity: 0.7;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.result-stat {
    background: rgba(255,255,255,0.1);
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
}

.result-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.result-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.comparison-text {
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.review-answers-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    transition: background 0.2s;
}

.review-answers-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== Review Screen ===== */
.review-screen {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 2rem;
}

.review-header {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.review-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.review-list {
    padding: 1rem;
}

.review-item {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.review-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.review-item-header.correct {
    color: var(--success);
}

.review-item-header.wrong {
    color: var(--danger);
}

.review-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.review-answer {
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-answer.correct {
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
}

.review-answer.wrong {
    background: var(--danger-light);
    color: var(--danger);
    text-decoration: line-through;
}

.review-answer.neutral {
    background: var(--bg);
    color: var(--text-light);
}

.review-fact {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.recommendations {
    position: relative;
    z-index: 2;
}

.recommendations h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.mini-quiz-card {
    background: rgba(255,255,255,0.1);
    padding: 0.875rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.mini-quiz-card:hover {
    background: rgba(255,255,255,0.15);
}

.mini-quiz-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mini-quiz-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.mini-quiz-info p {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 320px;
    width: 100%;
    text-align: center;
    color: var(--text);
    animation: modal-in 0.3s ease-out;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-text {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
}

.modal-btn-primary {
    background: var(--primary);
    color: white;
}

.modal-btn-secondary {
    background: var(--bg);
    color: var(--text-light);
}

/* ===== Animations ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes pulse-segment {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes gentle-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
    50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes streak-pop {
    0% { transform: scale(0) rotate(-10deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
