:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header/Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.logo-text {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: 1rem;
}

.hero-description p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0.5rem 0;
}

.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Section statistiques */
.stats-section {
    padding: 2rem;
    background: var(--surface);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.stat-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

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

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

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

/* Section matières */
.subjects-section {
    flex: 1;
    padding: 3rem 2rem;
    background: var(--background);
}

.subjects-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.subject-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, var(--primary-color));
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 1;
}

.subject-card:hover::before {
    opacity: 0.05;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.subject-card * {
    position: relative;
    z-index: 2;
}

.subject-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform var(--transition);
}

.subject-card:hover .subject-icon {
    transform: scale(1.1);
}

.subject-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subject-count {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.subject-progress {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
    border-radius: 3px;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* État de chargement */
.subject-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }

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

    .subjects-section {
        padding: 2rem 1rem;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .subject-card {
        min-height: 180px;
        padding: 2rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 1.5rem 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo-text {
        font-size: 2rem;
    }

    .subject-card {
        min-height: 160px;
        padding: 1.5rem;
    }

    .subject-icon {
        font-size: 3rem;
    }

    .subject-name {
        font-size: 1.3rem;
    }
}