/* Science Quiz - Mobile-first styles */

:root {
    --color-primary: #6C5CE7;
    --color-secondary: #00CEC9;
    --color-success: #00B894;
    --color-error: #FF7675;
    --color-biologia: #55EFC4;
    --color-fisica: #74B9FF;
    --color-quimica: #FDCB6E;
    --color-astronomia: #A29BFE;
    --color-bg: #F8F9FA;
    --color-text: #2D3436;
    --color-text-light: #636E72;
    --color-white: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Screen management */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.screen.active {
    display: flex;
}

/* ==================== HOME SCREEN ==================== */

.home-header {
    text-align: center;
    padding: 2rem 0;
}

.logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-header h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* Category buttons */
.category-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-white);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    min-height: 60px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.category-btn:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.category-btn[data-category="biologia"] {
    border-left: 4px solid var(--color-biologia);
}

.category-btn[data-category="fisica"] {
    border-left: 4px solid var(--color-fisica);
}

.category-btn[data-category="quimica"] {
    border-left: 4px solid var(--color-quimica);
}

.category-btn[data-category="astronomia"] {
    border-left: 4px solid var(--color-astronomia);
}

.category-btn.category-all {
    border-left: 4px solid var(--color-primary);
    background: linear-gradient(135deg, var(--color-white) 0%, #f0f0ff 100%);
}

.category-icon {
    font-size: 1.75rem;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Home footer */
.home-footer {
    padding: 1rem 0;
    text-align: center;
}

.best-score {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.best-score strong {
    color: var(--color-primary);
}

/* ==================== QUIZ SCREEN ==================== */

.quiz-header {
    padding-bottom: 1rem;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.quiz-category {
    font-weight: 600;
    font-size: 1rem;
}

.quiz-progress {
    color: var(--color-text-light);
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.score-display {
    text-align: right;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.score-display span {
    color: var(--color-success);
    font-weight: 600;
}

/* Question */
.quiz-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.question-container {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: center;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-white);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 56px;
    text-align: left;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.option-btn:active:not(.disabled) {
    transform: scale(0.98);
}

.option-btn.disabled {
    pointer-events: none;
}

.option-btn.selected {
    border-color: var(--color-primary);
    background: rgba(108, 92, 231, 0.1);
}

.option-btn.correct {
    border-color: var(--color-success);
    background: rgba(0, 184, 148, 0.15);
}

.option-btn.incorrect {
    border-color: var(--color-error);
    background: rgba(255, 118, 117, 0.15);
}

.option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: 50%;
    font-weight: 600;
    color: var(--color-text-light);
    flex-shrink: 0;
    transition: all var(--transition);
}

.option-btn.correct .option-letter {
    background: var(--color-success);
    color: white;
}

.option-btn.incorrect .option-letter {
    background: var(--color-error);
    color: white;
}

.option-text {
    flex: 1;
}

.option-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Explanation */
.explanation-container {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CD 100%);
    border-radius: var(--radius);
    border-left: 4px solid var(--color-quimica);
    animation: slideIn 0.3s ease;
}

.explanation-container.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.explanation-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.explanation-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
}

/* Quiz footer */
.quiz-footer {
    padding: 1rem 0;
}

.btn-next {
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-next:active {
    transform: scale(0.98);
    background: #5B4BD5;
}

.btn-next.hidden {
    display: none;
}

.btn-next .arrow {
    display: inline-block;
    transition: transform var(--transition);
}

.btn-next:active .arrow {
    transform: translateX(5px);
}

/* ==================== RESULTS SCREEN ==================== */

.results-header {
    text-align: center;
    padding: 2rem 0 1rem;
}

.results-emoji {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 1s ease;
}

.results-title {
    font-size: 1.75rem;
    color: var(--color-primary);
}

.results-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, #A29BFE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
}

.score-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.score-total {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.stars {
    font-size: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.25rem;
}

.results-message {
    font-size: 1.25rem;
    color: var(--color-text-light);
    text-align: center;
}

/* Results footer */
.results-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
}

.btn-action {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    min-height: 56px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-tertiary {
    background: var(--color-bg);
    color: var(--color-text);
}

/* ==================== RESPONSIVE ==================== */

@media (min-width: 768px) {
    .screen {
        padding: 2rem;
    }

    .home-header h1 {
        font-size: 2.5rem;
    }

    .logo {
        font-size: 5rem;
    }

    .category-btn {
        padding: 1.25rem 1.5rem;
    }

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

    .option-btn {
        padding: 1.25rem;
    }

    .score-circle {
        width: 180px;
        height: 180px;
    }

    .score-number {
        font-size: 4rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
