/* Reset e stili di base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #1e293b 75%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 18px;
    padding: 16px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

header h1 {
    text-align: center;
    color: #f1f5f9;
    margin-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.stat-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

.stat-item.correct {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-item.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
}

.stat-item span:last-child {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
}

/* Pulsante Mescola */
.shuffle-btn {
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.shuffle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
}

.shuffle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.15);
}

/* Main content */
main {
    flex: 1;
    display: flex;
    align-items: center;
}

.quiz-container {
    width: 100%;
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 20px;
    padding: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Question header */
.question-header {
    margin-bottom: 24px;
}

.question-number {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(51, 65, 85, 0.4);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Question content */
.question-content {
    margin-bottom: 28px;
}

#question-text {
    font-size: 1.05rem;
    color: #f1f5f9;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.answer-option {
    padding: 14px 18px;
    background: rgba(51, 65, 85, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    color: #e2e8f0;
}

.answer-option:hover:not(.disabled) {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.answer-option.selected {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.15);
    color: #f1f5f9;
    font-weight: 500;
}

.answer-option.correct {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.15);
    color: #f1f5f9;
}

.answer-option.incorrect {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.15);
    color: #f1f5f9;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.answer-option.selected .answer-letter,
.answer-option.correct .answer-letter,
.answer-option.incorrect .answer-letter {
    background: rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    background: rgba(59, 130, 246, 0.15);
    color: #e2e8f0;
    border: 1px solid rgba(59, 130, 246, 0.25);
    backdrop-filter: blur(10px);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
}

.nav-btn:disabled {
    background: rgba(71, 85, 105, 0.2);
    border-color: rgba(148, 163, 184, 0.15);
    color: #475569;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Footer */
footer {
    margin-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    header {
        padding: 14px 18px;
    }

    .stats {
        gap: 6px;
    }

    .stat-item {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .shuffle-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .quiz-container {
        padding: 24px;
    }

    #question-text {
        font-size: 1rem;
    }

    .answer-option {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .navigation {
        flex-direction: column;
        gap: 8px;
    }

    .nav-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    header {
        padding: 12px 16px;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }

    .stat-item {
        flex: 1;
        min-width: auto;
        padding: 4px 8px;
    }

    .shuffle-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
        flex: 0 0 auto;
        min-width: 70px;
    }

    .quiz-container {
        padding: 20px;
    }

    .answer-option {
        padding: 10px 14px;
        gap: 10px;
    }

    .answer-letter {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.quiz-container {
    animation: fadeIn 0.6s ease;
}

.answer-option {
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

.answer-option:nth-child(1) {
    animation-delay: 0.1s;
}

.answer-option:nth-child(2) {
    animation-delay: 0.15s;
}

.answer-option:nth-child(3) {
    animation-delay: 0.2s;
}

.answer-option:nth-child(4) {
    animation-delay: 0.25s;
}

/* Effetti di glow sottili */
.quiz-container:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.progress-fill {
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}
