/* ===== VARIÁVEIS CSS ===== */
:root {
    --primary-color: #58cc02;
    --primary-dark: #46a302;
    --secondary-color: #1cb0f6;
    --correct-color: #58cc02;
    --wrong-color: #ff4b4b;
    --background-color: #131f24;
    --card-background: #1a2c35;
    --text-primary: #ffffff;
    --text-secondary: #afafaf;
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

html {
    font-size: 14px;
    background-color: var(--background-color);
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, var(--card-background) 0%, #243b4a 100%) !important;
    border-bottom: 2px solid var(--primary-color) !important;
    padding: 0.8rem 1rem;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.3rem;
}

.nav-link {
    color: var(--text-primary) !important;
    transition: color var(--transition-speed);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 800px;
    padding: 1rem;
}

/* ===== HOME PAGE - START TEST ===== */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.home-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.home-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.mascot-container {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    animation: bounce 2s infinite;
}

.mascot-emoji {
    font-size: 120px;
    display: block;
}

/* ===== BOTÃO START TEST ===== */
.btn-start {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 18px 60px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 0 var(--primary-dark), 0 8px 15px rgba(0,0,0,0.3);
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
    top: 0;
}

.btn-start:hover {
    background: linear-gradient(180deg, #6ad812 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 var(--primary-dark), 0 12px 20px rgba(0,0,0,0.4);
}

.btn-start:active {
    top: 4px;
    box-shadow: 0 2px 0 var(--primary-dark), 0 4px 10px rgba(0,0,0,0.3);
}

/* ===== SETTINGS PANEL ===== */
.settings-panel {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid #2d4a5c;
    width: 100%;
    max-width: 500px;
}

.settings-title {
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.option-card {
    background: #243b4a;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-speed);
}

.option-card:hover {
    border-color: var(--secondary-color);
    transform: scale(1.02);
}

.option-card.selected {
    border-color: var(--primary-color);
    background: #2d4a5c;
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.option-card label {
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
}

/* ===== QUIZ CONTAINER ===== */
.quiz-container {
    animation: fadeInUp 0.5s ease-out;
}

/* ===== SCORE COUNTER ===== */
.score-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border: 2px solid #2d4a5c;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.score-correct {
    color: var(--correct-color);
}

.score-wrong {
    color: var(--wrong-color);
}

.score-percentage {
    color: var(--secondary-color);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #2d4a5c;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

/* ===== QUESTION CARD ===== */
.question-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 2px solid #2d4a5c;
}

.question-number {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
}

/* ===== ANSWER OPTIONS ===== */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.answer-option {
    background: #243b4a;
    border: 3px solid #3d5a6c;
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.answer-option:hover:not(.disabled) {
    border-color: var(--secondary-color);
    transform: scale(1.02);
    background: #2d4a5c;
}

.answer-option.selected {
    border-color: var(--secondary-color);
    background: #2d4a5c;
}

.answer-option.correct {
    border-color: var(--correct-color) !important;
    background: rgba(88, 204, 2, 0.2) !important;
    animation: correctPulse 0.6s ease-out;
}

.answer-option.wrong {
    border-color: var(--wrong-color) !important;
    background: rgba(255, 75, 75, 0.2) !important;
    animation: wrongShake 0.5s ease-out;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.answer-letter {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a2c35;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
    border: 2px solid #3d5a6c;
}

.answer-option.correct .answer-letter {
    background: var(--correct-color);
    border-color: var(--correct-color);
}

.answer-option.wrong .answer-letter {
    background: var(--wrong-color);
    border-color: var(--wrong-color);
}

.answer-text {
    font-size: 1rem;
    flex-grow: 1;
}

/* ===== BUTTONS ===== */
.btn-answer {
    background: linear-gradient(180deg, var(--secondary-color) 0%, #0a9bd6 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 40px;
    text-transform: uppercase;
    box-shadow: 0 5px 0 #0a8ac2, 0 8px 15px rgba(0,0,0,0.3);
    transition: all 0.15s ease;
    cursor: pointer;
    margin-top: 1.5rem;
    width: 100%;
}

.btn-answer:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #0a8ac2, 0 10px 20px rgba(0,0,0,0.4);
}

.btn-answer:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #0a8ac2;
}

.btn-answer:disabled {
    background: #3d5a6c;
    box-shadow: 0 5px 0 #2d4a5c;
    cursor: not-allowed;
}

.btn-next {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 5px 0 var(--primary-dark), 0 8px 15px rgba(0,0,0,0.3);
}

.btn-next:hover {
    box-shadow: 0 7px 0 var(--primary-dark), 0 10px 20px rgba(0,0,0,0.4);
}

/* ===== FEEDBACK CONTAINER ===== */
.feedback-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.feedback-correct {
    background: linear-gradient(135deg, rgba(88, 204, 2, 0.2), rgba(88, 204, 2, 0.1));
    border: 2px solid var(--correct-color);
    animation: slideUp 0.4s ease-out;
}

.feedback-wrong {
    background: linear-gradient(135deg, rgba(255, 75, 75, 0.2), rgba(255, 75, 75, 0.1));
    border: 2px solid var(--wrong-color);
}

.feedback-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feedback-correct .feedback-title {
    color: var(--correct-color);
}

.feedback-wrong .feedback-title {
    color: var(--wrong-color);
}

.feedback-icon {
    font-size: 2rem;
}

.feedback-explanation {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

.feedback-explanation strong {
    color: var(--text-primary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-10px);
    }
    40% {
        transform: translateX(10px);
    }
    60% {
        transform: translateX(-10px);
    }
    80% {
        transform: translateX(10px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ===== CELEBRATION ===== */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    --initial-rotation: 0deg;
    animation: confettiFall 3s linear forwards;
    will-change: transform, opacity;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(var(--initial-rotation, 0deg));
        opacity: 1;
    }
        100% {
            transform: translateY(100vh) rotate(calc(var(--initial-rotation, 0deg) + 720deg));
            opacity: 0;
        }
    }

    /* ===== WRONG ANSWER SHAKE ANIMATION ===== */
    .shake-animation {
        animation: screenShake 0.5s ease-out forwards;
    }

    @keyframes screenShake {
        0%, 100% {
            transform: translateX(0);
        }
        10% {
            transform: translateX(-15px);
        }
        20% {
            transform: translateX(15px);
        }
        30% {
            transform: translateX(-12px);
        }
        40% {
            transform: translateX(12px);
        }
        50% {
            transform: translateX(-8px);
        }
        60% {
            transform: translateX(8px);
        }
        70% {
            transform: translateX(-4px);
        }
        80% {
            transform: translateX(4px);
        }
        90% {
            transform: translateX(-2px);
        }
    }

    .shake-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        z-index: 999;
        background: transparent;
    }

    .shake-overlay.shake-flash {
        animation: redFlash 0.5s ease-out forwards;
    }

    @keyframes redFlash {
        0% {
            background: rgba(255, 75, 75, 0.4);
        }
        100% {
            background: transparent;
        }
    }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 576px) {
    .home-title {
        font-size: 1.8rem;
    }
    
    .home-subtitle {
        font-size: 1rem;
    }
    
    .mascot-emoji {
        font-size: 80px;
    }
    
    .btn-start {
        padding: 14px 40px;
        font-size: 1.1rem;
    }
    
    .settings-panel {
        padding: 1.2rem;
    }
    
    .question-card {
        padding: 1.2rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .answer-option {
        padding: 1rem;
    }
    
    .answer-letter {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .score-container {
        padding: 0.8rem;
    }
    
    .score-value {
        font-size: 1.4rem;
    }
    
    .btn-answer {
        padding: 14px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 375px) {
    .home-title {
        font-size: 1.5rem;
    }
    
    .answer-text {
        font-size: 0.9rem;
    }
    
    .score-item {
        min-width: 60px;
    }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Focus states */
.btn:focus,
.answer-option:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}