/* ==========================================================================
   CSS DÉDIÉ : FABRIQUE_VERBES.PHP - La Fabrique des Verbes (Conjugaison)
   Fichier : css/fabrique_verbes.css
   École de l'Enfant-Jésus - Morlanwelz
   ========================================================================== */

:root {
    --machine-bg: #1e293b;
    --machine-border: #334155;
    --brass-light: #fef08a;
    --brass: #eab308;
    --brass-dark: #854d0e;
    --copper: #d97706;
    --copper-dark: #78350f;
    --slot-bg: #0f172a;
    --text-brass: #fef08a;
    --gear-color: #64748b;
  }

  /* Conteneur principal */
  .verb-container {
    width: 100%;
    max-width: 1060px;
    box-sizing: border-box;
    margin: 0 auto 25px auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    font-family: 'Nunito', sans-serif;
  }

  /* Barre de statistiques et utilitaires */
  .stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
  }

  .stat-badge {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    padding: 3px 12px;
    border-radius: 20px;
    color: #0284c7;
    font-family: 'Fredoka', sans-serif;
    font-size: 15px;
    font-weight: 700;
  }

  .stat-badge.gold {
    color: #b45309;
    border-color: #fde68a;
    background: #fef3c7;
  }

  .stats-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .util-top-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    padding: 6px 14px;
    border-radius: 10px;
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .util-top-btn:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0284c7;
    transform: translateY(-1px);
  }

  /* Disposition principale : Panneau gauche & Machine droite */
  .verb-workspace {
    display: flex;
    gap: 22px;
    align-items: flex-start;
  }

  /* Colonne Gauche : Modes & Carnet des Règles SeGEC */
  .verb-sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
  }

  .side-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  }

  .side-card-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mode-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mode-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 9px 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mode-btn:hover {
    border-color: #f59e0b;
    background: #fffbeb;
    transform: translateY(-1px);
  }

  .mode-btn.active {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border-color: #b45309;
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
  }

  .mode-btn-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
  }

  .mode-btn-desc {
    font-size: 11px;
    opacity: 0.9;
    line-height: 1.3;
  }

  /* Filtres de temps (Présent, Imparfait, Futur) */
  .tense-selector-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
  }

  .tense-pill-btn {
    flex: 1 1 auto;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 6px 8px;
    font-family: 'Fredoka', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
  }

  .tense-pill-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
  }

  .tense-pill-btn.active {
    background: #0284c7;
    border-color: #0284c7;
    color: white;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
  }

  /* Carnet des régularités SeGEC (Conjugaison Horizontale) */
  .segec-book {
    background: #fffdf5;
    border: 2px dashed #f59e0b;
    border-radius: 16px;
    padding: 14px;
    box-sizing: border-box;
  }

  .segec-book-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .rule-badge-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .rule-badge {
    background: #ffffff;
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #78350f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
  }

  .rule-badge.unlocked {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
  }

  .rule-badge .icon {
    font-size: 14px;
  }

  /* Colonne Droite : L'Atelier de la Machine à Verbes */
  .verb-main-arena {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Carte de Consigne / Mission */
  .mission-card {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .mission-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #d97706, #f59e0b, #0284c7);
  }

  .mission-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-family: 'Fredoka', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    background: #fef3c7;
    color: #b45309;
  }

  .mission-instruction {
    font-family: 'Fredoka', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
  }

  .mission-instruction .target-pill {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 2px 10px;
    border-radius: 8px;
    border: 1.5px solid #bfdbfe;
    display: inline-block;
    margin: 0 3px;
  }

  .mission-context-sentence {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    font-style: italic;
  }

  /* LA GRANDE MACHINE À SOUS DE CONJUGAISON */
  .machine-chassis {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 4px solid #475569;
    border-radius: 24px;
    padding: 20px 24px 24px 24px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.4), inset 0 2px 6px rgba(255,255,255,0.15);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Plaque de titre de la machine en laiton */
  .machine-header-plate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    border: 2px solid #fef08a;
    border-radius: 12px;
    padding: 6px 16px;
    color: #fef08a;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  }

  .machine-header-plate .rivet {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fef08a 30%, #78350f 100%);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  }

  /* Espace des 3 Rouleaux */
  .reels-stage {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
  }

  /* Boîtier d'un Rouleau individuel */
  .reel-column {
    flex: 1 1 0;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .reel-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
  }

  /* Boutons Flèches 🔼 et 🔽 */
  .reel-arrow-btn {
    width: 44px;
    height: 32px;
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border: 2px solid #64748b;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  }

  .reel-arrow-btn:hover {
    background: #475569;
    border-color: #f59e0b;
    color: #f59e0b;
    transform: scale(1.05);
  }

  .reel-arrow-btn:active {
    transform: scale(0.95);
    background: #0f172a;
  }

  /* Fenêtre du Rouleau (Slot Window) */
  .reel-window {
    width: 100%;
    height: 140px;
    background: #090d16;
    border: 3px solid #64748b;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 8px 18px rgba(0,0,0,0.8), 0 4px 12px rgba(0,0,0,0.4);
    touch-action: pan-y;
  }

  .reel-window.locked {
    border-color: #f59e0b;
    box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.4), 0 0 10px rgba(245, 158, 11, 0.2);
  }

  /* Ligne de visée centrale (Payline vitrée) */
  .payline-indicator {
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 48px;
    margin-top: -24px;
    border-top: 2px solid rgba(245, 158, 11, 0.5);
    border-bottom: 2px solid rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.08);
    pointer-events: none;
    z-index: 5;
  }

  /* Conteneur défilant des éléments */
  .reel-track {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    will-change: transform;
  }

  .reel-track.spinning {
    transition: transform 0.8s cubic-bezier(0.1, 0.9, 0.2, 1);
  }

  .reel-item {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #94a3b8;
    opacity: 0.45;
    transition: all 0.2s ease;
    padding: 0 6px;
    box-sizing: border-box;
    text-align: center;
  }

  .reel-item.active {
    color: #ffffff;
    opacity: 1;
    font-size: 23px;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
  }

  /* Couleurs thématiques par rouleau */
  #reel-pronoun .reel-item.active {
    color: #38bdf8;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  }

  #reel-stem .reel-item.active {
    color: #facc15;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
  }

  #reel-ending .reel-item.active {
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
  }

  /* Petit badge de rappel d'infinitif sous le rouleau 2 */
  .stem-infinitive-pill {
    font-family: 'Fredoka', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 8px;
    border-radius: 8px;
    min-height: 18px;
  }

  /* Zone d'assemblage du verbe en direct sous les rouleaux */
  .live-assembled-view {
    background: #0b0f19;
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
    flex-wrap: wrap;
  }

  .assembled-part {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 8px;
  }

  .assembled-pronoun { color: #38bdf8; }
  .assembled-stem { color: #facc15; }
  .assembled-ending { 
    color: #4ade80; 
    border-bottom: 3px solid #4ade80;
  }

  .assembled-equals {
    color: #64748b;
    font-size: 20px;
  }

  .assembled-full {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* Commandes de la machine : Actionner le levier et Spin aléatoire */
  .machine-controls-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .machine-btn {
    padding: 12px 24px;
    border-radius: 14px;
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
  }

  .btn-forge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    border: 2px solid #34d399;
  }

  .btn-forge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
  }

  .btn-spin-slot {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
    border: 2px solid #fde68a;
  }

  .btn-spin-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.5);
  }

  .btn-skip-verb {
    background: #334155;
    color: #e2e8f0;
    border: 2px solid #475569;
  }

  .btn-skip-verb:hover {
    background: #475569;
    color: white;
  }

  /* Boîte de feedback pédagogique */
  .feedback-box {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 18px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    transition: all 0.3s ease;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .feedback-box.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
  }

  .feedback-box.warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
  }

  .feedback-box.info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
  }

  /* Modale Explications & Règles */
  .modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 16px;
    box-sizing: border-box;
  }

  .modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-card {
    background: white;
    border-radius: 24px;
    max-width: 520px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.25s ease;
  }

  .modal-overlay.visible .modal-card {
    transform: translateY(0);
  }

  .modal-icon {
    font-size: 44px;
    margin-bottom: 6px;
  }

  .modal-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
  }

  .modal-body {
    font-size: 14px;
    color: #475569;
    line-height: 1.55;
    text-align: left;
    margin-bottom: 20px;
  }

  .modal-body p {
    margin: 8px 0;
  }

  .modal-close-btn {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  }

  /* Responsive Design */
  @media screen and (max-width: 880px) {
    .verb-workspace {
      flex-direction: column;
    }
    .verb-sidebar {
      flex: 1 1 100%;
      width: 100%;
    }
  }

  @media screen and (max-width: 600px) {
    .verb-container {
      padding: 12px;
      border-radius: 16px;
    }
    .reels-stage {
      gap: 8px;
    }
    .reel-item {
      font-size: 15px;
    }
    .reel-item.active {
      font-size: 18px;
    }
    .live-assembled-view {
      font-size: 18px;
      gap: 6px;
    }
    .machine-btn {
      padding: 10px 16px;
      font-size: 14px;
    }
  }
