/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4a90d9;
    --primary-dark: #3a7bc8;
    --secondary: #f0f4f8;
    --text-dark: #2d3748;
    --text-light: #718096;
    --success: #48bb78;
    --success-dark: #38a169;
    --error: #e53e3e;
    --error-dark: #c53030;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--secondary);
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.start-content {
    text-align: center;
    color: var(--white);
}

.start-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.start-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.start-btn {
    background: var(--white);
    color: #667eea;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-lg);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.start-btn:active {
    transform: translateY(0);
}

/* App Container */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-display {
    background: var(--success);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--white);
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Question Card */
.question-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.verb-infinitive {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.verb-translation {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.pronoun-display {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--secondary);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
}

/* Answer Section */
.answer-section {
    animation: slideIn 0.3s ease-out;
}

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

.answer-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

.answer-conjugation {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.verb-groupe {
    font-size: 1rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 20px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 140px;
}

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

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

.btn-reveal:hover {
    background: var(--primary-dark);
}

.btn-correct {
    background: var(--success);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-correct:hover {
    background: var(--success-dark);
}

.btn-wrong {
    background: var(--error);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-wrong:hover {
    background: var(--error-dark);
}

.post-reveal-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--white);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.nav-btn:hover {
    background: var(--secondary);
}

.nav-btn.active {
    background: var(--success);
    color: var(--white);
}

/* Congratulations Screen */
.congrats-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.congrats-content {
    text-align: center;
    color: var(--white);
    z-index: 10;
}

.congrats-emoji {
    font-size: 8rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease infinite;
}

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

.congrats-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.congrats-score {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.btn-restart {
    background: var(--white);
    color: #667eea;
    box-shadow: var(--shadow-lg);
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Stats Modal */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.stats-content {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.stats-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--secondary);
    color: var(--text-light);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.stats-close-btn:hover {
    background: #e2e8f0;
}

.stats-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-item {
    flex: 1;
    background: var(--secondary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stats-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.stats-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stats-graph {
    background: var(--secondary);
    border-radius: 12px;
    padding: 1rem;
}

.stats-graph h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    text-align: center;
}

.stats-graph canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive */
@media (max-width: 400px) {
    .start-title {
        font-size: 2.5rem;
    }

    .verb-infinitive {
        font-size: 2rem;
    }

    .answer-conjugation {
        font-size: 2rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-width: 120px;
    }

    .congrats-emoji {
        font-size: 6rem;
    }

    .stats-content {
        padding: 1rem;
    }

    .stats-summary {
        flex-direction: column;
    }
}
