/* Vidéo en arrière-plan */
.background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.25; /* Réduit l'opacité pour ne pas gêner la lecture du contenu */
}

/* Fallback si la vidéo ne se charge pas */
.video-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #000000, #1a1a1a, #000000);
  z-index: -1;
}

/* Image du projet principal */
.project-title {
  width: 300px;
  height: 300px;
  object-fit: contain;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  transition:
    transform 0.3s ease,
    background 0.3s ease;
}

.project-title:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.15);
}

/* Technologies utilisées */
#projectTechnologies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

#projectTechnologies span {
  background: rgba(78, 115, 223, 0.2);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(78, 115, 223, 0.3);
  transition: all 0.3s ease;
}

#projectTechnologies span:hover {
  background: rgba(78, 115, 223, 0.3);
  transform: translateY(-2px);
}

/* Description du projet */
#projectDescription {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin: 20px 0;
  font-size: 16px;
}

/* Ajout du style pour le nom du projet */
.content h3 {
  color: white;
  font-size: 28px;
  font-weight: 600;
  margin: 15px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Bouton cahier des charges */
.btn-specifications {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(139, 69, 19, 0.8);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 2px solid rgba(160, 82, 45, 0.5);
}

.btn-specifications:hover {
  background: rgba(160, 82, 45, 0.9);
  border-color: rgba(160, 82, 45, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.btn-specifications i {
  font-size: 16px;
}

/* Carousel Box */
.carousel-box {
  position: relative;
  width: 450px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.carousel-header {
  text-align: center;
  margin-bottom: 20px;
}

.carousel-header h3 {
  color: white;
  font-size: 24px;
  margin-bottom: 8px;
}

.carousel-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0;
}

.carousel-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Important pour que le flex-track s'aligne bien */
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
}

.carousel-page {
  min-width: 100%; /* Chaque page prend 100% de la largeur du track */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 140px; /* Force la hauteur de chaque projet */
  gap: 15px;
  padding: 10px;
}

.carousel-item {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.carousel-item:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.1);
}

.carousel-item.active {
  border-color: var(--secondary-color);
  background: rgba(28, 200, 138, 0.1);
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 15px 10px 10px;
  text-align: center;
}

.project-overlay h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(
    0,
    0,
    0,
    0.5
  ); /* Plus sombre pour ressortir sur les images */
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--primary-color);
  transform: translateY(-50%) scale(1.1);
  border-color: transparent;
}

.prev-btn {
  left: 5px; /* Placées à l'intérieur du conteneur pour ne pas être masquées par overflow:hidden */
}

.next-btn {
  right: 5px; /* Placées à l'intérieur du conteneur pour ne pas être masquées par overflow:hidden */
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: var(--secondary-color);
  transform: scale(1.2);
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* Modale de projet avec carousel */
.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: rgba(26, 26, 46, 0.95);
  border-radius: 20px;
  padding: 40px;
  max-width: 90%;
  max-height: 90vh;
  width: 900px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  position: relative;
  box-shadow: 0 10px 50px rgba(78, 115, 223, 0.3);
  border: 1px solid rgba(78, 115, 223, 0.3);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-title {
  color: var(--primary-color);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 59, 59, 0.2);
  border: none;
  color: #ff3b3b;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 59, 59, 0.8);
  color: white;
  transform: rotate(90deg);
}

.modal-carousel {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

.modal-carousel-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 20px;
  min-height: 400px;
  max-height: 60vh;
}

.modal-carousel-container img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.modal-carousel-container img:hover {
  transform: scale(1.02);
}

.modal-nav-btn {
  background: rgba(78, 115, 223, 0.2);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-nav-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.modal-nav-btn:active {
  transform: scale(0.95);
}

.modal-counter {
  text-align: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
  background: rgba(78, 115, 223, 0.2);
  padding: 10px 20px;
  border-radius: 25px;
  display: inline-block;
  margin: 0 auto;
}

/* Responsive pour la modale */
@media screen and (max-width: 768px) {
  .modal-content {
    padding: 20px;
    width: 95%;
    max-height: 95vh;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-carousel {
    flex-direction: column;
    gap: 15px;
  }

  .modal-nav-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .modal-carousel-container {
    min-height: 300px;
    max-height: 50vh;
  }

  .modal-carousel-container img {
    max-height: 50vh;
  }

  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}
