/* ============================================
   DIGISTBAN - SECTION PROJETS / CAROUSEL
   ============================================
   Fichier : css/projects.css
   Description : Styles spécifiques pour la section projets avec carousel
   ============================================ */

/* ============================================
   SECTION CAROUSEL - CONTAINER PRINCIPAL
   ============================================ */
.carousel-section {
  position: relative;
  overflow: visible;
  padding-bottom: var(--space-4);
}

.carousel-container {
  position: relative;
  width: 100%;
  overflow: visible;
  padding: var(--space-4) 0;
}

/* ============================================
   TRACK DES SLIDES
   ============================================ */
.carousel-wrapper {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
  cursor: grab;
  margin: 0;
  padding: var(--space-2) 0;
}

.carousel-wrapper:active {
  cursor: grabbing;
}

.carousel-wrapper--dragging {
  transition: none;
}

/* ============================================
   SLIDE INDIVIDUELLE
   ============================================ */
.carousel-slide {
  flex: 0 0 33.333%;
  width: 33.333%;
  padding: 0 var(--space-3);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

/* ============================================
   CARTE DE PROJET - Avec micro-animations
   ============================================ */
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(49, 130, 206, 0.15);
  border-color: var(--color-primary-light);
}

.project-card:active {
  transform: translateY(-3px);
}

/* Effet de glow au hover */
.project-card::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: var(--gradient-primary);
  border-radius: calc(var(--radius-xl) + 3px);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
  filter: blur(10px);
}

.project-card:hover::before {
  opacity: 0.25;
}

/* ============================================
   IMAGE DU PROJET
   ============================================ */
.project-card__image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-gray-50) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card__image svg,
.project-card__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-4);
  transition: transform var(--transition-slow);
  pointer-events: none;
}

.project-card:hover .project-card__image svg,
.project-card:hover .project-card__logo {
  transform: scale(1.04);
}

/* Overlay avec titre */
.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 32, 44, 0.9) 0%, rgba(26, 32, 44, 0.4) 40%, transparent 70%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
  transition: all var(--transition-base);
}

.project-card:hover .project-card__overlay {
  background: linear-gradient(to top, rgba(44, 82, 130, 0.92) 0%, rgba(44, 82, 130, 0.5) 50%, transparent 80%);
}

.project-card__title {
  color: var(--color-white);
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  line-height: 1.3;
  transition: transform var(--transition-fast);
}

.project-card:hover .project-card__title {
  transform: translateY(-2px);
}

/* ============================================
   CONTENU DE LA CARTE
   ============================================ */
.project-card__content {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card__description {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  font-weight: 400;
  margin-bottom: var(--space-3);
  line-height: 1.6;
  flex: 1;
}

/* Tags */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: var(--color-gray-100);
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.project-card:hover .tag {
  background: var(--color-accent-light);
  color: var(--color-primary);
}

/* Lien visiter */
.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-primary-light);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  margin-top: auto;
  padding: var(--space-1) 0;
  transition: all var(--transition-fast);
  position: relative;
}

.project-card__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

.project-card:hover .project-card__link::after {
  width: 100%;
}

.project-card__link:hover {
  color: var(--color-primary);
  gap: var(--space-2);
  text-decoration: none;
}

.project-card__link svg {
  transition: transform var(--transition-fast);
}

.project-card:hover .project-card__link svg {
  transform: translateX(2px);
}

/* ============================================
   CONTRÔLES DU CAROUSEL - Avec micro-animations
   ============================================ */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.carousel-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.carousel-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.carousel-btn svg {
  position: relative;
  z-index: 1;
  transition: all var(--transition-fast);
  width: 20px;
  height: 20px;
}

