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

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --success-color: #95E1D3;
    --warning-color: #FFE66D;
    --danger-color: #FF6B9D;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --child-bg: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --parent-bg: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: var(--bg-gradient);
    color: #333;
}

body.child-mode {
    background: var(--child-bg);
}

body.parent-mode {
    background: var(--parent-bg);
}

.gamification-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 999;
}

.gamification-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.stat-pill {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-pill:hover {
    transform: scale(1.05);
}

.stat-icon {
    font-size: 20px;
}

.xp-bar-container {
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    height: 25px;
    overflow: hidden;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.xp-bar-fill {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease-out;
}

.xp-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.btn-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 2rem;
    color: #667eea;
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-btn {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.language-btn:hover {
    background: #667eea;
    color: white;
}

.offline-badge {
    background: var(--warning-color);
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.welcome-card, .quiz-card, .results-card, .auth-card, .dashboard-card, .homework-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

.homework-card {
    max-width: 800px;
    margin: 0 auto;
}

.homework-card .help-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.1rem;
}

.homework-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.homework-input:focus {
    outline: none;
    border-color: #667eea;
}

.homework-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.homework-solution {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    border-left: 5px solid #667eea;
}

.homework-solution h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.homework-steps {
    margin: 20px 0;
}

.homework-step {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 3px solid #4ECDC4;
}

.final-answer {
    background: linear-gradient(135deg, #95E1D3 0%, #4ECDC4 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}

.loading-spinner {
    text-align: center;
    padding: 30px;
    font-size: 1.2rem;
    color: #667eea;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.child-mode .welcome-card h2,
.child-mode .quiz-card,
.child-mode .results-card {
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
}

.input-field, .select-field {
    width: 100%;
    padding: 15px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 150px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 3px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.3rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

.btn-help {
    background: var(--warning-color);
    color: #333;
}

.quiz-header {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: #e0e0e0;
    height: 15px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s ease;
    width: 0%;
}

.score-display {
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.question-number {
    font-size: 1rem;
    color: #888;
    margin-bottom: 15px;
}

.question {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    margin: 40px 0;
    color: #333;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-section {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.answer-input {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border: 4px solid #e0e0e0;
    border-radius: 12px;
    font-size: 2rem;
    text-align: center;
    font-weight: bold;
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
}

.feedback {
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    animation: slideDown 0.3s ease;
}

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

.feedback.correct {
    background: var(--success-color);
    color: #2d6a4f;
}

.feedback.incorrect {
    background: var(--danger-color);
    color: #7f1d1d;
}

.ai-explanation {
    background: #f0f4ff;
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #667eea;
    margin: 20px 0;
    animation: slideDown 0.3s ease;
}

.ai-explanation h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.ai-explanation ol {
    margin-left: 20px;
}

.ai-explanation li {
    margin: 10px 0;
    font-size: 1.1rem;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.results-card h2 {
    text-align: center;
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.final-score {
    text-align: center;
    margin: 40px 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.performance-message {
    font-size: 1.5rem;
    color: #555;
    margin-top: 20px;
}

.results-details h3 {
    color: #667eea;
    margin: 30px 0 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.auth-card {
    max-width: 500px;
    margin: 50px auto;
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-toggle a {
    color: #667eea;
    font-weight: bold;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.progress-chart {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .question {
        font-size: 2rem;
    }

    .answer-input {
        font-size: 1.5rem;
    }

    .welcome-card, .quiz-card, .results-card, .auth-card, .dashboard-card {
        padding: 20px;
    }

    .btn {
        width: 100%;
    }

    .quiz-nav {
        flex-direction: column;
    }
}

.dashboard-card.subscription-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.subscription-status.active {
    background: rgba(76, 217, 100, 0.3);
}

.subscription-status.expired {
    background: rgba(255, 59, 48, 0.3);
}

.subscription-status.pending {
    background: rgba(255, 204, 0, 0.3);
}

.subscription-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.subscription-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.subscription-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.subscription-details {
    margin: 15px 0;
    font-size: 0.9em;
}

.subscription-details div {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
/* Mini-jeux Section */
.minigames-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
}

.minigames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.minigame-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
    cursor: pointer;
}

.minigame-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.minigame-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.minigame-title {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.minigame-desc {
    font-size: 14px;
    color: #666;
}
