/* styles.css - Réorganisé et Nettoyé */

/* -------------------------------------------------------------------------- */
/* Variables CSS Globales                                                     */
/* -------------------------------------------------------------------------- */
:root {
    --primary: #1E3A8A; /* Bleu profond pour les boutons et liens actifs */
    --secondary: #4A5A7D; /* Gris-bleu neutre pour les cartes et section héros en mode sombre */
    --secondary-light: #A3BFFA; /* Gris-bleu clair pour la section héros en mode clair */
    --background-dark: #0F1419; /* Fond en mode sombre (noir presque pur) */
    --background-light: #F5F7FA; /* Fond en mode clair */
    --text-dark: #E5E7EB; /* Texte en mode sombre */
    --text-light: #111827; /* Texte en mode clair */
    --accent: #3B82F6; /* Bleu clair pour les survols */
    --border-dark: #2D3748; /* Bordure en mode sombre */
    --border-light: #D1D5DB; /* Bordure en mode clair */
    --chart-grid-color: rgba(255, 255, 255, 0.3); /* Couleur de grille pour le mode sombre */
    --chart-tick-backdrop-color: rgba(45, 55, 72, 0.8); /* Fond des étiquettes pour le mode sombre */
}

/* -------------------------------------------------------------------------- */
/* Styles Globaux de Base                                                     */
/* -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
    margin: 0;
}

.font-poppins {
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--background-dark);
    color: var(--text-dark);
    padding-top: 70px; /* Ajuste selon la hauteur réelle de ta navbar */
    margin: 0;
    min-height: 100vh;
    overflow-y: auto; /* Permet le scroll vertical si le contenu dépasse */
}

body.light-mode {
    background-color: var(--background-light) !important;
    color: var(--text-light) !important;
    --chart-grid-color: rgba(15, 20, 25, 0.3); /* Couleur de grille pour le mode clair */
    --chart-tick-backdrop-color: rgba(226, 232, 240, 0.9); /* Fond des étiquettes pour le mode clair */
}

/* Masquer le contenu pendant le chargement */
body.loading {
    overflow: hidden; /* Empêche le scroll pendant le chargement */
}

body.loading > *:not(#preloader) {
    visibility: hidden;
}

/* Styles généraux pour les icônes Bootstrap */
.bi {
    font-size: 1.2rem;
    vertical-align: middle;
}

body.light-mode .bi { /* Assure que les icônes par défaut suivent le thème texte */
    color: var(--text-light) !important;
}
/* Les .bi spécifiques (ex: stats-section) peuvent surcharger cette règle */

/* -------------------------------------------------------------------------- */
/* Styles Globaux de Base (ou section dédiée à la typographie)                */
/* -------------------------------------------------------------------------- */

/* ... (autres styles globaux comme body, .font-poppins, etc.) ... */

.text-muted { /* Mode sombre par défaut (body) */
    color: #adb5bd !important; 
}

body.light-mode .text-muted { /* Mode clair (body.light-mode) */
    color: #6c757d !important; 
}