.carousel-btn:hover {
  border-color: var(--color-primary-light);
  transform: scale(1.08);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.carousel-btn:hover::before {
  opacity: 1;
}

.carousel-btn:hover svg {
  color: var(--color-white);
  transform: scale(1.1);
}

.carousel-btn:active {
  transform: scale(1.02);
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.carousel-btn:disabled::before {
  display: none;
}

/* ============================================
   PAGINATION DOTS - Avec micro-animations
   ============================================ */
.carousel-dots {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-gray-300);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.carousel-dot:hover {
  background: var(--color-gray-400);
  transform: scale(1.2);
}

.carousel-dot:active {
  transform: scale(1.1);
}

.carousel-dot--active {
  background: var(--gradient-primary);
  transform: scale(1.3);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   COMPTEUR DE SLIDES
   ============================================ */
.carousel-counter {
  text-align: center;
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

.carousel-counter__current {
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================
   INDICATION SWIPE (MOBILE)
   ============================================ */
.carousel-swipe-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  animation: swipeHint 2.5s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.5;
  }
  50% {
    transform: translateX(8px);
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE - TABLET (640px - 1023px)
   ============================================ */
@media (min-width: 640px) and (max-width: 1023px) {
  .carousel-slide {
    flex: 0 0 50%;
    width: 50%;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (< 640px)
   ============================================ */
@media (max-width: 639px) {
  .carousel-section {
    overflow: hidden;
    padding-bottom: var(--space-2);
  }
  
  .carousel-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    padding: var(--space-2) 0;
  }
  
  .carousel-wrapper {
    width: 100%;
    margin: 0;
    padding: var(--space-2) 0;
    justify-content: flex-start;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  }
  
  /* Slide : 85% width with consistent margins for centering */
  .carousel-slide {
    flex: 0 0 85%;
    width: 85%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }
  
  /* Carte : effet de profondeur par défaut */
  .project-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    transform: scale(0.94);
    opacity: 0.6;
    filter: brightness(0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  }
  
  /* Carte active/centrée - effet premium */
  .carousel-slide--active .project-card {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 20px rgba(49, 130, 206, 0.12);
    z-index: 10;
  }
  
  /* Carte adjacente - légèrement visible */
  .carousel-slide--adjacent .project-card {
    transform: scale(0.92);
    opacity: 0.4;
    filter: brightness(0.7);
  }
  
  .project-card__image svg {
    padding: var(--space-3);
  }
  
  .project-card__content {
    padding: var(--space-3);
  }
  
  .project-card__description {
    font-size: var(--font-size-xs);
    line-height: 1.55;
  }
  
  .project-card__title {
    font-size: var(--font-size-base);
  }
  
  .project-card__overlay {
    padding: var(--space-3);
  }
  
  /* Contrôles */
  .carousel-controls {
    gap: var(--space-3);
    margin-top: var(--space-6);
  }
  
  .carousel-btn {
    width: 44px;
    height: 44px;
  }
  
  .carousel-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .carousel-dots {
    gap: var(--space-1);
  }
  
  .carousel-dot {
    width: 8px;
    height: 8px;
  }
  
  /* Afficher l'indication swipe */
  .carousel-swipe-hint {
    display: flex;
  }
}

/* ============================================
   RESPONSIVE - PETIT MOBILE (< 480px)
   ============================================ */
@media (max-width: 480px) {
  .carousel-slide {
    flex: 0 0 88%;
    width: 88%;
    padding: 0;
    margin: 0;
  }
  
  .project-card {
    transform: scale(0.94);
    opacity: 0.55;
  }
  
  .carousel-slide--active .project-card {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1), 0 0 16px rgba(49, 130, 206, 0.1);
  }
  
  .carousel-slide--adjacent .project-card {
    transform: scale(0.92);
    opacity: 0.4;
  }
  
  .project-card__content {
    padding: var(--space-3);
  }
  
  .project-card__description {
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-2);
  }
  
  .carousel-controls {
    margin-top: var(--space-5);
  }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .carousel-wrapper {
    transition: none;
  }
  
  .carousel-slide {
    transition: none;
  }
  
  .project-card,
  .carousel-btn,
  .carousel-dot {
    transition: none;
  }
  
  .carousel-swipe-hint {
    animation: none;
  }
  
  .project-card {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}
