:root {
  --primary: #0f172a;
  --gold: #b5935b;
  --accent: #2563eb;
  --bg: #ffffff;
  --text: #334155;
  --light-bg: #f8fafc;

  --bg-label: rgba(0, 102, 204, 0.08); /* Bleu très léger pour les titres */
  --bg-value: rgba(0, 0, 0, 0.03); /* Gris très léger pour la description */
  --primary-dark: #2d3748;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", system-ui, sans-serif;
}
body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* Navigation */
nav {
  padding: 1.5rem 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #f1f5f9;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -1px;
}
.logo span {
  color: var(--gold);
}
/* Container pour le côté droit de la nav */
.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.lang-switcher {
  display: flex;
  gap: 8px;
  margin-right: 10px;
}
.lang-switcher a {
  display: inline-flex;
  align-items: center;
  border-radius: 0px;
  overflow: hidden; /* Pour garder les coins propres */
  transition: transform 0.2s;
}

.lang-switcher a:hover {
  transform: scale(1.1);
}
/* --- RESPONSIVITÉ MOBILE --- */
@media (max-width: 768px) {
  nav {
    padding: 1rem 5%; /* Réduction du padding pour gagner de la place */
    flex-wrap: wrap; /* Autorise le retour à la ligne si besoin */
    justify-content: center; /* Centre le logo */
    gap: 15px;
  }

  .logo {
    font-size: 2rem; /* Réduction légère du logo */
  }

  .nav-right {
    width: 100%; /* Force le passage à la ligne */
    justify-content: space-between; /* Espace les drapeaux et le bouton */
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
  }

  .btn {
    padding: 8px 16px !important; /* Bouton plus compact sur mobile */
    font-size: 0.9rem;
  }
}

/* Hero Section */
.hero {
  padding: 100px 8%;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  background: radial-gradient(circle at top right, #f8fafc, #ffffff);
}
.hero h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  color: var(--primary);
  margin-bottom: 1.5rem;
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #64748b;
  max-width: 600px;
}
.btn {
  background: var(--primary);
  color: white;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: 0.3s;
  border: 1px solid var(--primary);
  cursor: pointer;
}
.btn:hover {
  background: transparent;
  color: var(--primary);
}

/* Expertise */
.expertise {
  padding: 80px 8%;
  background: var(--light-bg);
}
.section-tag {
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  transition: 0.3s;
}
.card:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
}

/* Timeline Section */
.bio {
  padding: 100px 8%;
  background: white;
}
.timeline {
  position: relative;
  max-width: 900px;
  margin: 40px auto;
  padding: 20px 0;
}
.timeline::after {
  content: "";
  position: absolute;
  width: 2px;
  background: #f0e9e2;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
}
.timeline-item::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  right: -8px;
  background: white;
  border: 3px solid var(--gold);
  top: 20px;
  border-radius: 50%;
  z-index: 1;
}
.left {
  left: 0;
  text-align: right;
  padding-right: 50px;
}
.right {
  left: 50%;
  text-align: left;
  padding-left: 50px;
}
.right::after {
  left: -8px;
}
.content-box {
  padding: 20px;
  background: var(--light-bg);
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  transition: 0.3s;
}
.content-box:hover {
  border-color: var(--gold);
  background: white;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}
.date-tag {
  color: var(--gold);
  font-weight: 800;
  font-size: 0.8rem;
  display: block;
  margin-bottom: 5px;
}

/* --- CORRECTION CRUCIALE DE LA MODALE --- */
#portfolioModal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0);
  backdrop-filter: blur(0px);
  transition: all 0.4s ease;
  align-items: center;
  justify-content: center;
}

/* On utilise l'ID (#) + la classe (.) pour forcer la priorité sur le display:none */
#portfolioModal.active {
  display: flex !important;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
}

.modal-content {
  background: white;
  padding: 50px;
  width: 90%;
  max-width: 1100px;
  /* On force le border-radius à 0 */
  border-radius: 7px;

  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s ease;

  /* Optionnel : Ajoute une bordure fine pour souligner le côté tranchant */
  border: 1px solid #e2e8f0;
}
#portfolioModal.active .modal-content {
  opacity: 1;
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 25px;
  right: 30px;
  font-size: 35px;
  cursor: pointer;
  color: var(--primary);
  font-weight: bold;
}

/* Conteneur pour grouper les icônes à gauche */
.project-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Style de l'icône GitHub cliquable */
.github-icon-link {
  color: var(--text);
  display: flex;
  align-items: center;
  transition:
    color 0.3s ease,
    transform 0.2s ease;
}

.github-icon-link:hover {
  color: var(--gold);
  transform: scale(1.1);
}