/* -------------------------------------------------------------------------- */
/* Styles des Liens Généraux (Corrigés)                                       */
/* -------------------------------------------------------------------------- */
a {
    color: var(--text-dark);
    text-decoration-color: var(--text-dark);
    transition: color 0.2s ease-in-out, text-decoration-color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

body.light-mode a {
    color: var(--text-light) !important; /* Correction: Utiliser la couleur primaire */
    text-decoration-color: var(--primary) !important;
}

body.light-mode a:hover {
    color: var(--text-light) !important;
    text-decoration-color: var(--accent) !important;
}

/* Spécificité pour les liens dans des contextes textuels en mode clair */
body.light-mode .card-text a,
body.light-mode p a,
body.light-mode li a,
body.light-mode .project-details a, /* Pour alternance.html */
body.light-mode .timeline-content a, /* Pour les liens dans les cartes de la timeline */
body.light-mode .modal-body a { /* Pour les liens dans les modales */
    color: var(--text-light) !important;
    text-decoration-color: var(--text-light) !important;
}
body.light-mode .card-text a:hover,
body.light-mode p a:hover,
body.light-mode li a:hover,
body.light-mode .project-details a:hover,
body.light-mode .timeline-content a:hover,
body.light-mode .modal-body a:hover {
    color: var(--text-light) !important;
    text-decoration-color: var(--accent) !important;
}


/* -------------------------------------------------------------------------- */
/* Header et Barre de Navigation                                              */
/* -------------------------------------------------------------------------- */
header { /* Conteneur pour la navbar chargée dynamiquement */
    position: static; 
}

/* Styles pour la navbar-custom */
.navbar-custom.navbar-expand-md {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--background-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.navbar-custom.navbar-expand-md.scrolled {
    padding: 0.3rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: rgba(15, 20, 25, 0.95); /* Légère transparence */
}

.navbar-brand {
    color: var(--text-dark) !important;
    margin-left: 0%; 
}

.navbar-custom .nav-link,
.navbar-custom .dropdown-toggle {
    padding: 0.5rem 1rem;
    color: var(--text-dark);
}

.navbar-custom .nav-link:hover,
.navbar-custom .dropdown-toggle:hover {
    color: var(--accent);
}

.navbar-custom .nav-link.active,
.navbar-custom .dropdown-toggle.active {
    color: var(--primary);
    font-weight: bold;
}

.navbar-custom .nav-item.dropdown.show .dropdown-toggle {     /* Utilise une couleur de fond subtile basée sur ta variable --accent. rgba(59, 130, 246, X) correspond à la couleur de --accent (#3B82F6) avec une opacité. */
    background-color: rgba(59, 130, 246, 0.1); /* Pour le thème sombre */
    border-radius: 0.25rem;
}

body.light-mode .navbar-custom .nav-item.dropdown.show .dropdown-toggle {
    background-color: rgba(59, 130, 246, 0.15); /* Légèrement plus opaque ou différent pour le thème clair */
}

/* Navbar en mode clair */
body.light-mode .navbar-custom.navbar-expand-md {
    background-color: var(--background-light) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Ombre plus discrète en mode clair */
}
body.light-mode .navbar-custom.navbar-expand-md.scrolled {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: rgba(245, 247, 250, 0.95)!important; 
}
body.light-mode .navbar-brand {
    color: var(--text-light) !important;
}
body.light-mode .navbar-custom .nav-link,
body.light-mode .navbar-custom .dropdown-toggle {
    color: var(--text-light) !important;
}
body.light-mode .navbar-custom .nav-link:hover,
body.light-mode .navbar-custom .dropdown-toggle:hover {
    color: var(--accent) !important;
}
body.light-mode .navbar-custom .nav-link.active,
body.light-mode .navbar-custom .dropdown-toggle.active {
    color: var(--primary) !important; /* Reste --primary pour l'élément actif */
}

/* Icône du toggler de navbar */
body:not(.light-mode) .navbar-toggler-icon {
    filter: invert(1); 
}

/* Menus déroulants */
.dropdown-menu {
    background-color: var(--background-dark);
    border: 1px solid var(--border-dark);
}
.dropdown-item {
    color: var(--text-dark);
}
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--secondary);
    color: var(--text-dark); /* Maintenir la couleur du texte au survol */
}

body.light-mode .dropdown-menu {
    background-color: var(--background-light) !important;
    border: 1px solid var(--border-light) !important;
}
body.light-mode .dropdown-item {
    color: var(--text-light) !important;
}
body.light-mode .dropdown-item:hover,
body.light-mode .dropdown-item:focus {
    background-color: var(--secondary-light) !important; /* Un fond plus clair pour le survol en mode clair */
    color: var(--text-light) !important; /* Maintenir la couleur du texte */
}

/* Navbar mobile */
.navbar-nav { /* Ajustement pour coller le menu au theme-toggle */
    margin-right: 0; 
}
.navbar-collapse { /* Padding par défaut pour le menu burger ouvert */
    padding: 1rem 0; 
}

@media (max-width: 767px) {
    .navbar-nav {
        padding: 0.5rem;
        background-color: var(--background-dark);
    }
    body.light-mode .navbar-nav {
        background-color: var(--background-light);
    }
    /* Retiré : .navbar-collapse background déjà géré par .navbar-nav sur mobile si besoin */
    /* Ajustement pour les dropdowns en mode mobile pour qu'ils s'intègrent mieux */
    .dropdown-menu { 
        background-color: transparent !important; /* En mobile, le fond est celui du .navbar-nav */
        border: none !important;
    }
    .dropdown-item { /* S'assurer du padding et de la couleur correcte en mobile */
        padding-left: 1.5rem; /* Aligner avec les nav-links */
    }
    body:not(.light-mode) .dropdown-item {
      color: var(--text-dark) !important;
    }
    body.light-mode .dropdown-item {
      color: var(--text-light) !important;
    }
    body:not(.light-mode) .dropdown-item:hover {
      background-color: var(--secondary) !important;
    }
    body.light-mode .dropdown-item:hover {
      background-color: var(--secondary-light) !important;
    }

    .navbar-brand {
        margin-left: 0; /* Réinitialiser sur mobile */
    }
}

/* Style pour le bouton thème */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    margin-right: 0%; /* Réduit pour rapprocher du menu */
}

#theme-toggle {
    position: relative; /* Nécessaire pour positionner les icônes à l'intérieur */
    overflow: hidden;   /* Empêche les icônes de déborder pendant la transition */
    width: 2.5rem;      /* Donner une taille fixe pour éviter les sauts */
    height: 2.5rem;
}

#theme-toggle .bi { /* Style commun pour les deux icônes */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centrage parfait */
    font-size: 1.25rem;
    transition: opacity 0.3s ease, transform 0.3s ease; /* L'animation ! */
}

.theme-icon-dark { /* Par défaut (mode sombre), la lune est visible et le soleil est caché */
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
    color: var(--background-light);
}
.theme-icon-light {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg); /* Rotation pour un effet sympa */
}

body.light-mode .theme-icon-dark {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
}
body.light-mode .theme-icon-light {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

#theme-toggle, /* Cible le bouton dans tous ses états pour s'assurer qu'il reste propre */
#theme-toggle:focus,
#theme-toggle:active {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

#theme-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    fill: none;
}

