/* Quiz page styles - HUD, timer, questions, answers, explanations */

/* Override menu button positioning for play page only */
mm-burger {
    position: absolute !important;
}

/* Prevent horizontal overflow on quiz page */
.container {
    overflow-x: hidden;
}

/* ========== HUD CHIPS ROW ========== */

/* HUD chips row - auto-fit based on number of chips */
.hud-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.hud-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px;
    background: rgba(30, 33, 57, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    position: relative;
    min-width: 0; /* Allow shrinking */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.hud-chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(37, 41, 69, 0.95);
}

.hud-chip:active {
    transform: scale(0.98);
    border-color: rgba(247, 147, 26, 0.4);
}

/* Score chip has subtle emphasis */
.hud-chip--score {
    border-color: rgba(247, 147, 26, 0.25);
    box-shadow: 0 0 8px rgba(247, 147, 26, 0.1);
}

/* Practice mode chip */
.hud-chip--practice {
    border-color: rgba(99, 179, 237, 0.4);
    background: rgba(99, 179, 237, 0.1);
    box-shadow: 0 0 8px rgba(99, 179, 237, 0.15);
}

.hud-chip--practice .hud-chip__value {
    color: #63b3ed;
}

.hud-chip__icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.hud-chip__value {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== TIMER/STATUS BAR ========== */

.status-bar-container {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.status-bar {
    position: relative;
    width: 100%;
    height: 26px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-bar__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #22c55e;
    transition: width 0.1s linear, background-color 2s ease;
    border-radius: 12px;
}

.status-bar__fill--warning {
    background-color: #f59e0b;
}

.status-bar__fill--danger {
    background-color: #f91616;
}

/* Practice mode - calm blue style */
.status-bar__fill--practice {
    background: linear-gradient(90deg, #63b3ed, #4299e1);
    transition: none;
}

.status-bar__text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    font-variant-numeric: tabular-nums;
}

/* Old timer styles (alternative) */
.timer-container {
    margin-bottom: 1.5rem;
}

.timer-bar {
    position: relative;
    width: 100%;
    height: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.timer-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: clip-path 0.05s linear, background 0.3s ease;
    border-radius: 0.875rem;
    clip-path: inset(0 0 0 0);
}

.timer-progress.timer-warning {
    animation: flash-red 0.5s ease-in-out infinite;
}

.timer-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.05em;
}

/* ========== TIMEOUT NOTICE ========== */

.timeout-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    animation: pulse-red-border 1s ease-in-out 2;
}

.timeout-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.timeout-content {
    flex: 1;
}

.timeout-title {
    color: #ef4444;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}

.timeout-message {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
    opacity: 0.9;
}

/* ========== CORRECT ANSWER NOTICE ========== */

.correct-answer-notice {
    padding: 1rem 1.25rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-left: 4px solid #4ade80;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.correct-answer-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.correct-answer-text {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.5;
}

/* ========== USER LEVEL CARD ========== */

.user-level-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.15) 0%, rgba(247, 147, 26, 0.05) 100%);
    border: 2px solid rgba(247, 147, 26, 0.25);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
}

.stat-column {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-column:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.user-level-label {
    font-size: 0.8125rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.user-level-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bitcoin-orange);
    line-height: 1;
    letter-spacing: -0.03em;
}

.elo-change {
    margin-top: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.elo-change-animated {
    position: fixed;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    animation: elo-float 2s ease-out forwards;
}

.elo-up {
    color: var(--success);
}

.elo-down {
    color: var(--error);
}

/* ========== QUESTION CARD ========== */

.question-card {
    margin-bottom: 1.5rem;
}

.question-difficulty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.difficulty-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    font-weight: 600;
}

.difficulty-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bitcoin-orange);
    letter-spacing: -0.02em;
}

/* Retry indicator for previously incorrect questions */
.retry-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    color: #f59e0b;
}

.retry-icon {
    font-size: 1.25rem;
    font-weight: 700;
}

.retry-text {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.question-topic {
    text-align: left;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.question-text {
    font-size: 1.375rem;
    font-weight: 500;
    margin-bottom: 1.75rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* ========== OPTIONS LIST ========== */

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.option-btn {
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 1.0625rem;
    width: 100%;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(247, 147, 26, 0.1) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.option-btn:hover:not(:disabled)::before {
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--bitcoin-orange);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.option-btn:disabled {
    cursor: not-allowed;
}

/* Submitting animation */
.submitting {
    background: rgba(247, 147, 26, 0.2) !important;
    border-color: var(--bitcoin-orange) !important;
    animation: pulse-submitting 1s ease-in-out infinite;
    position: relative;
}

.submitting::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1.5rem;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border: 3px solid rgba(247, 147, 26, 0.3);
    border-top-color: var(--bitcoin-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.option-btn.correct {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--success);
    color: var(--text-primary);
}

.option-btn.incorrect {
    background: rgba(248, 113, 113, 0.15);
    border-color: var(--error);
    color: var(--text-primary);
    animation: pulse-red 0.5s ease-in-out 2;
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* ========== EXPLANATION ========== */

.explanation {
    margin-top: 1.75rem;
    padding: 1.25rem;
    background: rgba(247, 147, 26, 0.08);
    border-left: 4px solid var(--bitcoin-orange);
    border-radius: 0.75rem;
    border: 1px solid rgba(247, 147, 26, 0.2);
    border-left: 4px solid var(--bitcoin-orange);
}

.explanation-title {
    font-weight: 700;
    color: var(--bitcoin-orange);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.explanation-text {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* ========== SOURCES ========== */

.sources-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(247, 147, 26, 0.2);
}

.sources-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sources-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sources-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.sources-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--bitcoin-orange);
    font-weight: 700;
}

.sources-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.6;
    transition: color 0.2s ease;
    word-break: break-word;
}

.sources-list a:hover {
    color: var(--bitcoin-orange);
    text-decoration: underline;
}

/* ========== COMPLETION SCREEN ========== */

.completion-screen {
    text-align: center;
    padding: 3rem 2rem;
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.completion-title {
    color: var(--bitcoin-orange);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.completion-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.completion-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ========== MILESTONE POPUP ========== */

.milestone-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
}

.milestone-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    z-index: 10002;
    animation: popIn 0.5s forwards;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
    width: 80%;
    min-width: 280px;
    max-width: 400px;
}

.milestone-popup .header {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: bold;
    color: #f59e0b;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.milestone-popup .icon {
    font-size: 4rem;
}

.milestone-popup .icon img {
    width: 15rem;
    height: 15rem;
    object-fit: contain;
}

.milestone-popup .title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.milestone-popup .description {
    color: #94a3b8;
    margin-bottom: 1rem;
}

.milestone-popup .dismiss-btn {
    background: #f59e0b;
    color: #0f172a;
    border: none;
    padding: 0.5rem 2rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.milestone-popup .dismiss-btn:hover {
    transform: scale(1.05);
}

/* ========== DAILY CHALLENGE BANNER ========== */

.daily-complete-banner {
    background: linear-gradient(90deg, #16a34a, #22c55e);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1rem;
    animation: slideDown 0.5s ease;
}

/* ========== MOBILE ========== */
@media (max-width: 500px) {
    header,
    .hud-chips,
    .status-bar-container,
    .card {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .user-level-card {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        padding: 0.30rem 0.50rem;
    }

    .stat-column:not(:last-child) {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .user-level-label {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .user-level-value {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.1875rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .completion-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .option-btn {
        padding: 1rem 1.25rem;
    }
}
