/**
 * LOGEMENT MULTI-JOURS ENHANCED - Styles visuels distinctifs
 * 
 * Affichage amélioré avec traits de connexion et indicateurs visuels
 * pour les logements s'étendant sur plusieurs jours
 */

/* === TRAIT DE CONNEXION VERTICAL === */

.etapes-list {
  position: relative;
}

/* Trait vertical principal pour connecter les logements multi-jours */
.logement-connection-line {
  position: absolute;
  left: 30px;
  width: 4px;
  background: linear-gradient(180deg, 
    rgba(59, 130, 246, 0.8) 0%, 
    rgba(59, 130, 246, 0.6) 50%, 
    rgba(59, 130, 246, 0.8) 100%);
  border-radius: 2px;
  z-index: 1;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.logement-connection-line.secondary {
  background: linear-gradient(180deg, 
    rgba(245, 158, 11, 0.8) 0%, 
    rgba(245, 158, 11, 0.6) 50%, 
    rgba(245, 158, 11, 0.8) 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* === ÉTAPES LOGEMENT MULTI-JOURS AMÉLIORÉES === */

.etape-resume.logement-multi-jours {
  position: relative;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 16px;
  padding: 1.2rem;
  margin: 0.8rem 0;
  border-left: 6px solid #64748b;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.etape-resume.logement-multi-jours::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.2);
  z-index: 3;
}

.etape-resume.logement-multi-jours.primary {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.etape-resume.logement-multi-jours.primary::before {
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.etape-resume.logement-multi-jours.secondary {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.etape-resume.logement-multi-jours.secondary::before {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.etape-resume.logement-multi-jours:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.etape-resume.logement-multi-jours.primary:hover {
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.etape-resume.logement-multi-jours.secondary:hover {
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
}

/* === HEADER COMPACT === */

.logement-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.logement-header-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.logement-title-section {
  flex: 1;
  min-width: 0; /* Permet la troncature */
}

.etape-jour-badge.multi {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  color: white;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.etape-jour-badge.multi::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.etape-jour-badge.multi:hover::before {
  left: 100%;
}

.etape-jour-badge.multi.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
}

.etape-jour-badge.multi.secondary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
}

.jour-principal {
  font-weight: 700;
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nuits-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.15rem 0.4rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.etape-resume-titre {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 2.6em; /* 2 lignes max */
}

/* === TIMELINE COMPACTE === */

.logement-timeline {
  margin: 0.6rem 0 0.5rem 0;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
  position: relative;
}

.logement-timeline::before {
  content: '📅';
  position: absolute;
  top: -6px;
  left: 8px;
  background: white;
  padding: 0 3px;
  font-size: 0.7rem;
}

.timeline-bar {
  display: flex;
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
  gap: 1px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.timeline-bar.primary {
  background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
}

.timeline-bar.secondary {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
}

.timeline-segment {
  flex: 1;
  background: #d1d5db;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 12px;
  border-radius: 2px;
}

.timeline-segment.active {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timeline-bar.primary .timeline-segment.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.timeline-bar.secondary .timeline-segment.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Segments avec chevauchement - animation plus sophistiquée */
.timeline-segment.overlap {
  background: repeating-linear-gradient(
    45deg,
    #f59e0b,
    #f59e0b 4px,
    #fbbf24 4px,
    #fbbf24 8px
  );
  animation: overlap-pulse 2s ease-in-out infinite;
  position: relative;
}

.timeline-segment.overlap::after {
  content: '⚠️';
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  background: rgba(245, 158, 11, 0.9);
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  z-index: 10;
}

@keyframes overlap-pulse {
  0%, 100% { 
    opacity: 1; 
    transform: scaleY(1);
  }
  50% { 
    opacity: 0.8; 
    transform: scaleY(1.2);
  }
}

.timeline-segment:hover {
  transform: scaleY(1.5) scaleX(1.1);
  z-index: 5;
  border-radius: 4px;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 500;
  margin-top: 0.2rem;
  line-height: 1.2;
}

/* === BADGES COMPACTS === */

.logement-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.logement-type-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.logement-type-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.logement-type-badge.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.logement-type-badge.secondary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.overlap-indicator {
  font-size: 0.65rem;
  color: #f59e0b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(251, 191, 36, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  animation: warning-glow 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes warning-glow {
  0%, 100% { 
    box-shadow: 0 0 0 rgba(251, 191, 36, 0.4);
  }
  50% { 
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
  }
}

/* === COÛTS COMPACTS === */

.logement-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
}

.cost-total {
  font-weight: 700;
  color: #059669;
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(5, 150, 105, 0.1);
}

.cost-per-night {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  background: rgba(107, 114, 128, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

/* === RESPONSIVE AMÉLIORÉ === */

@media (max-width: 768px) {
  .etape-resume.logement-multi-jours {
    padding: 1rem;
    margin: 0.6rem 0;
    border-radius: 12px;
  }

  .etape-jour-badge.multi {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .jour-principal {
    font-size: 0.9rem;
  }

  .nuits-count {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }

  .logement-timeline {
    margin: 0.8rem 0 0.6rem 0;
    padding: 0.6rem;
  }

  .timeline-bar {
    height: 8px;
    gap: 1px;
  }

  .timeline-segment {
    min-width: 10px;
  }

  .timeline-labels {
    font-size: 0.75rem;
  }

  .logement-cost {
    padding: 0.5rem 0.6rem;
  }

  .cost-total {
    font-size: 1rem;
  }

  .cost-per-night {
    font-size: 0.8rem;
  }

  .logement-connection-line {
    left: 20px;
    width: 3px;
  }

  .etape-resume.logement-multi-jours::before {
    width: 10px;
    height: 10px;
    left: -2px;
  }
}

/* === ANIMATIONS D'ENTRÉE === */

.etape-resume.logement-multi-jours {
  animation: slideInFromLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* === ÉTATS SPÉCIAUX === */

.etape-resume.logement-multi-jours.etape-locked {
  opacity: 0.8;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.etape-resume.logement-multi-jours.etape-locked:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* === DRAG & DROP AMÉLIORÉ === */

.etape-resume.logement-multi-jours.sortable-ghost {
  opacity: 0.6;
  transform: rotate(3deg) scale(0.98);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.etape-resume.logement-multi-jours.sortable-chosen {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
}

/* === DARK MODE === */

@media (prefers-color-scheme: dark) {
  .etape-resume.logement-multi-jours {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f1f5f9;
    border-left-color: #64748b;
  }

  .etape-resume.logement-multi-jours.primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  }

  .etape-resume.logement-multi-jours.secondary {
    background: linear-gradient(135deg, #92400e 0%, #d97706 100%);
  }

  .logement-timeline {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .logement-cost {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(30, 41, 59, 0.4) 100%);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .timeline-bar {
    background: #475569;
  }

  .timeline-segment {
    background: #64748b;
  }
}

/* === ACCESSIBILITÉ === */

.etape-resume.logement-multi-jours:focus {
  outline: 3px solid #3b82f6;
  outline-offset: 3px;
}

.timeline-segment[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* === INTÉGRATION AVEC LA LISTE D'ÉTAPES === */

.etapes-list .etape-resume.logement-multi-jours + .etape-resume:not(.logement-multi-jours) {
  margin-top: 1.5rem;
}

.etapes-list .etape-resume:not(.logement-multi-jours) + .etape-resume.logement-multi-jours {
  margin-top: 1.5rem;
}