/**
 * Styles dédiés pour l'interface de simulation
 * Séparés pour améliorer la modularité et la sécurité CSP
 */

/* Variables pour la simulation - UNIFIÉES AVEC SIMCRISE */
:root {
  /* 🎯 Mapping unifié vers la palette principale */
  --simulation-primary: var(--simcrise-primary, #2563eb);
  --simulation-secondary: var(--simcrise-secondary, #64748b);
  --simulation-success: var(--simcrise-accent, #059669);
  --simulation-danger: var(--simcrise-error, #dc2626);
  --simulation-warning: var(--simcrise-warning, #ea580c);
  --simulation-info: var(--simcrise-info, #3b82f6);
  --bg-light: var(--simcrise-bg-primary, #f8fafc);
  --border-light: var(--simcrise-border-light, #e2e8f0);
  --text-muted: var(--simcrise-secondary, #64748b);
}

/* Header avec navigation */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 0;
  border-bottom: 2px solid var(--border-light);
}

.header-nav h1 {
  margin: 0;
  color: var(--simulation-primary);
  font-size: 1.8rem;
}

.nav-buttons {
  display: flex;
  gap: 12px;
}

.nav-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.nav-btn.success {
  background: var(--simulation-success);
  color: white;
}

.nav-btn.info {
  background: var(--simulation-info);
  color: white;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Formulaire de configuration */
.simulation-form {
  margin-top: 16px;
}

.configuration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input, 
.form-group select {
  padding: 12px;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus, 
.form-group select:focus {
  outline: none;
  border-color: var(--simulation-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error, 
.form-group select.error {
  border-color: var(--simulation-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group.hide {
  display: none;
}

/* Actions du formulaire */
.form-actions {
  text-align: center;
  padding: 24px 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--simulation-primary), var(--simulation-secondary));
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-large {
  padding: 16px 40px;
  font-size: 1.2rem;
}

.form-hint {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Interface de simulation */
.simulation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.simulation-header h2 {
  margin: 0;
  color: var(--simulation-primary);
}

.simulation-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timer {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--simulation-primary);
  background: white;
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid var(--simulation-primary);
  min-width: 70px;
  text-align: center;
}

.timer.warning {
  color: var(--simulation-warning);
  border-color: var(--simulation-warning);
  animation: pulse 1s infinite;
}

.timer.danger {
  color: var(--simulation-danger);
  border-color: var(--simulation-danger);
  animation: pulse 0.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.btn-danger {
  background: var(--simulation-danger);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* Interface de chat */
.chat-container {
  min-height: 400px;
  max-height: 500px;
  overflow-y: auto;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  background: white;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-container::-webkit-scrollbar {
  width: 8px;
}

.chat-container::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.msg {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: white;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-light);
  border-left: 4px solid var(--simulation-primary);
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #eaf2ff, #dbeafe);
  border-left: 4px solid var(--simulation-info);
}

.msg.thinking {
  font-style: italic;
  color: var(--text-muted);
  background: #fafafa;
  border-left: 4px solid var(--text-muted);
  align-self: center;
  max-width: 90%;
}

.msg.evaluation {
  align-self: center;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-left: 4px solid var(--simulation-success);
  max-width: 90%;
  font-size: 0.95rem;
}

/* Barre d'entrée */
.input-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-light);
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--border-light);
}

.input-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid white;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s ease;
}

.input-bar input:focus {
  outline: none;
  border-color: var(--simulation-primary);
}

.input-bar input:disabled {
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-bar button {
  background: var(--simulation-primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.input-bar button:hover:not(:disabled) {
  background: #5a67d8;
  transform: translateY(-1px);
}

.input-bar button:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* Mode correction */
.correction-header {
  text-align: center;
  margin-bottom: 24px;
}

.correction-header h2 {
  color: var(--simulation-primary);
  margin-bottom: 8px;
}

.correction-header p {
  color: var(--text-muted);
  margin: 0;
}

.correction-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.btn-secondary {
  background: var(--text-muted);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: #52525b;
  transform: translateY(-1px);
}

/* Toast notifications */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #111827;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: 300px;
  font-weight: 500;
}

.toast.show {
  opacity: 1;
  transform: translateY(-8px);
}

.toast.success {
  background: var(--simulation-success);
}

.toast.error {
  background: var(--simulation-danger);
}

.toast.warning {
  background: var(--simulation-warning);
}

.toast.info {
  background: var(--simulation-info);
}

/* Responsive design */
@media (max-width: 768px) {
  .header-nav {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .configuration-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .nav-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .simulation-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .simulation-controls {
    justify-content: center;
  }

  .input-bar {
    flex-direction: column;
    gap: 8px;
  }

  .input-bar button {
    width: 100%;
  }

  .msg {
    max-width: 95%;
  }

  .correction-controls {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .header-nav h1 {
    font-size: 1.4rem;
  }

  .nav-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .btn-large {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .timer {
    font-size: 1rem;
    padding: 6px 12px;
  }

  .chat-container {
    min-height: 300px;
    padding: 12px;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* États de focus améliorés pour l'accessibilité */
button:focus, input:focus, select:focus {
  outline: 2px solid var(--simulation-primary);
  outline-offset: 2px;
}

/* Indicateurs visuels pour les champs requis */
.form-group input[required]:invalid {
  box-shadow: none;
}

.form-group label[required]::after {
  content: ' *';
  color: var(--simulation-danger);
}

/* Amélioration de la lisibilité */
.msg {
  font-size: 15px;
  line-height: 1.6;
}

.msg code {
  /* Afficher le code inline comme du texte en gras sans badge */
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 700 !important;
  color: inherit !important; /* Utiliser la couleur du texte parent */
  border: none !important;
  box-shadow: none !important;
}

.msg strong {
  color: var(--simulation-primary);
  font-weight: 600;
}/**
 * 🎯 Amélioration UX/UI - Boutons de Simulation 
 * Gestion moderne et interactive des boutons de simulation
 */

/* ============================================
   🚀 AMÉLIORATIONS BOUTONS DE SIMULATION
============================================ */

/* Conteneur des boutons de simulation - Desktop uniquement */
@media (min-width: 601px) {
    .bar {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 16px !important;
        padding: 16px !important;
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
        backdrop-filter: blur(5px) !important;
        display: flex !important;
        gap: 12px !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }
}

/* Styles généraux de base pour la barre - PLEINE LARGEUR */

/* ============================================
   📝 BARRE DE RÉPONSE - STYLES DEPUIS INDEX.HTML
   Styles extraits et consolidés pour cohérence
============================================ */

    .bar { 
      position: relative !important;
      width: 100vw !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      margin-top: 12px !important;
      margin-bottom: 0 !important;
      z-index: 10000 !important;
      border-top: 1px solid var(--line, #e5e7eb);
      background: var(--card, #ffffff);
      box-sizing: border-box !important;
      padding: 0 !important;
      overflow: hidden !important;
      /* Les autres styles (display, layout) sont définis dans les media queries */
    }
    
    /* Styles améliorés pour les boutons du simulateur */
    #msgInput {
      flex: 1;
      min-width: 200px;
      min-height: 62px; /* Hauteur minimale */
      max-height: 300px; /* Hauteur maximale pour éviter un textarea trop grand */
      height: auto; /* Permet l'auto-expansion */
      border: 2px solid var(--line);
      border-radius: 12px; /* Plus arrondi pour un look moderne */
      padding: 16px 18px; /* Padding confortable */
      font-size: 1.05rem; /* Légèrement plus grand pour meilleure lisibilité */
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
      line-height: 1.5; /* Meilleur espacement des lignes */
      resize: none; /* Désactive le resize manuel, on gère l'auto-expansion */
      overflow-y: auto; /* Scroll si le contenu dépasse max-height */
      transition: all 0.3s ease, height 0.1s ease;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Ombre subtile */
    }
    
    #msgInput:focus {
      border-color: #3b82f6;
      box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
      outline: none;
    }
    
    /* Bouton Envoyer - Bleu primaire (action principale) */
    #sendBtn {
      background: linear-gradient(135deg, var(--primary, #1a3f6e), #164a83);
      color: white;
      border: none;
      border-radius: 12px; /* Cohérent avec msgInput */
      padding: 12px 24px; /* Padding vertical augmenté */
      align-self: flex-end; /* S'aligne en bas avec le textarea */
      height: auto; /* Hauteur automatique basée sur le contenu */
      min-height: 70px; /* Hauteur minimale confortable */
      font-weight: 600;
      font-size: 0.95rem;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
      cursor: pointer;
      transition: var(--transition, all 0.3s ease);
      box-shadow: 0 2px 12px rgba(26, 63, 110, 0.3);
      min-width: 110px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    #sendBtn span {
      line-height: 1.4;
      text-align: center;
      white-space: nowrap;
    }
    
    #sendBtn:hover:not(:disabled) {
      background: linear-gradient(135deg, #164a83, #0f3a6b);
      transform: translateY(-2px);
      box-shadow: 0 4px 16px rgba(26, 63, 110, 0.4);
    }
    
    #sendBtn:active {
      transform: translateY(0);
    }
    
    #sendBtn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
      box-shadow: 0 2px 8px rgba(26, 63, 110, 0.15);
    }
    
    /* Bouton Terminer - Rouge (action destructive) */
    #endBtn {
      background: linear-gradient(135deg, var(--danger, #dc2626), #b91c1c);
      color: white;
      border: none;
      border-radius: 12px;
      padding: 12px 24px;
      align-self: flex-end;
      height: auto;
      min-height: 70px;
      font-weight: 600;
      font-size: 0.95rem;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
      cursor: pointer;
      transition: var(--transition, all 0.3s ease);
      box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3);
      min-width: 110px;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    #endBtn span {
      line-height: 1.4;
      text-align: center;
      white-space: nowrap;
    }
    
    #endBtn:hover:not(:disabled) {
      background: linear-gradient(135deg, #b91c1c, #991b1b);
      transform: translateY(-2px);
      box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
    }
    
    #endBtn:active {
      transform: translateY(0);
    }
    
    /* Bouton Auto Scroll - Gris/Accent avec état toggle */
    #autoScrollToggle {
      background: linear-gradient(135deg, var(--muted, #5a5a6d), #4a4a5a);
      color: white;
      border: none;
      border-radius: 12px;
      padding: 12px 20px;
      align-self: flex-end;
      height: auto;
      min-height: 70px;
   💬 INFOBULLES AMÉLIORÉES
============================================ */

.tooltip-enhanced {
    position: relative !important;
}

.tooltip-enhanced::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 37, 41, 0.95) !important;
    color: white !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    max-width: 320px !important;
    white-space: normal !important;
    text-align: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    pointer-events: none !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
}

.tooltip-enhanced::before {
    content: "";
    position: absolute;
    bottom: 117%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(33, 37, 41, 0.95) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 999 !important;
}

.tooltip-enhanced:hover::after,
.tooltip-enhanced:hover::before {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(-4px) !important;
}

/* ============================================
   🎊 ANIMATIONS DE FIN DE SIMULATION
============================================ */

@keyframes celebration {
    0% { transform: scale(1); }
    15% { transform: scale(1.1) rotate(-2deg); }
    30% { transform: scale(1.05) rotate(1deg); }
    45% { transform: scale(1.08) rotate(-1deg); }
    60% { transform: scale(1.02) rotate(0.5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes pulse-success {
    0% { 
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
        background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
        background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
        background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    }
}

@keyframes confetti-fall {
    0% { 
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.simulation-ended .bar {
    animation: celebration 0.8s ease-out;
}

.simulation-ended #endBtn {
    animation: pulse-success 1.5s infinite;
}

/* ============================================
   📱 RESPONSIVE DESIGN AMÉLIORÉ
============================================ */

@media (max-width: 768px) {
    .bar {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;               /* Padding conservé même sur mobile */
        width: 100% !important;
    }
    
    #msgInput {
        width: 100% !important;                 /* Pleine largeur sur mobile */
        min-width: 100% !important;
        min-height: 100px !important;           /* Hauteur augmentée sur mobile */
        margin-bottom: 12px !important;
        font-size: 1rem !important;             /* Taille optimisée mobile */
    }
    
    #sendBtn, #endBtn, #autoScrollToggle {
        min-width: 100% !important;
        height: 44px !important;
        font-size: 0.9rem !important;
    }
    
    .tooltip-enhanced::after {
        max-width: 250px !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .bar {
        padding: 8px !important;
    }
    
    #sendBtn, #endBtn, #autoScrollToggle {
        height: 40px !important;
        font-size: 0.85rem !important;
        padding: 8px 16px !important;
    }
}

/* ============================================
   🌙 MODE SOMBRE (si activé)
============================================ */

@media (prefers-color-scheme: dark) {
    .bar {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
        border-color: #3a4a5c !important;
    }
    
    #msgInput {
        background: #34495e !important;
        color: white !important;
        border-color: #3a4a5c !important;
    }
    
    #msgInput:focus {
        border-color: #3498db !important;
        box-shadow: 
            inset 0 2px 4px rgba(0, 0, 0, 0.1),
            0 0 0 3px rgba(52, 152, 219, 0.2) !important;
    }
}

/* ============================================
   ⚡ ÉTATS INTERACTIFS AVANCÉS
============================================ */

.button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.button-loading {
    position: relative;
    pointer-events: none;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* États focus améliorés pour accessibilité */
#sendBtn:focus,
#endBtn:focus,
#autoScrollToggle:focus {
    outline: 2px solid #3498db !important;
    outline-offset: 2px !important;
}

/* Transitions fluides pour tous les changements d'état */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}/**
 * 🎉 Notifications et Alertes de Simulation Améliorées
 * Système de notifications modernes pour l'UX de simulation
 */

/* ============================================
   🚨 SYSTÈME DE NOTIFICATIONS MODERNES
============================================ */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border-left: 4px solid #3498db;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    cursor: pointer;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Types de notifications */
.notification.success {
    border-left-color: #2ecc71;
}

.notification.success .notification-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.notification.warning {
    border-left-color: #f39c12;
}

.notification.warning .notification-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.error .notification-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.notification.info {
    border-left-color: #3498db;
}

.notification.info .notification-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Éléments de notification */
.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(149, 165, 166, 0.1);
    color: #7f8c8d;
}

/* ============================================
   ⏰ NOTIFICATIONS TEMPS DE SIMULATION
============================================ */

.time-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 10001;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    animation: timeWarningPulse 1s ease-in-out infinite;
    min-width: 300px;
}

.time-notification.critical {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: criticalTimeWarning 0.5s ease-in-out infinite alternate;
}

.time-notification .time-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.time-notification .time-message {
    font-size: 1rem;
    opacity: 0.95;
}

/* ============================================
   🎊 ANIMATION DE FIN DE SIMULATION
============================================ */

.simulation-complete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.simulation-complete-overlay.show {
    opacity: 1;
    visibility: visible;
}

.completion-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: completionCardAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.completion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2ecc71, #3498db, #9b59b6, #e74c3c, #f39c12);
    animation: rainbowSlide 2s ease-in-out infinite;
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: completionBounce 1.5s ease-in-out infinite;
}

.completion-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.completion-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 30px;
    line-height: 1.5;
}

.completion-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.completion-stat {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.completion-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.completion-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.completion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.completion-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.completion-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.completion-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    text-decoration: none;
    color: white;
}

.completion-btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.completion-btn-secondary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    text-decoration: none;
    color: white;
}

/* ============================================
   🎨 ANIMATIONS SPÉCIALISÉES
============================================ */

@keyframes timeWarningPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.02); 
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    }
}

@keyframes criticalTimeWarning {
    0% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

@keyframes completionCardAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes completionBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes rainbowSlide {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* ============================================
   📱 RESPONSIVE DESIGN
============================================ */

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 12px 16px;
    }
    
    .time-notification {
        min-width: 280px;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .completion-card {
        padding: 25px 20px;
        margin: 20px;
    }
    
    .completion-title {
        font-size: 1.5rem;
    }
    
    .completion-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .completion-actions {
        flex-direction: column;
    }
    
    .completion-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .notification {
        font-size: 0.85rem;
    }
    
    .notification-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .time-notification {
        min-width: 250px;
        font-size: 0.9rem;
    }
    
    .completion-card {
        padding: 20px 15px;
    }
    
    .completion-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ============================================
   🌙 MODE SOMBRE ADAPTATIF
============================================ */

@media (prefers-color-scheme: dark) {
    .notification {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .notification-title {
        color: #ecf0f1;
    }
    
    .notification-message {
        color: #bdc3c7;
    }
    
    .completion-card {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .completion-title {
        color: #ecf0f1;
    }
    
    .completion-subtitle {
        color: #bdc3c7;
    }
    
    .completion-stat {
        background: linear-gradient(135deg, #34495e, #3a4a5c);
        border-color: #4a5a6c;
    }
    
    .completion-stat-number {
        color: #ecf0f1;
    }
    
    .completion-stat-label {
        color: #bdc3c7;
    }
}

/* ============================================
   ⚡ ÉTATS INTERACTIFS AVANCÉS
============================================ */

.notification:hover {
    transform: translateX(-5px);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

.notification.removing {
    animation: notificationSlideOut 0.3s ease forwards;
}

@keyframes notificationSlideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
        max-height: 100px;
        margin-bottom: 12px;
    }
    50% {
        transform: translateX(100%);
        opacity: 0;
        max-height: 100px;
        margin-bottom: 12px;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Effets de focus pour accessibilité */
.notification:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.completion-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}