body.light-mode #theme-toggle {
    color: var(--text-light) !important;
}

.lang-icon { /* Sélecteur de langues */
    display: inline-block;
    width: 20px; /* Taille des drapeaux */
    height: 15px;
    background-size: cover;
    background-position: center;
    vertical-align: middle;
    margin-right: 0.4rem; /* Espace entre le drapeau et le texte */
    border: 1px solid var(--border-dark); /* Bordure subtile */
    border-radius: 2px; /* Coins légèrement arrondis */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Ombre légère */
}

body.light-mode .lang-icon {
    border-color: var(--border-light);
}

.flag-fr {
    background-image: url('../assets/files/flag-fr.svg'); /* Chemin vers le drapeau français */
}

.flag-en {
    background-image: url('../assets/files/flag-uk.svg'); /* Chemin vers le drapeau anglais */
}

.nav-item.d-flex:hover .text-muted {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Ajustement pour l'alignement dans les liens */
.nav-link.lang-switcher {
    display: flex;
    align-items: center; /* Centre verticalement le drapeau et le texte */
}

.nav-link.lang-switcher.active {
    color: var(--accent) !important; /* Bleu clair pour la langue active */
    text-decoration: underline; /* Soulignement subtil */
    text-decoration-color: var(--accent);
}

body.light-mode .nav-link.lang-switcher.active {
    color: var(--primary) !important; /* Bleu profond en mode clair */
    text-decoration-color: var(--primary);
}

/* Animation au survol */
.nav-link.lang-switcher:hover .lang-icon {
    opacity: 0.8;
    transform: scale(1.1); /* Légère animation pour le drapeau */
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
}

/* Ajustement pour mobile */
@media (max-width: 767px) {
    .lang-icon {
        width: 18px; /* Plus petit sur mobile */
        height: 12px;
    }
    .nav-link.lang-switcher {
        padding: 0.3rem 0.5rem; /* Ajuste le padding pour mobile */
    }
}
/* -------------------------------------------------------------------------- */
/* Boutons                                                                    */
/* -------------------------------------------------------------------------- */
.btn-custom {
    background-color: var(--accent);
    color: var(--background-light); /* Texte clair sur fond accent (adapté pour les 2 modes) */
    border: none;
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-custom:hover {
    background-color: #2563eb; /* Un bleu un peu plus foncé pour le survol */
    transform: translateY(-2px);
    color: var(--background-light); /* Maintenir texte clair */
}
/* Le mode clair n'a pas besoin de surcharger .btn-custom si le texte est déjà clair */

.btn-outline-custom {
    color: var(--text-dark);
    border-color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.1s ease;
}
.btn-outline-custom:hover {
    background-color: var(--text-dark);
    color: var(--background-dark);
    transform: translateY(-2px);
}

body.light-mode .btn-outline-custom {
    color: var(--text-light) !important;
    border-color: var(--text-light) !important;
}
body.light-mode .btn-outline-custom:hover {
    background-color: var(--text-light) !important;
    color: var(--background-light) !important;
}


/* -------------------------------------------------------------------------- */
/* Cartes (Style général .card-custom)                                      */
/* -------------------------------------------------------------------------- */
.card-custom {
    min-height: 200px;
    position: relative;
    border: none;
    background: transparent; /* La couleur vient de .card-inner */
    border-radius: 0.375rem;
    margin: 1rem; /* Espacement par défaut autour des cartes */
    display: flex; /* Pour que flex-grow fonctionne si .row.d-flex est utilisé */
    flex-direction: column;
}

.card-inner {
    background-color: var(--secondary);
    color: var(--text-dark);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out, background-color 0.3s ease, color 0.3s ease;
    border: 1px solid transparent; /* Pour l'effet de bordure au survol */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0.375rem; /* Appliquer le radius ici aussi */
}

.card-inner:hover {
    transform: scale(1.05); /* Effet de zoom léger */
    box-shadow: 0 8px 16px rgba(var(--bs-accent-rgb), 0.3); /* Utiliser variable Bootstrap pour l'ombre */
    border-color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.1); /* Fond légèrement teinté */
}

.card-custom .card-body { /* Style général pour le padding dans les card-custom */
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%; /* Pour que flex-grow sur card-text fonctionne */
}

.card-text { /* Pour que le texte pousse le footer de la carte en bas si nécessaire */
    flex-grow: 1;
}

/* Cartes en mode clair */
/*body.light-mode .card-custom { /* /* Pas de style spécifique, repose sur .card-inner */
    /* border: none !important; (déjà dans .card-custom) */
    /* background: transparent !important; (déjà dans .card-custom) */

body.light-mode .card-inner {
    background-color: #E2E8F0 !important; /* Un gris clair spécifique pour les cartes en mode clair */
    color: var(--text-light) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
body.light-mode .card-inner:hover {
    box-shadow: 0 8px 16px rgba(var(--bs-accent-rgb), 0.2);
    border-color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.15)!important; /* Teinte plus claire */
}


/* -------------------------------------------------------------------------- */
/* Modales (Style général pour les modales de formation)                      */
/* -------------------------------------------------------------------------- */
/* Concerne #formationModal1, #formationModal2, etc. */
.modal-content { /* Style par défaut pour toutes les modales Bootstrap */
    background-color: var(--background-dark);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}
body.light-mode .modal-content {
    background-color: var(--background-light) !important;
    color: var(--text-light) !important;
    border: 1px solid var(--border-light) !important;
}
/* S'assurer que les headers et footers de modales suivent le thème */
.modal-header, .modal-footer {
    border-color: var(--border-dark);
}
body.light-mode .modal-header, body.light-mode .modal-footer {
    border-color: var(--border-light) !important;
}
.btn-close { /* Style du bouton de fermeture de modale */
    filter: var(--bs-btn-close-white-filter); /* Mode sombre par défaut */
}
body.light-mode .btn-close {
    filter: none; /* Mode clair */
}


/* -------------------------------------------------------------------------- */
/* Accordéons                                                                 */
/* -------------------------------------------------------------------------- */
.accordion-item {
    background-color: var(--background-dark);
    border: 1px solid var(--border-dark);
}
.accordion-button {
    background-color: var(--background-dark);
    color: var(--text-dark);
}
.accordion-button:not(.collapsed) {
    background-color: var(--secondary);
    color: var(--text-dark); /* Maintenir couleur texte */
}
.accordion-button::after { /* Flèche de l'accordéon */
    filter: invert(1); /* Blanc en mode sombre */
}

body.light-mode .accordion-item {
    background-color: var(--background-light) !important;
    border: 1px solid var(--border-light) !important;
}
body.light-mode .accordion-button {
    background-color: var(--background-light) !important;
    color: var(--text-light) !important;
}
body.light-mode .accordion-button:not(.collapsed) {
    background-color: #e9ecef !important; /* Gris clair pour l'état ouvert en mode clair */
    color: var(--text-light) !important;
}
body.light-mode .accordion-button::after {
    filter: none; /* Couleur par défaut en mode clair */
}


/* -------------------------------------------------------------------------- */
/* Styles Spécifiques aux Sections et Pages                                   */
/* -------------------------------------------------------------------------- */

/* --- Section Héros (index.html) --- */
.hero-section {
    position: relative;
    height: 500px; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    overflow: hidden; /* Empêche le débordement de l'image de fond lors de certains zooms */
}
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('hero-bg.jpg'); 
    background-size: cover; 
    background-position: center;
    background-attachment: fixed; 
    z-index: -1;
}
.hero-section::after { /* Superposition */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 0; /* Doit être au-dessus de hero-bg mais sous le contenu */
}
body.light-mode .hero-section::after {
    background: rgba(0, 0, 0, 0.4); /* Moins sombre en mode clair */
}
.hero-text-overlay { /* Cadre optionnel pour le texte du héros */
    background: rgba(0, 0, 0, 0.6); 
    padding: 1.5rem 2rem;
    border-radius: 10px; 
    position: relative; /* Pour être au-dessus de la superposition ::after */
    z-index: 1;
}
body.light-mode .hero-text-overlay {
    background: rgba(255, 255, 255, 0.7); 
    color: var(--text-light); /* S'assurer que le texte est lisible */
}
.hero-section .container { /* Contenu textuel du héros */
    position: relative; /* Pour être au-dessus de la superposition ::after */
    z-index: 1;
}
body.light-mode .hero-section .container h1, 
body.light-mode .hero-section .container p { /* S'assurer que le texte est lisible */
    color: var(--text-light); /* Texte clair sur fond sombre (image) même en light mode */
}
body.light-mode .hero-section .btn-custom { /* Bouton spécifique héros mode clair */
    color: var(--text-light) !important; /* Texte clair si le bouton reste --accent */
}