/* On ajuste le lien principal pour qu'il reprenne sa place naturelle */
.project-link {
  margin-top: 20px;
  width: 100%;
}

/* Floating Button */
#portfolio-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--gold);
  color: white;
  padding: 15px 28px;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(181, 147, 91, 0.4);
  z-index: 1000;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
}
#portfolio-trigger:hover {
  transform: translateY(-5px);
  background: var(--primary);
}

footer {
  padding: 80px 8%;
  background: var(--primary);
  color: white;
  text-align: center;
}

/* Page Contact */
#status-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  min-width: 300px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.5s ease forwards;
  color: white;
}

.popup-success {
  background-color: #10b981;
  border-left: 5px solid #064e3b;
}
.popup-error {
  background-color: #ef4444;
  border-left: 5px solid #7f1d1d;
}

.popup-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.close-popup {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  margin-left: auto;
  opacity: 0.7;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.contact-container {
  max-width: 600px;
  margin: 60px auto;
  padding: 40px;
  background: var(--light-bg);
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--primary);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  transition: 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181, 147, 91, 0.1);
}
.btn-submit {
  width: 100%;
  font-size: 1rem;
}

/* Grille de projets dans la modale */
/* Style du lien vers le détail du projet */
.project-link {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 18px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.project-link i {
  transition: transform 0.3s ease;
}

/* Animation au survol de la CARTE (plus intuitif) */
.project-card:hover .project-link {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(181, 147, 91, 0.2);
}

.project-card:hover .project-link i {
  transform: translateX(5px); /* La flèche bouge vers la droite */
}

/* Optionnel : Changement d'icône Lucide au survol si besoin via JS, 
   mais le mouvement de translation CSS suffit généralement pour le dynamisme */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
}

.project-card {
  background: var(--light-bg);
  padding: 30px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  background: white;
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.project-icon {
  color: var(--gold);
  width: 28px;
  height: 28px;
}

.tech-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background: white;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  color: var(--text);
}

.project-card h4 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.project-card p {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 20px;
  min-height: 60px;
  line-height: 1.5;
}

.project-features {
  list-style: none;
  padding: 15px 0 0 0;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Espace entre les lignes */
}

.project-features li {
  display: flex;
  align-items: stretch; /* Force les enfants à avoir la même hauteur */
  font-size: 0.85rem;
  color: var(--primary-dark);
  border-radius: 4px;
  overflow: hidden; /* Pour que les backgrounds respectent l'arrondi du li */
}

.project-features li strong {
  width: 30%; /* Ajusté pour laisser un peu plus de place au titre */
  padding: 8px 12px;
  background-color: var(--bg-label);
  display: flex;
  align-items: center; /* Centre le texte verticalement */
  font-weight: 600;
  border-right: 1px solid #fff; /* Séparateur discret blanc */
}

.project-features li span {
  width: 70%;
  padding: 8px 12px;
  background-color: var(--bg-value);
  display: flex;
  align-items: center; /* Centre le texte verticalement */
}
.key-point {
  margin-bottom: 20px;
}
.bio-item {
  display: flex;
  align-items: center;
  gap: 20px;
}
.social-links a:hover {
  color: var(--gold); /* L'icône prend la couleur dorée au survol */
}
@media (max-width: 768px) {
  .social-links {
    margin-top: 15px;
  }
  .bio-item {
    flex-direction: column !important; /* Force la colonne */
    align-items: center; /* Centre l'image et le texte */
    text-align: center; /* Centre le texte */
  }

  .bio-item .bio-img {
    order: -1; /* Place l'image en premier (au-dessus) */
    margin-bottom: 15px; /* Ajoute un peu d'espace sous l'image */
  }
  .project-features li {
    flex-direction: column; /* Empile le titre et la description */
    align-items: stretch;
    border-radius: 8px; /* Un peu plus arrondi pour le look mobile */
    margin-bottom: 12px; /* Plus d'espace entre les blocs */
  }

  .project-features li strong,
  .project-features li span {
    width: 100%; /* Occupent toute la largeur */
    padding: 10px 15px; /* Padding généreux pour le tactile */
  }

  .project-features li strong {
    border-right: none;
    border-bottom: 1px solid #fff; /* Séparateur horizontal maintenant */
    font-size: 0.9rem;
  }

  .project-features li span {
    font-size: 0.8rem;
  }
}
/* --- STYLISATION DE LA BARRE DE DÉFILEMENT (MODALE) --- */

/* 1. On cible le conteneur qui a le overflow-y */
.modal-content::-webkit-scrollbar {
  width: 10px; /* Barre très fine */
}

