/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --light-bg: #f9fafb;
    --dark-bg: #111827;
    
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Dégradés bleu à violet */
    --gradient-hero: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-contact: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

* {
    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-dark);
    background-color: #ffffff;
}

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

/* Header et Navigation */
header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero Section avec dégradé bleu à violet */
.hero {
    background: var(--gradient-hero);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-decoration: none;
}

.btn:hover,
.btn:focus,
.btn:active {
    text-decoration: none;
}

.btn-primary,
.btn-secondary {
    color: white !important;
}

.btn-primary:hover,
.btn-secondary:hover {
    color: white !important;
}

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

.btn-primary:hover {
    background-color: #f8fafc;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--primary-color) !important;
    text-decoration: none;
}

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

.btn-danger:hover {
    opacity: 0.9;
    color: white !important;
}

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

.btn-warning:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Grille de cours */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.course-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

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

.course-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.course-category.html { background-color: #fee2e2; color: #991b1b; }
.course-category.css { background-color: #dbeafe; color: #1e40af; }
.course-category.javascript { background-color: #fef3c7; color: #92400e; }
.course-category.python { background-color: #dbeafe; color: #1e3a8a; }
.course-category.poo { background-color: #fce7f3; color: #9f1239; }
.course-category.react { background-color: #dbeafe; color: #0c4a6e; }
.course-category.seo { background-color: #d1fae5; color: #065f46; }
.course-category.algorithme { background-color: #f3e8ff; color: #6b21a8; }
.course-category.full-stack { background-color: #ede9fe; color: #5b21b6; }

.difficulty-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty-badge.débutant { background-color: #d1fae5; color: #065f46; }
.difficulty-badge.intermédiaire { background-color: #fef3c7; color: #92400e; }
.difficulty-badge.avancé { background-color: #fee2e2; color: #991b1b; }

.course-card h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.course-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.progress-bar {
    background-color: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

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

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

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

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

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Alertes */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Contact avec dégradé bleu à violet */
.contact-info {
    background: var(--gradient-contact);
    padding: 3rem;
    border-radius: 1rem;
    color: white;
    box-shadow: 0 10px 30px rgba(123, 58, 237, 0.3);
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.75rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    font-size: 1.5rem;
    min-width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.contact-item-content h4 {
    margin-bottom: 0.5rem;
    color: white;
    font-size: 1.1rem;
}

.contact-item-content p,
.contact-item-content a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.contact-item-content a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer p {
    margin-bottom: 1rem;
}

footer a {
    color: var(--secondary-color);
}

footer a:hover {
    text-decoration: underline;
}

/* Buy Me a Coffee Button */
.bmc-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #FFDD00 0%, #FFC800 100%);
    color: #000000;
    border-radius: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 221, 0, 0.3);
    border: 2px solid #FFDD00;
    font-size: 1rem;
}

.bmc-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 221, 0, 0.5);
    color: #000000;
    text-decoration: none;
}

.bmc-icon {
    font-size: 1.3rem;
    animation: coffeeFloat 2s ease-in-out infinite;
}

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

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

/* Leçon */
.lesson-content {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 2rem auto;
}

.lesson-content h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.lesson-content h3 {
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.lesson-content ul, .lesson-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.lesson-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.lesson-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.lesson-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-light);
}

/* Badges */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.badge-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.badge-card h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.badge-date {
    font-size: 0.875rem;
    color: #78350f;
}

/* Admin */
.admin-table {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 2rem 0;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--light-bg);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table tr:hover {
    background: var(--light-bg);
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        display: none;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .lesson-content {
        padding: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 1rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Utilitaires */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