.hero-text-overlay .container {
    color: var(--text-dark); /* Pour le mode sombre */
}
/* La règle existante pour body.light-mode .hero-text-overlay { color: var(--text-light); } devrait gérer le mode clair. */

.project-preview-skills .badge {
    font-size: 0.85em;
    padding: 0.4em 0.65em;
}

/* --- Section Point Fort (index.html) --- */
.point-fort-icon {
    font-size: 3rem; /* Taille de l'icône */
    opacity: 0.7;
}

/* --- Section Valeurs (index.html) --- */
.valeurs-section .valeur-item i {
    font-size: 2.5rem; /* Taille des icônes */
    margin-bottom: 0.5rem;
}

/* --- Section Chiffres Clés (index.html) --- */
.stats-section {
    background-color: #1A252F; 
    padding: 4rem 0; /* padding un peu réduit */
}
body.light-mode .stats-section {
    background-color: var(--secondary-light) !important;
}
.stat-number {
    font-size: 2.8rem; /* légèrement réduit */
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
body.light-mode .stat-number {
    color: var(--primary) !important;
}
.stat-label {
    font-size: 1rem; /* légèrement réduit */
    color: var(--text-dark);
}
body.light-mode .stat-label {
    color: var(--text-light) !important;
}
.stats-section .bi { /* Icônes des stats */
    font-size: 2rem !important; /* Taille spécifique pour ces icônes */
    color: var(--accent);
    margin-bottom: 0.5rem; /* Espace sous l'icône */
}
body.light-mode .stats-section .bi {
    color: var(--primary) !important;
}

.stat-number {
    font-size: 2.8rem;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.5rem;
    transition: color 0.5s ease, transform 0.5s ease; /* Animation fluide */
}

.stat-number.counting {
    transform: scale(1.1); /* Léger zoom pendant le comptage */
    animation: pulse 0.5s ease-in-out infinite; /* Effet de pulsation */
}

body.light-mode .stat-number {
    color: var(--primary) !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1.3); }
    50% { transform: scale(1.15); }
}