/* 2. Le "fond" de la barre : on le laisse transparent pour éviter le conflit avec le border-radius */
.modal-content::-webkit-scrollbar-track {
  background: #f8fafc; /* Un gris très léger pour marquer la zone */
  margin: 0; /* Plus besoin de marge en haut/bas */
}

/* 3. Le curseur (la partie qui bouge) */
.modal-content::-webkit-scrollbar-thumb {
  background-color: var(--gold);
  /* On peut garder un petit arrondi sur le curseur lui-même pour le confort visuel */
  border-radius: 0;
}

/* 4. Effet au survol du curseur */
.modal-content::-webkit-scrollbar-thumb:hover {
  background-color: var(--gold); /* Devient opaque au survol */
}

/* Pour Firefox (plus limité en stylisation) */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(181, 147, 91, 0.4) transparent;
}

/* --- STYLES POUR PAGES DÉTAILS PROJETS (À AJOUTER À STYLE.CSS) --- */

/* Conteneur principal blanc qui contient tout le texte */
.project-detail-container {
  max-width: 900px;
  margin: 60px auto;
  padding: 40px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0; /* On garde le style sans arrondis */
}

/* En-tête avec le titre et les technos */
.project-detail-header {
  border-bottom: 2px solid var(--light-bg);
  padding-bottom: 30px;
  margin-bottom: 30px;
}

.project-detail-header h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 15px;
}

/* Grille : texte à gauche (1.5 part), encadré à droite (1 part) */
.project-main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
}

/* Petit encadré gris/or sur le côté */
.project-sidebar {
  background: var(--light-bg);
  padding: 30px;
  border: 1px dashed var(--gold);
}

.project-sidebar h4 {
  margin-bottom: 20px;
  color: var(--primary);
}

/* Ligne de retour en bas */
.back-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
}

/* Adaptation pour téléphone */
@media (max-width: 768px) {
  .project-main-grid {
    grid-template-columns: 1fr; /* Une seule colonne sur mobile */
  }
  .project-detail-container {
    margin: 20px;
    padding: 20px;
  }
  .portfolio-grid {
    grid-template-columns: 1fr !important;
  }
  .modal-content {
    padding: 30px 20px;
    border-radius: 0;
  }
  /* ACTION I */
  /* 1. On remet le Hero sur une colonne */
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  /* 2. On déplace la ligne verticale sur le côté gauche */
  .timeline::after {
    left: 20px;
  }

  /* 3. On force tous les items (Left et Right) à prendre 100% de large */
  .timeline-item {
    width: 100%;
    padding-left: 50px !important; /* Espace pour la ligne à gauche */
    padding-right: 0 !important;
    text-align: left !important; /* Force le texte à gauche */
    left: 0 !important; /* Force la position à 0 */
  }

  /* 4. On replace les petits ronds (points) sur la ligne de gauche */
  .timeline-item::after {
    left: 12px !important;
    right: auto !important;
  }

  /* 5. On s'assure que le contenu interne s'aligne aussi bien */
  .content-box {
    text-align: left;
  }

  /* ACTION II */
  #portfolio-trigger {
    /* 1. On réduit le padding pour le rendre carré/rond */
    padding: 12px;
    bottom: 20px;
    right: 20px;

    /* 2. On lui donne une forme de cercle parfait */
    width: 50px;
    height: 50px;
    border-radius: 50%;

    /* 3. On centre l'icône parfaitement au milieu */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 4. On cache le texte à l'intérieur du bouton */
  #portfolio-trigger .btn-text {
    display: none;
  }

  /* 5. Mais on garde l'icône visible ! */
  #portfolio-trigger i {
    margin: 0; /* On enlève le décalage (gap) que tu avais mis */
  }

  /* 1. Ajuster le conteneur de la modale */
  .modal-content {
    padding: 25px 15px; /* On réduit drastiquement le padding interne */
    width: 95%; /* On prend presque toute la largeur */
    border-radius: 15px;
    max-height: 90vh; /* On laisse un peu plus de place en hauteur */
  }

  /* 2. Réduire le titre H2 pour éviter le retour à la ligne brutal */
  #portfolioModal h2 {
    font-size: 1.5rem !important; /* Taille plus adaptée au mobile */
    line-height: 1.2;
    margin-bottom: 20px;
  }

  /* 3. Forcer la grille à ne faire qu'une seule colonne sans déborder */
  #portfolioModal div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important; /* Une seule colonne */
    gap: 15px !important;
  }

  /* 4. Ajuster les cartes de projets à l'intérieur */
  .modal-content div[style*="background: #f8fafc"] {
    padding: 15px !important; /* On réduit le padding des cartes */
  }

  /* 5. Ajuster le bouton de fermeture */
  .close-modal {
    top: 15px;
    right: 15px;
    font-size: 28px;
  }
}
