/* ============================================================
   sections/projects/style.css
   ============================================================ */

.projects {
  background: linear-gradient(135deg, rgba(15, 15, 35, 0.95), var(--bg-color));
  position: relative;
  overflow: hidden;
}

.projects::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(0, 255, 245, 0.2), transparent 70%);
  pointer-events: none;
}

.project-instruction {
  color: var(--text-color);
  opacity: 0.8;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  animation: pulse 2s infinite;
}

.project-instruction i {
  color: var(--primary-color);
}

/* ── Carrousel ─────────────────────────────────────────────── */
.project-carousel {
  position: relative;
  height: 550px;
  margin: 0 auto;
  max-width: 1200px;
  margin-bottom: 50px;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Cartes ────────────────────────────────────────────────── */
.project-card {
  position: absolute;
  width: 100%;
  max-width: 800px;
  height: 450px;
  transition: all 0.5s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
}

.project-card.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  z-index: 3;
}

.project-card.prev {
  opacity: 0.3;
  visibility: visible;
  transform: translateX(-70%);
  scale: 0.9;
  pointer-events: none;
  z-index: 2;
}

.project-card.next {
  opacity: 0.3;
  visibility: visible;
  transform: translateX(70%);
  scale: 0.9;
  pointer-events: none;
  z-index: 2;
}

/* ── Contenu / flip ────────────────────────────────────────── */
.project-content {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: pointer;
}

.project-content img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  backface-visibility: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.project-info {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(10, 10, 31, 0.95), rgba(10, 10, 31, 0.9));
  border-radius: 20px;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.project-info-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.05);
  padding-right: 10px;
}

.project-info-scroll::-webkit-scrollbar {
  width: 5px;
}

.project-info-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.project-info-scroll::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.project-info-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

.project-card.active .project-content.flipped {
  transform: rotateY(180deg);
}

.project-tech {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.project-tech span {
  padding: 0.5rem 1rem;
  background: rgba(0, 255, 245, 0.1);
  border: 1px solid rgba(0, 255, 245, 0.2);
  transform: skew(-15deg);
  font-size: 0.9rem;
  color: var(--primary-color);
}

/* ── Contrôles ─────────────────────────────────────────────── */
.carousel-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.indicators-wrapper {
  text-align: center;
  margin-top: 1.5rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.navigation-buttons {
  display: flex;
  gap: 2rem;
}

.carousel-controls button {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 1rem;
  transform-origin: center;
}

.carousel-controls button:hover {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.carousel-controls button:active {
  transform: scale(0.95);
}

.carousel-indicators {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding-top: 0.5rem;
  flex-wrap: wrap;
  max-width: 300px;
  margin: 0 auto;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(0, 255, 245, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.2rem;
}

.carousel-indicator.active {
  background-color: var(--primary-color);
  transform: scale(1.2);
  box-shadow: 0 0 8px var(--primary-color);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .project-carousel {
    height: 350px;
  }

  .project-card {
    height: 350px;
  }

  .project-card.prev,
  .project-card.next {
    display: none;
  }
}
