:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #60a5fa;
    
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Navigation */
.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
 

/* Dark Mode Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.theme-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--border-color);
    border-radius: 13px;
    transition: var(--transition);
}

.theme-switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-switch {
    background-color: var(--primary-color);
}

[data-theme="dark"] .theme-switch-slider {
    transform: translateX(24px);
}

.theme-icon {
    font-size: 1.25rem;
}   gap: 1rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-user {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

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

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

.btn-secondary:hover {
    background-color: #475569;
}

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

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.btn-success:hover {
    background-color: #059669;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: var(--error-color);
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Sections */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

/* Features Grid */
.features {
    padding: 2rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* Topics Grid */
.topics {
    padding: 2rem 0;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.topic-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.topic-card:hover {
    border-color: var(--primary-color);
}

.topic-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.topic-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* CTA Section */
.cta {
    text-align: center;
    padding: 3rem 0;
    margin: 3rem 0;
}

.cta h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 0;
}

.auth-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Dashboard */
.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Courses Grid */
.courses-section {
    margin-bottom: 3rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.course-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.course-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.course-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.course-difficulty.débutant {
    background-color: #d1fae5;
    color: #065f46;
}

.course-difficulty.intermédiaire {
    background-color: #fef3c7;
    color: #92400e;
}

.course-difficulty.avancé {
    background-color: #fee2e2;
    color: #991b1b;
}

.course-category {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.course-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.course-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.course-progress {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.progress-status {
    color: var(--text-secondary);
}

.progress-status.completed {
    color: var(--success-color);
    font-weight: 600;
}

.progress-score {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Course View */
.course-view {
    max-width: 900px;
    margin: 0 auto;
}

.course-breadcrumb {
    margin-bottom: 2rem;
}

.course-breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.course-header-full {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.course-header-full h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.content-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.content-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.course-body {
    line-height: 1.8;
}

.course-body h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.course-body h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.course-body ul, .course-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.course-body li {
    margin-bottom: 0.5rem;
}

.course-body pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.course-body code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Exercises */
.exercises-section {
    margin-top: 3rem;
}

.exercises-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.exercises-intro {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.exercise-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.exercise-number {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.exercise-question {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.option-label:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.option-label input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

.option-text {
    flex: 1;
}

.exercise-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.exercise-result.correct {
    background-color: #d1fae5;
    border: 1px solid var(--success-color);
}

.exercise-result.incorrect {
    background-color: #fee2e2;
    border: 1px solid var(--error-color);
}

.result-message {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-message.correct {
    color: var(--success-color);
}

.result-message.incorrect {
    color: var(--error-color);
}

.result-explanation {
    color: var(--text-primary);
}

.btn-submit-exercise {
    margin-top: 1rem;
}

.exercises-summary {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-top: 2rem;
}

.summary-text {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid, .topics-grid {
        grid-template-columns: 1fr;
    }
}