/* --- Image pour les témoignages (index.html) --- */
.testimonial-photo-index { 
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%; /* Assurer que c'est bien rond */
    align-items: center;
}

/* --- Page Formation (formation.html) --- */
.timeline {
    position: relative;
    padding: 2rem 0;
}
.timeline::before { /* Ligne centrale */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-dark); /* Utiliser border-dark pour la ligne */
    left: 50%;
    transform: translateX(-50%);
}
body.light-mode .timeline::before {
    background: var(--border-light) !important;
}
.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    width: 50%;
    background-color: transparent !important; /* Les items eux-mêmes sont transparents */
}
.timeline-item.left {
    left: 0;
    padding-right: 2.5rem; /* Espace pour le point central */
}
.timeline-item.right {
    left: 50%;
    padding-left: 2.5rem; /* Espace pour le point central */
}
.timeline-item::after { /* Point sur la ligne centrale */
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent); /* Point de couleur accent */
    border: 3px solid var(--background-dark); /* Bordure de la couleur du fond */
    border-radius: 50%;
    top: calc(50% - 8px); /* Centrer verticalement sur le début de la carte typique */
    z-index: 1; /* Au-dessus de la ligne ::before */
}
body.light-mode .timeline-item::after {
    background: var(--accent) !important;
    border-color: var(--background-light) !important;
}
.timeline-item.left::after {
    right: -10px; /* Ajuster pour centrer sur la ligne */
     transform: translateX(50%);
}
.timeline-item.right::after {
    left: -10px; /* Ajuster pour centrer sur la ligne */
     transform: translateX(-50%);
}
.timeline-content { /* Conteneur de la carte dans la timeline */
    position: relative;
    cursor: pointer;
    margin: 0; /* Enlever la marge ici, la carte .card-custom gère sa propre marge */
}
/* Le survol sur .timeline-content .card-inner est déjà défini dans les styles de carte généraux */
.formation-logo { /* Logo des écoles/universités */
    max-height: 40px;
    max-width: 120px;
    object-fit: contain;
    margin-left: 10px;
}
.timeline-item .card-body .badge { /* Badges de statut (ex: A venir, Terminé) */
    font-size: 0.8em;
}
.timeline-click-indicator { /* Texte "Voir les détails" */
    font-style: italic;
    color: var(--accent); 
    font-size: 0.85em;
    opacity: 0.8; 
    transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;
}
.timeline-content:hover .timeline-click-indicator { /* Comportement au survol */
    opacity: 1; 
    color: var(--background-dark); 
}
body.light-mode .timeline-click-indicator {
    color: var(--primary); 
}
body.light-mode .timeline-content:hover .timeline-click-indicator {
    opacity: 1;
    color: var(--background-light); 
}

.timeline-content .card-inner {
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.timeline-content:hover .card-inner {
    background-color: var(--accent);
    color: var(--background-dark);
    border-color: var(--accent);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3); /* Ombre spécifique pour la timeline au survol */
}

body.light-mode .timeline-content:hover .card-inner {
    background-color: var(--accent) !important; 
    color: var(--background-light) !important; 
    border-color: var(--accent) !important;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2); /* Ombre spécifique pour la timeline au survol en mode clair */
}


/* --- Page Alternance (alternance.html) --- */
.company-logo { /* Logo de l'entreprise d'alternance */
    max-width: 150px; 
    max-height: 70px;
    margin-bottom: 1rem; /* Sera écrasé par me-md-3 si en row */
}
.project-details { /* Section détail projet dans alternance */
    background-color: rgba(var(--bs-secondary-rgb), 0.1); 
    border-radius: 0.375rem;
}
/* Galerie d'images du projet */
.project-gallery .carousel-item img {
    max-height: 400px; 
    object-fit: contain; 
    margin: auto; 
}
.carousel-control-prev-icon,
.carousel-control-next-icon { /* Style de base des flèches Bootstrap */
    background-color: rgba(0, 0, 0, 0.5); 
    border-radius: 50%;
}
/* body.light-mode .carousel-control-prev-icon,/* /* Flèches en mode clair */

/*body.light-mode .carousel-control-next-icon {/*
    /* Utilise les SVG par défaut de Bootstrap qui s'adaptent, ou `filter: invert(1)` si besoin */

