/* style.css - Version "Deep Midnight Tech" avec Animations */

body {
  margin: 0;
  padding: 0;
  background-color: #0f172a; 
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  color: #cbd5e1; 
  /* Pour éviter le scroll horizontal pendant l'animation */
  overflow-x: hidden; 
}

a {
  color: #38bdf8;
  text-decoration: underline;
}

strong, b {
  color: #f8fafc; 
  font-weight: 600;
}

h1 {
  color: #38bdf8;
}

h2, h3, h4, h5, h6 {
  color: #f8fafc;
}

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
  padding: 20px 40px;
  background-color: #1e293b; 
  border-bottom: none; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border-radius: 0 0 12px 12px;
}

.project-link {
  display: inline-block;
  background: #38bdf8;
  color: #0f172a;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.project-link:hover {
  background: #f8fafc;
}

.name {
  font-size: 2rem;
  font-weight: 700;
  color: #38bdf8;
}

nav a {
  margin-left: 30px;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  color: #cbd5e1;
  transition: color 0.3s, border-color 0.3s;
}

nav a:hover {
  color: #38bdf8;
  border-bottom: 1px solid #38bdf8;
}

main {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  align-items: flex-start;
  justify-content: space-between;
}

.left {
  flex: 2;
  min-width: 300px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.right {
  flex: 1;
  min-width: 240px;
  text-align: center;
}

.right img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  border: 4px solid #1e293b;
}

.right h2 {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #f8fafc;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 1.4rem;
}

.social-icons a {
  color: #cbd5e1;
  transition: color 0.3s ease, transform 0.2s ease;
}

.social-icons a:hover {
  color: #38bdf8;
  transform: scale(1.1);
}

.carousel {
  position: relative;
}

.carousel-image {
  display: none;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.carousel-image.show {
  display: block;
}

.carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  border: 1px solid #334155;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  z-index: 1;
  color: #38bdf8;
}

.carousel.cpge {
  margin-bottom: 100px;
}

.carousel .prev { left: 0; }
.carousel .next { right: 0; }

/* Animation de chargement initial (déjà présente) */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.project-carousel {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.details-button {
  background-color: #1e293b;
  color: #38bdf8;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 1px solid #38bdf8;
}

.details-button:hover {
  background-color: #38bdf8;
  color: #0f172a;
}

.projects-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 30px;
  color: #38bdf8;
}

@keyframes slideFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 3px solid #334155;
}

.timeline-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 60px;
  padding-left: 30px; 
}

.timeline-marker {
  position: absolute;
  left: -9px;
  top: 0.4em; 
  width: 14px;
  height: 14px;
  background-color: #38bdf8;
  border-radius: 50%;
  border: 3px solid #0f172a;
  box-shadow: 0 0 0 2px #38bdf8;
}

.timeline-content {
  flex: 2;
  min-width: 300px;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: -23px;
}

.timeline-carousel {
  flex: 1;
  max-width: 300px;
  min-width: 240px;
  position: relative;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-dots span {
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-dots span.active {
  background-color: #38bdf8;
}

.project {
  margin-bottom: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
}

.project-info {
  flex: 1 1 300px;
  background-color: #1e293b;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease;
  border: 1px solid #334155;
}

.project-info:hover {
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.1);
}

.project-carousel {
  position: relative;
  flex: 1 1 300px;
  max-width: 500px;
}

.project-carousel img {
  width: 100%;
  border-radius: 10px;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.project-carousel img.show {
  display: block;
}

.project-carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  border: 1px solid #334155;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 2;
  color: #38bdf8;
}

.project-carousel .prev { left: 10px; }
.project-carousel .next { right: 10px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  gap: 6px;
}

.carousel-dots span {
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}

.carousel-dots span.active {
  background-color: #38bdf8;
}

.project.reverse {
  flex-direction: row-reverse;
}

#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.95);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

#loader {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.card-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background-image: linear-gradient(163deg, #0ea5e9 0%, #38bdf8 100%);
  border-radius: 0px;
  transition: all 0.3s ease;
  padding: 3px;
}

.card-wrapper:hover {
  box-shadow: 0 0 30px 1px rgba(56, 189, 248, 0.4);
  border-radius: 30px;
}

.card-inner {
  background-color: #1e293b;
  border-radius: 0px;
  transition: all 0.3s ease;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
}

.card-wrapper:hover .card-inner {
  border-radius: 30px;
}

.card-inner img {
  flex: 1 1 150px;
  height: 100%;
  max-height: 300px; 
  object-fit: cover;
  border-radius: 18px 0 0 18px;
}

