/* Economic Trivia Mini Quiz Widget - Light Theme */
.economic-trivia-widget {
    width: 100%;
    min-height: 300px;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.economic-trivia-widget::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3360a8 0%, #4a7bc8 100%);
}

/* Header */
.trivia-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

.trivia-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.trivia-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
}

/* Question Container */
.trivia-question-container {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.trivia-question {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid #3360a8;
}

.question-text {
    font-size: 14px;
    color: #374151;
    margin: 0 0 12px 0;
    line-height: 1.4;
    font-weight: 500;
}

.question-number {
    font-size: 11px;
    color: #3360a8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Answer Section */
.trivia-answer {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.trivia-answer.show {
    opacity: 1;
    transform: translateY(0);
}

.answer-label {
    font-size: 11px;
    color: #3360a8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.answer-text {
    font-size: 13px;
    color: #92400e;
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
}

/* Controls */
.trivia-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.trivia-btn {
    background: #3360a8;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trivia-btn:hover {
    background: #2850a0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(51, 96, 168, 0.3);
}

.trivia-btn:active {
    transform: translateY(0);
}

.trivia-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-show-answer {
    flex: 1;
    max-width: 120px;
}

.btn-next {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-next:hover {
    background: #e5e7eb;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Progress Indicator */
.trivia-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: #6b7280;
}

.progress-info {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Loading State */
.trivia-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6b7280;
    font-size: 14px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3360a8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Error State */
.trivia-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #ef4444;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

/* Success/Completion State */
.trivia-complete {
    text-align: center;
    padding: 20px 0;
}

.complete-icon {
    width: 48px;
    height: 48px;
    background: #3360a8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
}

.complete-message {
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.complete-stats {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

.btn-restart {
    background: #3360a8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Responsive adjustments */
@media (max-width: 350px) {
    .economic-trivia-widget {
        width: 100%;
        padding: 16px;
    }

    .trivia-title {
        font-size: 16px;
    }

    .question-text {
        font-size: 13px;
    }

    .trivia-controls {
        flex-direction: column;
        gap: 8px;
    }

    .trivia-btn {
        width: 100%;
        max-width: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .economic-trivia-widget {
        border: 2px solid #3360a8;
    }

    .question-text {
        color: #000000;
    }

    .answer-text {
        color: #92400e;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .trivia-answer {
        transition: none;
    }

    .trivia-btn {
        transition: none;
    }

    .loading-spinner {
        animation: none;
        border: 2px solid #3360a8;
    }
}

/* Focus states for accessibility */
.trivia-btn:focus {
    outline: 2px solid #3360a8;
    outline-offset: 2px;
}

/* Hover effects */
.economic-trivia-widget:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.trivia-question:hover {
    background: #f3f4f6;
}

/* Animation for question transitions */
.question-fade-out {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.question-fade-in {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}