.testimonial-card { /* Style spécifique pour le témoignage sur alternance.html */
    background-color: var(--secondary); 
    border-left: 5px solid var(--primary);
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 0.25rem;
}
body.light-mode .testimonial-card {
    background-color: #e9ecef; 
    border-left-color: var(--accent);
}
/* S'assurer que le texte du blockquote dans testimonial-card est correct */
.testimonial-card .blockquote-footer {
    color: var(--text-dark); /* Ajuster si !important est sur le .blockquote-footer global */
}
body.light-mode .testimonial-card .blockquote-footer {
    color: var(--text-light); /* Ajuster si !important est sur le .blockquote-footer global */
}


/* --- Page À Propos (apropos.html) --- */
.profile-photo {
    width: 180px;
    height: 180px;
    object-fit: cover; 
    border: 3px solid var(--border-light); 
}
body.light-mode .profile-photo {
    border-color: var(--border-dark);
}
.skills-badges .badge { /* Badges pour compétences techniques */
    font-size: 0.9em; 
    padding: 0.5em 0.75em;
}
/* Styles pour les témoignages sur apropos.html */
.testimonial-photo { 
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 2px solid var(--secondary-light);
    border-radius: 50%; /* Assurer que c'est bien rond */
}
body.light-mode .testimonial-photo {
    border-color: var(--secondary);
}

.testimonial-placeholder { /* Nouveaux styles pour le bloc de témoignage de remplacement */
    background-color: rgba(var(--bs-secondary-rgb), 0.1);
    border-left: 4px solid var(--primary);
    width: 100%;
    box-sizing: border-box; /* Sécurité maximale pour le calcul de la largeur */
}
.testimonial-entry {
    background-color: rgba(var(--bs-secondary-rgb), 0.1); 
    border-left: 4px solid var(--primary);
    border-radius: 0.375rem;
    position: relative; 
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    overflow: hidden; 
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
} 
.testimonial-entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(var(--bs-primary-rgb), 0.12);
}
body.light-mode .testimonial-entry {
    background-color: rgba(var(--bs-secondary-rgb), 0.15); 
    border-left-color: var(--accent);
}
.testimonial-entry .blockquote-details { 
    line-height: 1.3;
}       
.testimonial-entry .blockquote-details .fw-semibold { 
    color: var(--text-dark);
}
body.light-mode .testimonial-entry .blockquote-details .fw-semibold {
    color: var(--text-light);
}
.testimonial-entry .blockquote-details .text-muted { 
    font-size: 0.9em;
}
.testimonial-entry .blockquote.actual-quote { 
    font-size: 1.05rem; 
    line-height: 1.6;
    color: var(--text-dark);
    padding-left: 10px; 
    padding-top: 10px; 
    flex-grow: 1;
}     
body.light-mode .testimonial-entry .blockquote.actual-quote {
    color: var(--text-light);
}
.testimonial-entry .bi-quote { /* Grande icône de citation */
    line-height: 0; 
    opacity: 0.15; 
    font-size: 3rem; 
    position: absolute; /* Reste positionné par rapport à son parent .blockquote */
    top: 0;
    left: 0;
    transform: translate(-15px, -5px); /* Ajuster selon padding du blockquote */
}      
body.light-mode .testimonial-entry .bi-quote {
    opacity: 0.2;
}
/* Ajustements spécifiques pour les témoignages (ancien style card-custom, si encore utilisé ailleurs) */
.testimonials .card-custom { /* Ciblait les anciennes cartes de témoignages */
    min-height: auto; 
}
.testimonials .card-body { /* Pour les anciennes cartes de témoignages */
    padding: 0.75rem; 
}
.blockquote-footer { /* Style global pour les pieds de citation */
    color: var(--text-dark); /* Peut nécessiter !important si surchargé par Bootstrap */
}
body.light-mode .blockquote-footer {
    color: var(--text-light); /* Peut nécessiter !important */
}

  
#testimonialCarousel .carousel-indicators { /* Ajustement pour les indicateurs du carrousel de témoignages */
    position: relative; /* Pour les sortir du flux normal */
    bottom: auto; /* Réinitialiser la position */
    margin-top: 1rem; /* Espace au-dessus des indicateurs */
}
#testimonialCarousel .carousel-indicators [data-bs-target] {
    background-color: var(--primary); /* Couleur pour les indicateurs */
}
body.light-mode #testimonialCarousel .carousel-indicators [data-bs-target] {
    background-color: var(--accent); /* Couleur pour les indicateurs en mode clair */
}

#testimonialCarousel .carousel-control-prev {
    width: 10%; /* Réduit la largeur de la zone cliquable de la flèche */
    transform: translateX(-90%);
}
#testimonialCarousel .carousel-control-next {
    width: 10%; /* Réduit la largeur de la zone cliquable de la flèche */
    transform: translateX(90%);
}

/* --- Page Projets (projets.html) --- */
.project-card-img { /* Pour les images en haut des cartes de projet sur cette page */
    height: 200px;
    object-fit: cover;
}    

/* --- Page Centres Interets (centre-interets.html) --- */
.centres-interets-section .card-custom { /* Ajout d'un curseur pointeur sur les cartes d'intérêts pour indiquer qu'elles sont cliquables */
    cursor: pointer;
}

.card-action-icon { /* Style pour la nouvelle icône d'action */
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.25rem;
    color: #10B981; /* Couleur verte pour plus de visibilité */
    opacity: 0.6; /* La rend discrète par défaut */
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    z-index: 2; /* S'assure qu'elle est au-dessus du contenu si besoin */
}

body.light-mode .card-action-icon {
    color: #10B981 !important;
}

.card-custom:hover .card-action-icon { /* Comportement au survol de la carte parente */
    opacity: 0.8;
    transform: scale(1.1); /* Légère animation de zoom */
}

.card-custom.is-visited .card-inner { /* Styles pour l'état "visité" des cartes d'intérêt */
    opacity: 0.8; /* La carte devient un peu plus discrète */
}

.card-custom.is-visited:hover .card-inner { /* On rétablit l'opacité au survol pour qu'elle redevienne nette */
    opacity: 1;
}

.card-custom.is-visited .card-action-icon { /* On change l'icône de '+' à '✓' */
    opacity: 0.7; /* L'icône check reste un peu discrète */
}

.card-body .bi { /* On prépare l'icône pour la transition */
    transition: transform 0.3s ease-in-out, color 0.3s ease;
}

.card-custom:hover .card-body .bi { /* Effet au survol de la carte parente (.card-custom) */
    transform: scale(1.1) rotate(-5deg); /* Fait grossir et pivoter légèrement l'icône */
    color: var(--accent) !important; /* Change sa couleur pour la couleur d'accentuation */
}

.card-custom:hover .btn .bi {
    color: currentColor !important;
    transform: none; 
}

.card-custom:hover .card-action-icon { /* On s'assure que l'icône "plus" ne soit pas affectée par cette animation */
    transform: scale(1.2); /* On garde son animation de zoom simple */
    color: #10B981 !important; /* On s'assure qu'elle garde sa couleur verte */
}


/* --- Page Precedentes Experiences (precedentes-experiences.html) --- */
.experience-logo {
    max-height: 50px;
    max-width: 100px;
    object-fit: contain;
}
.partner-logos img {
    max-height: 45px;   /* Hauteur maximale autorisée. */
    max-width: 110px;   /* Largeur maximale autorisée. */
    width: auto;        /* La largeur s'ajuste automatiquement pour garder les proportions. */
    height: auto;       /* La hauteur s'ajuste automatiquement pour garder les proportions. */
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    object-fit: contain;
}
.partner-logos img:hover {
    filter: grayscale(0%);
}

/* --- Page changelog (changelog.html) --- */
.changelog-entry {
    position: relative;
    padding: 0.5rem 0 1.5rem 2rem;
    border-left: 2px solid var(--border-dark);
}
body.light-mode .changelog-entry {
    border-left-color: var(--border-light);
}
.changelog-entry:last-child {
    border-left: none;
    padding-bottom: 0;
}
.changelog-entry::before { /* Le point sur la ligne */
    content: '';
    position: absolute;
    left: -9px;
    top: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 3px solid var(--background-dark);
}
body.light-mode .changelog-entry::before {
    border-color: var(--background-light);
}
.changelog-meta {
    margin-bottom: 0.25rem;
}
.changelog-date {
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.changelog-body p {
    margin-bottom: 0;
    color: var(--text-dark);
}

body.light-mode .changelog-body p {
    color:var(--text-light);
}


/* --- Page competences (competences.html) --- */
.competence-phare-box { /* Style pour la mise en valeur de la compétence phare */
    background-color: rgba(30, 58, 138, 0.05); /* Basé sur la couleur de --primary */
    border-width: 2px !important; /* Rend la bordure un peu plus épaisse */
}

body.light-mode .competence-phare-box {
    background-color: rgba(30, 58, 138, 0.07);
}

/* -------------------------------------------------------------------------- */
/* Formulaires (contact.html)                                                 */
/* -------------------------------------------------------------------------- */
.form-control {
    background-color: var(--background-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}
.form-control::placeholder {
    color: var(--text-dark);
    opacity: 0.7;
}
.form-control:focus {
    background-color: var(--background-dark);
    color: var(--text-dark);
    border-color: var(--accent); /* Mettre en évidence avec accent au focus */
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-accent-rgb), 0.25); /* Utiliser variable Bootstrap */
}

body.light-mode .form-control {
    background-color: var(--background-light) !important;
    color: var(--text-light) !important;
    border-color: var(--border-light) !important;
}
body.light-mode .form-control::placeholder {
    color: var(--text-light) !important;
    opacity: 0.7;
}
body.light-mode .form-control:focus {
    background-color: var(--background-light) !important;
    color: var(--text-light) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-accent-rgb), 0.25) !important;
}

.form-label {
    color: var(--text-dark);
}
body.light-mode .form-label {
    color: var(--text-light) !important;
}


/* -------------------------------------------------------------------------- */
/* Utilitaires et Petits Composants                                           */
/* -------------------------------------------------------------------------- */
.social-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.social-links-stacked { /* Si utilisé pour un affichage vertical */
    flex-direction: column;
}
.social-links a {
    font-size: 1.5rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
    margin: 0 0.5rem; /* Ajouter un peu d'espacement */
}
.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px) scale(1.1);
}
body.light-mode .social-links a {
    color: var(--text-light) !important;
}
body.light-mode .social-links a:hover {
    color: var(--accent) !important;
}

