/* Variables CSS pour une cohérence visuelle */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --light-gray: #ecf0f1;
  --dark-gray: #95a5a6;
  --text-color: #2c3e50;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset et styles de base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* Masquer les markers par défaut de tous les éléments details */
details > summary {
  list-style: none;
}

details > summary::marker,
details > summary::-webkit-details-marker {
  display: none;
}

/* Header */
.header {
  background: white;
  padding: 1rem 0;
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}

.header img {
  transition: var(--transition);
}

.header img:hover {
  transform: scale(1.05);
}

/* Container principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Titre principal */
.main-title {
  text-align: center;
  color: var(--primary-color);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section mode d'emploi améliorée */
.instructions {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}

.instructions summary {
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  outline: none;
}

.instructions summary:hover {
  background: #34495e;
}

.instructions summary::before {
  content: '▶';
  margin-right: 0.5rem;
  transition: var(--transition);
}

.instructions[open] summary::before {
  transform: rotate(90deg);
}

.instructions-content {
  padding: 2rem;
  background: white;
}

.instructions-content ul {
  list-style: none;
  padding: 0;
}

.instructions-content li {
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
}

.instructions-content li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

/* Tableau des phases amélioré */
.phase-table {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  margin: 2rem 0;
}

.phase-table table {
  width: 100%;
  border-collapse: collapse;
}

.phase-table tr {
  border-bottom: 1px solid #eee;
}

.phase-table tr:last-child {
  border-bottom: none;
}

.phase-table td {
  padding: 1rem;
  vertical-align: middle;
}

.phase-table tr:hover {
  background: var(--light-gray);
  transition: var(--transition);
}

/* Cartes d'affaires */
.affaire-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: var(--transition);
}

.affaire-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.affaire-header {
  background: var(--primary-color);
  color: white;
  padding: 1.5rem;
}

.affaire-number {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.affaire-contact {
  opacity: 0.9;
  font-size: 0.95rem;
}

.affaire-details {
  padding: 1.5rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--dark-gray);
}

.detail-value {
  font-weight: 500;
}

/* Status avec couleurs */
.status-fabrication { color: var(--secondary-color); }
.status-attente { color: var(--warning-color); }
.status-validation { color: var(--accent-color); }
.status-pret { color: var(--success-color); }

/* Timeline améliorée */
.timeline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  background: var(--light-gray);
  border-radius: var(--border-radius);
  margin: 1rem 0;
  overflow-x: auto;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 80px;
}

.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 25px;
  right: -40px;
  width: 30px;
  height: 2px;
  background: var(--light-gray);
}

.timeline-step.completed::after {
  background: var(--success-color);
}

.timeline-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.timeline-icon img {
  display: block;
  margin: 0 auto;
}

.timeline-icon.completed {
  background: var(--success-color);
  color: white;
}

.timeline-icon.current {
  background: var(--secondary-color);
  color: white;
  animation: pulse 2s infinite;
}

/* Centrage pour toutes les images dans les pastilles */
.timeline-icon img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.timeline-label {
  font-size: 0.8rem;
  text-align: center;
  font-weight: 500;
  color: var(--dark-gray);
}

.timeline-step.completed .timeline-label {
  color: var(--success-color);
  font-weight: 600;
}

.timeline-step.current .timeline-label {
  color: var(--secondary-color);
  font-weight: 600;
}

/* Phase details - styles pour les accordéons de phase */
.phase-details {
  background: #f8f9fa;
  border-radius: var(--border-radius);
  margin: 0.5rem 0;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.phase-details summary {
  background: #e9ecef;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-color);
  transition: var(--transition);
  border: none;
  outline: none;
}

.phase-details summary:hover {
  background: #dee2e6;
}

.phase-details summary::before {
  content: '▶';
  margin-right: 0.5rem;
  transition: var(--transition);
  font-size: 0.8rem;
}

.phase-details[open] summary::before {
  transform: rotate(90deg);
}

.phase-details-content {
  padding: 1rem;
  background: white;
  border-top: 1px solid #e9ecef;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Ancienne classe pour compatibilité */
.marge {
  margin-left: 2rem;
  font-style: italic;
  color: var(--dark-gray);
}

/* Messages et alertes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  font-weight: 500;
}

.alert-error {
  background: #fee;
  color: var(--accent-color);
  border-left: 4px solid var(--accent-color);
}

.alert-success {
  background: #efe;
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-info {
  background: #eef;
  color: var(--secondary-color);
  border-left: 4px solid var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 900px) {
  /* Timeline simplifiée - afficher uniquement l'étape en cours */
  .timeline {
    justify-content: center;
    padding: 1.5rem;
  }
  
  .timeline-step {
    display: none;
  }
  
  .timeline-step.current {
    display: flex;
  }
  
  .timeline-step::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .main-title {
    font-size: 2rem;
  }
  
  .timeline {
    flex-direction: column;
    gap: 1rem;
  }
  
  .affaire-header {
    padding: 1rem;
  }
  
  .affaire-details {
    padding: 1rem;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  
  .container {
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.7rem;
  }
  
  .timeline-icon {
    width: 40px;
    height: 40px;
  }
  
  .instructions-content {
    padding: 1rem;
  }
}

/* Améliorations pour l'accessibilité */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus states améliorés */
*:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Boutons et liens améliorés */
a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}


