/* ===== HEADER & NAVIGATION ===== */
.header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-sm);
    gap: var(--spacing-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-soft);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.logo-icon {
    font-size: 2.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.welcome-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.welcome-text #user-name {
    color: var(--primary-soft);
    font-weight: 700;
}

.nav {
    display: flex;
    gap: var(--spacing-xs);
}

.nav-btn {
    background: transparent;
    border: 2px solid var(--border-medium);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly */
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-btn:hover {
    background: var(--primary-soft);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.nav-btn.active {
    background: var(--primary-soft);
    color: white;
    border-color: var(--primary-soft);
}

.nav-icon {
    font-size: 1.2rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: fit-content;
    position: sticky;
    top: calc(80px + var(--spacing-md));
}

.progress-card,
.achievements-card,
.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-soft);
    border: 2px solid var(--border-light);
}

.progress-card h3,
.achievements-card h3,
.stats-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
}

.progress-item {
    margin-bottom: var(--spacing-md);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.progress-subject {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-percentage {
    color: var(--primary-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.progress-bar {
    background: var(--bg-secondary);
    height: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    margin-bottom: var(--spacing-xs);
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-soft), var(--accent-soft));
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.6s ease;
}

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

/* ===== ACHIEVEMENTS CARD ===== */
.achievement-badge.locked {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-light);
    opacity: 0.6;
}

/* ===== STATS CARD ===== */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-light);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== CONTENT AREA ===== */
.content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-soft);
    min-height: 500px;
}

.content h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-size: 1.8rem;
    text-align: center;
}

.content p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: 1.1rem;
}

/* ===== MODULE GRID ===== */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.module-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-soft);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.module-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.3rem;
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    margin-top: auto;
}

.footer p {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== BOUTONS SYSTÈME ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    min-width: 120px;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

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

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

.btn-success {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.2rem;
    min-height: 56px;
    min-width: 160px;
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
    min-height: 40px;
    min-width: 100px;
}

/* ===== INPUTS CHILD-FRIENDLY ===== */
.input-group {
    margin-bottom: var(--spacing-md);
}

.input-label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}

.input-field {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all 0.3s ease;
    min-height: 48px;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(168, 216, 234, 0.3);
}

.input-field.large {
    font-size: 1.5rem;
    padding: var(--spacing-md);
    min-height: 60px;
    text-align: center;
}

/* ===== CARTES D'EXERCICES ===== */
.exercise-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.exercise-card:hover {
    box-shadow: var(--shadow-medium);
}

.exercise-question {
    font-size: 1.4rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
    line-height: 1.4;
}

.exercise-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.option-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
}

.option-btn:hover {
    background: var(--primary-soft);
    color: white;
    transform: scale(1.05);
}

.option-btn.selected {
    background: var(--primary-soft);
    color: white;
    border-color: var(--primary-soft);
}

.option-btn.correct {
    background: var(--success-soft);
    border-color: var(--accent-soft);
    color: var(--text-primary);
}

.option-btn.incorrect {
    background: #ffe6e6;
    border-color: #ff9999;
    color: var(--text-primary);
}

/* ===== FEEDBACK ZONE ===== */
.feedback-zone {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-success {
    background: var(--success-soft);
    color: var(--text-primary);
}

.feedback-error {
    background: #ffe6e6;
    color: var(--text-primary);
}

.feedback-explanation {
    background: var(--warning-soft);
    color: var(--text-primary);
    text-align: left;
    padding: var(--spacing-md);
}

.feedback-explanation h4 {
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

/* ===== RESPONSIVE COMPONENTS ===== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        flex: 1;
        max-width: 120px;
    }

    .sidebar {
        position: static;
        margin-bottom: var(--spacing-md);
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .exercise-options {
        grid-template-columns: 1fr;
    }

    .btn-large {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .nav-btn {
        padding: var(--spacing-xs);
        font-size: 0.9rem;
    }

    .content {
        padding: var(--spacing-md);
    }

    .content h2 {
        font-size: 1.5rem;
    }

    .exercise-question {
        font-size: 1.2rem;
    }

    .option-btn {
        font-size: 1rem;
        min-height: 50px;
    }
}

/* Styles pour la progression de niveau */
.progression-message {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border-radius: var(--radius-lg);
    border: 2px solid;
}

.progression-message.level-up {
    background: linear-gradient(135deg, var(--success-soft), var(--primary-soft));
    border-color: var(--success-medium);
    color: var(--text-primary);
}

.progression-message.level-down {
    background: linear-gradient(135deg, var(--warning-soft), var(--secondary-soft));
    border-color: var(--warning-medium);
    color: var(--text-primary);
}

.progression-message.excellent {
    background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
    border-color: var(--primary-medium);
    color: var(--text-primary);
}

.progression-message.good {
    background: linear-gradient(135deg, var(--success-soft), var(--primary-light));
    border-color: var(--success-medium);
    color: var(--text-primary);
}

.progression-message.encourage {
    background: linear-gradient(135deg, var(--secondary-soft), var(--primary-light));
    border-color: var(--secondary-medium);
    color: var(--text-primary);
}

.level-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.current-level {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.level-badge {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    border: 2px solid var(--border-medium);
    box-shadow: var(--shadow-sm);
}

.level-badge.new {
    background: var(--primary-medium);
    color: white;
    border-color: var(--primary-dark);
    animation: levelUpPulse 1s ease-in-out;
}

.level-arrow {
    font-size: 1.5rem;
    color: var(--primary-medium);
    font-weight: bold;
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.next-steps {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.next-steps h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.next-steps ul {
    margin: 0;
    padding-left: 20px;
}

.next-steps li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

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

.results-actions .btn {
    min-width: 200px;
}

/* Indicateur de niveau */
.level-indicator {
    background: var(--primary-medium);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 10px;
    box-shadow: var(--shadow-sm);
}