.scroll-top-btn {
    display: none; /* Caché par défaut, JS le rend visible */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--secondary);
    color: var(--text-dark);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    line-height: 40px; /* Pour centrer l'icône verticalement */
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.scroll-top-btn.visible { /* Classe ajoutée par JS */
    display: block;
}
.scroll-top-btn:hover {
    background-color: var(--accent);
    transform: scale(1.1);
}
body.light-mode .scroll-top-btn {
    background-color: var(--secondary-light); /* Garder une couleur distincte */
    color: var(--text-light);
}
body.light-mode .scroll-top-btn:hover {
    background-color: var(--accent);
    /* color: var(--text-dark); (optionnel: couleur de l'icône au survol) */
}

/* Utilitaires d'espacement */
.mb-custom { /* Marge en bas personnalisée (plus petite que mb-4) */
    margin-bottom: 0.75rem !important; 
}
.section-spacing { /* Espacement vertical standard pour les sections */
    padding-top: 2.5rem !important; /* Augmenté légèrement pour plus d'air */
    padding-bottom: 2.5rem !important;
}

/* Personnalisation des animations Animate.css */
.animate__animated {
    --animate-duration: 0.5s; 
}
[data-animate] { /* Masquer les éléments avant leur animation */
    opacity: 0;
    visibility: hidden; /* Pour éviter les reflows avant animation */
}
[data-animate].animate__animated { /* Rendre visible une fois l'animation appliquée */
    opacity: 1;
    visibility: visible;
}


/* -------------------------------------------------------------------------- */
/* Préchargeur                                                                */
/* -------------------------------------------------------------------------- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease; 
}
body.light-mode #preloader {
    background-color: var(--background-light) !important;
}
#preloader.fade-out { /* Classe pour faire disparaître le préchargeur */
    opacity: 0;
    pointer-events: none; /* Pour ne pas intercepter les clics après disparition */
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary);
    border-top: 5px solid transparent; /* Crée l'effet de rotation */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* -------------------------------------------------------------------------- */
/* Media Queries Générales (Ajustements responsives globaux)                  */
/* -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    body {
        padding-top: 60px; /* Ajuster si la navbar mobile a une hauteur différente */
    }
    .theme-toggle-wrapper { /* Assurer un padding correct sur mobile */
        padding: 0.75rem 1rem;
        margin-right: 0; 
    }
    .card-custom { /* Espacement par défaut des cartes sur mobile */
        margin: 0.5rem;
        margin-bottom: 1.5rem !important; /* Assurer un espacement vertical suffisant */
    }
    .card-custom .card-body {
        padding: 1.25rem;
    }
    .scroll-top-btn {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .hero-bg { /* Désactiver parallaxe sur mobile pour performance */
        background-attachment: scroll !important;
    }
    .stats-section {
        padding: 3rem 0;
    }
    .stat-number {
        font-size: 2.2rem;
    }
    .stat-label {
        font-size: 0.9rem;
    }
    .stats-section .bi {
        font-size: 1.8rem !important;
    }
    .section-spacing {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    /* Ajustements Timeline pour mobile */
    .timeline::before {
        left: 20px; /* Décaler la ligne sur la gauche */
    }
    .timeline-item {
        width: 100%;
        left: 0 !important; /* Aligner tous les items à gauche */
        padding-left: 40px !important; /* Espace pour le point et un peu de marge */
        padding-right: 0.5rem !important;
    }
    .timeline-item::after { /* Positionner le point sur la ligne décalée */
        left: 12px !important; /* (20px de la ligne - 8px de demi-largeur du point) */
        /* right: auto !important; (déjà implicite) */
    }
    .timeline-content { /* Marge pour les cartes de la timeline sur mobile */
        margin: 0 0 0.5rem 0; 
    }
    .timeline-content .card-body {
        padding: 1.25rem; 
    }
}

/* Ajustements pour les conteneurs flexibles (si .row.d-flex est utilisé) */
.row.d-flex { /* S'assure que les enfants s'étirent */
    display: flex;
    flex-wrap: wrap;
}
.row.d-flex [class*="col-"] { /* Cible toutes les colonnes Bootstrap dans une .row.d-flex */
    display: flex;
    align-items: stretch; 
}
.row.d-flex .card-custom { /* Permet à la carte de prendre toute la hauteur disponible */
    flex-grow: 1;
}


/* ================================================= */
/* ANIMATION DE FONDU POUR LA TRADUCTION DU HEADER/FOOTER */
/* ================================================= */

/* Uniquement sur les pages anglaises, on cache les éléments traductibles par défaut */
body.en-page #header [data-lang-key],
body.en-page #footer [data-lang-key] {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Quand le header/footer a la classe .translated, on affiche les éléments */
body.en-page #header.translated [data-lang-key],
body.en-page #footer.translated [data-lang-key] {
    opacity: 1;
}


/* -------------------------------------------------------------------------- */
/* Correction de bugs                                                         */
/* -------------------------------------------------------------------------- */