.card-content {
  position : relative;
  flex: 2;
  padding: 30px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-link {
  display: inline-block;
  margin-left: auto;
}

.rainbow-hover {
  font-size: 16px;
  font-weight: 700;
  background-color: rgba(56, 189, 248, 0.1);
  border: none;
  outline: none;
  cursor: pointer;
  padding: 12px 24px;
  position: absolute;
  right: 20px;
  bottom: 20px;
  line-height: 24px;
  border-radius: 9px;
  transform-style: preserve-3d;
  transform: scale(var(--s, 1)) perspective(600px)
             rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.1s;
  text-decoration: none;
  background-image: linear-gradient(90deg, #38bdf8, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #38bdf8; 
}

.rainbow-hover:active {
  transition: 0.3s;
  transform: scale(0.93);
}

.cta {
  position: relative;
  margin: auto;
  padding: 12px 18px;
  transition: all 0.2s ease;
  border: none;
  background-color: #1e293b;
  border-radius: 50px;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid #334155;
}

.cta:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border-radius: 50px;
  background: #334155;
  width: 45px;
  height: 45px;
  transition: all 0.3s ease;
  z-index: -1;
}

.cta span {
  position: relative;
  font-family: "Poppins", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.cta svg {
  position: relative;
  top: 0;
  margin-left: 10px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: #38bdf8;
  stroke-width: 2;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}

.cta:hover:before {
  width: 100%;
  background: #0f172a;
}

.cta:hover svg {
  transform: translateX(0);
}

.cta:active {
  transform: scale(0.97);
}

.arrow {
  cursor: pointer;
  height: 20px;
  width: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.1s;
  z-index: 2;
}

.arrow.prev { left: 10px; }
.arrow.next { right: 10px; }

.arrow-top, .arrow-bottom {
  background-color: #38bdf8;
  height: 4px;
  left: 0;
  position: absolute;
  top: 50%;
  width: 100%;
  transition: background-color 0.3s;
}

.arrow-top:after, .arrow-bottom:after {
  background-color: transparent;
  content: "";
  height: 100%;
  position: absolute;
  top: 0;
  transition: background-color 0.3s;
}

.arrow.next .arrow-top { transform: rotate(45deg); transform-origin: bottom right; }
.arrow.next .arrow-bottom { transform: rotate(-45deg); transform-origin: top right; }
.arrow.prev .arrow-top { transform: rotate(-45deg); transform-origin: bottom left; }
.arrow.prev .arrow-bottom { transform: rotate(45deg); transform-origin: top left; }

.arrow:hover .arrow-top, .arrow:hover .arrow-bottom {
  background-color: #0ea5e9;
}

.arrow:active {
  transform: translateY(-50%) scale(0.9);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.skill {
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.skill:hover {
  background: #38bdf8;
  color: #0f172a;
  cursor: default;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.exp-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #1e293b;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid #334155;
}

.exp-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(56, 189, 248, 0.1);
}

.exp-icon {
  min-width: 50px;
  height: 50px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #0f172a;
  background: #38bdf8;
  flex-shrink: 0;
}

.exp-body { flex: 1; }

.exp-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #f8fafc;
}

.exp-meta {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.exp-desc {
  color: #cbd5e1;
  line-height: 1.6;
  font-size: 0.96rem;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .container { padding: 20px 15px; }
  h1, h2, h3 { text-align: center; }
  header { flex-direction: column; text-align: center; gap: 15px; border-radius: 0; }
  nav { display: flex; flex-direction: column; gap: 8px; }
  nav a { margin: 0; font-size: 1rem; }
  main { flex-direction: column; gap: 30px; align-items: center; }
  .left, .right { width: 100%; text-align: center; }
  .right img { max-width: 100%; height: auto; }
  
  .timeline { padding-left: 0; border-left: none; }
  .timeline-item { flex-direction: column; padding-left: 0; gap: 16px; border-left: 3px solid #334155; padding-left: 15px; }
  .timeline-marker { display: none; }
  
  .exp-item { flex-direction: column; align-items: flex-start; text-align: left; }
  .exp-icon { margin-bottom: 10px; }
  .skills { flex-wrap: wrap; justify-content: flex-start; }
  .project { flex-direction: column; text-align: center; }
  .project.reverse { flex-direction: column; }
  .project-carousel { max-width: 100%; }
  
  .card-inner { flex-direction: column; align-items: center; }
  .card-inner img { max-width: 100%; height: 250px; border-radius: 0; }
  .card-content { width: 100%; }
  .rainbow-hover { position: static; display: block; margin: 20px auto 0; text-align: center; }
}

@media (max-width: 480px) {
  body { font-size: 0.95rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .exp-title { font-size: 1rem; }
  .skill { font-size: 0.75rem; padding: 4px 8px; }
}

main.about-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: stretch;
}

.card {
  background: #1e293b;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 32px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.music {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.video-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.video-frame video {
  width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.responsive-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@media (max-width: 1024px) {
  .music { grid-template-columns: 1fr; }
  .card { padding: 28px; }
}

@media (max-width: 640px) {
  main.about-page { gap: 28px; }
  .card { padding: 22px; }
}

/* =========================================
   NOUVEAU : Classes pour l'animation au scroll
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px); /* Décalage vers le bas au départ */
  transition: all 1s cubic-bezier(0.5, 0, 0, 1); /* Transition fluide "luxe" */
}

.reveal.active {
  opacity: 1;
  transform: translateY(0); /* Retour à la position normale */
}
/* ... (Garder tout le CSS précédent jusqu'à la section responsive) ... */

/* === SCROLL HORIZONTAL "APPLE LIKE" (PREMIUM) === */

.scrolling-wrapper {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 40px; /* Espace entre les cartes */
  
  /* CORRECTION ICI : Padding généreux à gauche et à droite */
  padding: 10px 40px 60px 40px; 
  
  /* Scroll Snap Fluide */
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  
  /* Astuce pour que le padding-right fonctionne bien avec le scroll */
  box-sizing: border-box;
}

/* On s'assure que le dernier élément a aussi une marge à droite */
.scrolling-wrapper::after {
  content: '';
  min-width: 1px; /* Petit spacer invisible */
  height: 1px;
}

/* === CARD PROJECT DESIGN === */
.card-project {
  /* FIX TAILLE : On force la largeur pour éviter que la dernière carte s'étire */
  flex: 0 0 380px; 
  width: 380px;      /* Sécurité supplémentaire */
  max-width: 380px;  /* Sécurité supplémentaire */
  height: 550px;
  
  /* Style */
  background-color: #1e293b; 
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  
  /* Bordure et Ombre */
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  
  scroll-snap-align: center;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  display: flex;
  flex-direction: column;
}

/* Reste du CSS pour les cartes... */
.card-project:hover {
  transform: translateY(-15px);
  box-shadow: 0 30px 60px -12px rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

/* === IMAGE ZONE (HAUT) === */
.card-image-wrapper {
  height: 55%; /* Prend plus de la moitié de la hauteur */
  width: 100%;
  overflow: hidden;
  position: relative;
}

.card-project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease; /* Zoom lent et fluide */
  border: none; /* Reset des styles globaux */
  border-radius: 0; /* Reset */
  margin: 0;
}

/* Zoom image au survol de la carte */
.card-project:hover img {
  transform: scale(1.1);
}

/* Gradient overlay sur l'image pour le texte */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, #1e293b 0%, transparent 100%);
}

/* === CONTENT ZONE (BAS) === */
.card-content {
  padding: 25px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #1e293b;
  position: relative;
  z-index: 2;
}

/* Badges Tech */
.card-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.1); /* Fond Cyan très transparent */
  color: #38bdf8; /* Texte Cyan */
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.card-project h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-project p {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4; /* Version préfixée (support actuel) */
  line-clamp: 4;         /* Version standard (pour corriger l'erreur) */
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 20px;
}

/* Bouton "View Case Study" */
.card-link-btn {
  color: #f8fafc;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.2s ease, color 0.2s ease;
  margin-top: auto; /* Pousse le bouton vers le bas */
}

.card-link-btn i {
  color: #38bdf8;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.card-project:hover .card-link-btn {
  color: #38bdf8;
}

.card-project:hover .card-link-btn i {
  transform: translateX(5px);
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
  .scrolling-wrapper {
    gap: 20px;
    padding-left: 20px; /* Padding pour ne pas coller au bord */
    padding-right: 20px;
  }
  
  .card-project {
    flex: 0 0 85vw; /* Carte prend 85% de l'écran */
    height: 500px;
  }
  
  .card-content {
    padding: 20px;
  }
}
/* ... (Garder tout le CSS précédent) ... */

/* === STYLE DES FLÈCHES DE DÉFILEMENT (DA: Midnight Tech) === */
.scroll-arrow {
  position: absolute;
  top: 55%; 
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  
  /* COULEURS CORRIGÉES : Fond sombre, Flèche Cyan */
  background-color: #1e293b; 
  color: #38bdf8; 
  border: 1px solid #334155;
  
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.scroll-arrow:hover {
  opacity: 1;
  /* Au survol : Fond Cyan, Flèche Sombre (Effet néon) */
  background-color: #38bdf8; 
  color: #0f172a; 
  transform: translateY(-50%) scale(1.1);
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.scroll-left {
  left: -25px;
}

.scroll-right {
  right: -25px;
}

@media (max-width: 768px) {
  .scroll-arrow {
    display: none; /* On cache sur mobile */
  }
}