/**
 * CSS Principal - Learn2Gether
 * Fichier: public/css/style.css
 * VERSION COMPLÈTE FINALE : Mode clair/sombre + Toggle professionnel + Menu mobile + Tous vos styles
 */

/* ===================================
   VARIABLES CSS - MODE CLAIR ET SOMBRE
   =================================== */

:root {
    /* ===== MODE CLAIR (par défaut) ===== */
    /* Couleurs principales */
    --primary-color: #4A90E2;
    --primary-dark: #357ABD;
    --primary-light: #6BA3E8;
    
    /* Couleurs secondaires */
    --secondary-color: #50C878;
    --secondary-dark: #3DA862;
    --secondary-light: #6BD48E;
    
    /* Couleurs neutres MODE CLAIR */
    --text-primary: #222f3d;
    --text-secondary: #242424;
    --text-light: #95A5A6;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --border-color: #E1E8ED;
    
    /* Couleurs par niveau */
    --novice-color: #27AE60;
    --debutant-color: #3498DB;
    --intermediaire-color: #E67E22;
    --avance-color: #9B59B6;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ===== MODE SOMBRE ===== */
[data-theme="dark"] {
    /* Arrière-plans sombres DOUX (pas noir pur) */
    --bg-white: #2c2c2c !important;
    --bg-light: #3a3a3a !important;
    --bg-card: #424242 !important;
    --border-color: #555555 !important;
    
    /* Textes lisibles */
    --text-primary: #f5f5f5 !important;
    --text-secondary: #e0e0e0 !important;
    --text-light: #bbb !important;
    
    /* Ombres adaptées au mode sombre */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3) !important;
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4) !important;
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5) !important;
}

/* ===================================
   RESET ET BASE
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    overflow-x: hidden;
    transition: var(--transition);
}

/* ===================================
   TYPOGRAPHIE
   =================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===================================
   CONTENEUR
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   BOUTONS
   =================================== */

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

/* ===================================
   HEADER ET NAVIGATION
   =================================== */

.main-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo,
.logo-link {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo i,
.logo-link i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a,
.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: var(--transition);
    text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a.active,
.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.btn-connexion {
    background: var(--primary-color) !important;
    color: white !important;
    padding: 0.5rem 1.5rem !important;
}

.btn-connexion:hover {
    background: var(--primary-dark) !important;
}

/* ===== MENU HAMBURGER MOBILE ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    border-radius: 4px;
    transition: var(--transition);
}

.hamburger:hover {
    background: var(--bg-light);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* Animation hamburger → X */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===================================
   BOUTON TOGGLE THÈME PROFESSIONNEL
   =================================== */

    .theme-toggle-professional {
        display: none;
}

.theme-toggle-professional:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-dark);
}

.theme-toggle-professional:active {
    transform: translateY(0);
}

.theme-toggle-professional i {
    font-size: 16px;
    transition: all 0.3s ease;
}

/* Mode sombre - bouton vert */
[data-theme="dark"] .theme-toggle-professional {
    background: var(--secondary-color) !important;
}

[data-theme="dark"] .theme-toggle-professional:hover {
    background: var(--secondary-dark) !important;
}

/* ===================================
   SECTION HERO
   =================================== */

.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    animation: fadeInLeft 1s ease;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    text-align: center;
    animation: fadeInRight 1s ease;
}

.hero-img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.1));
}

/* ===================================
   SECTIONS
   =================================== */

.section-padding {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===================================
   FONCTIONNALITÉS
   =================================== */

.features {
    background: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
}

/* ===================================
   NIVEAUX
   =================================== */

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.level-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.level-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--level-color, var(--primary-color));
}

.level-card.novice::before { background: var(--novice-color); }
.level-card.debutant::before { background: var(--debutant-color); }
.level-card.intermediaire::before { background: var(--intermediaire-color); }
.level-card.avance::before { background: var(--avance-color); }

.level-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--level-color, var(--primary-color));
}

.level-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.level-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ===================================
   ARTICLES/BLOG
   =================================== */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.article-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.article-link {
    color: var(--primary-color);
    font-weight: 500;
}

/* ===================================
   FOOTER
   =================================== */

.main-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-primary);
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    text-align: center;
    color: var(--text-light);
}

/* ===================================
   FORCER LE MODE SOMBRE SUR TOUS LES ÉLÉMENTS
   =================================== */

[data-theme="dark"] body {
    background-color: var(--bg-white) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .main-header {
    background: var(--bg-white) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .main-footer {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-top-color: var(--border-color) !important;
}

[data-theme="dark"] .main-footer h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .main-footer p,
[data-theme="dark"] .main-footer li {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .main-footer a {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .main-footer a:hover {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .footer-content {
    border-top-color: var(--border-color) !important;
}

[data-theme="dark"] .newsletter-form input {
    background: var(--bg-white) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .nav-menu {
    background: var(--bg-white) !important;
}

[data-theme="dark"] .nav-menu a {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%) !important;
}

[data-theme="dark"] .features {
    background: var(--bg-light) !important;
}

[data-theme="dark"] .feature-card,
[data-theme="dark"] .level-card,
[data-theme="dark"] .article-card {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] p {
    color: var(--text-secondary) !important;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Classes pour les animations au scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   NOTIFICATIONS
   =================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-white);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
    z-index: 10000;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.notification-error {
    border-left-color: #e74c3c;
}

.notification.notification-success {
    border-left-color: #27ae60;
}

.notification.notification-warning {
    border-left-color: #f39c12;
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-light);
    margin-left: 10px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* ===================================
   AMÉLIORATIONS UX
   =================================== */

.loading {
    opacity: 0;
}

.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Images lazy loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* ===================================
   ACCESSIBILITÉ
   =================================== */

/* Focus visible pour la navigation clavier */
.theme-toggle-professional:focus-visible,
.hamburger:focus-visible,
.nav-menu a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Réduction de mouvement pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .theme-toggle-professional,
    .hamburger span,
    .nav-menu {
        transition: none;
    }
}

/* ===================================
   UTILITAIRES
   =================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }