/* ============================================ */
/* NAMESPACE ISOLATION - Prevent Moodle conflicts */
/* ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  color: #3D3028;
  background: #FFFAF5;
  overflow: hidden;
}

/* Module container - isolates all internal styles */
#zoe-lockout-module {
  width: 100%;
  height: 100%;
  position: relative;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  color: #3D3028;
  line-height: 1.5;
}

/* Reset Moodle overrides within our module */
#zoe-lockout-module *,
#zoe-lockout-module *::before,
#zoe-lockout-module *::after {
  box-sizing: border-box;
}

#zoe-lockout-module h1,
#zoe-lockout-module h2,
#zoe-lockout-module h3,
#zoe-lockout-module h4,
#zoe-lockout-module h5,
#zoe-lockout-module h6 {
  margin: 0;
  padding: 0;
  font-family: inherit;
  line-height: 1.3;
}

#zoe-lockout-module p {
  margin: 0;
  padding: 0;
}

#zoe-lockout-module ul,
#zoe-lockout-module ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

#zoe-lockout-module a {
  color: inherit;
  text-decoration: none;
}

#zoe-lockout-module button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

#zoe-lockout-module input,
#zoe-lockout-module select,
#zoe-lockout-module textarea {
  font-family: inherit;
  font-size: inherit;
}

#zoe-lockout-module img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================ */
/* MODE IMMERSIF - Header minimaliste          */
/* ============================================ */
#zoe-lockout-module #header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(135deg, rgba(255, 250, 245, 0.95) 0%, rgba(245, 237, 228, 0.95) 100%);
  border-bottom: 2px solid #C17F24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 2500;
  backdrop-filter: blur(10px);
}

#zoe-lockout-module .header-title h1 {
  color: #3D3028;
  font-size: 1.1rem;
  font-weight: 500;
}

#zoe-lockout-module #phase-nav {
  display: flex;
  gap: 5px;
}

#zoe-lockout-module .phase-btn {
  background: transparent;
  border: 1px solid #D4C4B0;
  color: #6B5D4D;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  transition: all 0.3s ease;
  position: relative;
  line-height: 1.2;
}

#zoe-lockout-module .phase-btn:hover:not(:disabled) {
  background: rgba(193, 127, 36, 0.15);
  border-color: #C17F24;
  color: #3D3028;
}

#zoe-lockout-module .phase-btn:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .phase-btn.active {
  background: #C17F24;
  border-color: #C17F24;
  color: #fff;
}

#zoe-lockout-module .phase-btn.completed {
  border-color: #5D8A48;
}

#zoe-lockout-module .phase-btn.completed::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #5D8A48;
  color: #fff;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoe-lockout-module .phase-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

#zoe-lockout-module .phase-btn.locked::before {
  content: '🔒';
  margin-right: 4px;
  font-size: 10px;
}

/* ============================================ */
/* MODE IMMERSIF - Panorama plein écran        */
/* ============================================ */
#main {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 35px;
  display: block;
}

#pano {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a1a1a;
}

/* ============================================ */
/* DRAWERS RÉTRACTABLES                        */
/* ============================================ */

/* Drawer générique */
#zoe-lockout-module .drawer {
  position: fixed;
  z-index: 2000;
  background: #FFFAF5;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

#zoe-lockout-module .drawer[aria-hidden="true"] {
  pointer-events: none;
}

/* Drawer gauche (pédagogie) */
#zoe-lockout-module .drawer-left {
  top: 50px;
  left: 0;
  bottom: 35px;
  width: 320px;
  border-right: 2px solid #C17F24;
  transform: translateX(-100%);
}

#zoe-lockout-module .drawer-left.open {
  transform: translateX(0);
  pointer-events: auto;
}

/* Drawer droit (scènes) */
#zoe-lockout-module .drawer-right {
  top: 50px;
  right: 0;
  bottom: 35px;
  width: 260px;
  border-left: 2px solid #C17F24;
  transform: translateX(100%);
}

#zoe-lockout-module .drawer-right.open {
  transform: translateX(0);
  pointer-events: auto;
}

/* Drawer haut (phases) */
#zoe-lockout-module .drawer-top {
  top: 50px;
  left: 0;
  right: 0;
  height: auto;
  max-height: 150px;
  border-bottom: 2px solid #C17F24;
  transform: translateY(-100%);
  padding: 15px 20px;
  padding-top: 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#zoe-lockout-module .drawer-top.open {
  transform: translateY(0);
  pointer-events: auto;
}

/* Navigation des phases dans le drawer */
#zoe-lockout-module #phases-drawer #phase-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Bouton de fermeture des drawers */
#zoe-lockout-module .drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(212, 196, 176, 0.3);
  border: 1px solid rgba(212, 196, 176, 0.5);
  color: #6B5D4D;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

#zoe-lockout-module .drawer-close:hover {
  background: rgba(192, 57, 43, 0.2);
  border-color: #C0392B;
  color: #C0392B;
}

#zoe-lockout-module .drawer-close:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .drawer-title {
  color: #C17F24;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Backdrop */
#zoe-lockout-module .drawer-backdrop {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 35px;
  background: transparent;
  z-index: 1400;
  pointer-events: none;
}

#zoe-lockout-module .drawer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* S'assurer que les drawers et leur contenu reçoivent les clics */
#zoe-lockout-module .drawer {
  pointer-events: auto;
}

#zoe-lockout-module .drawer * {
  pointer-events: auto;
}

#zoe-lockout-module .drawer button,
#zoe-lockout-module .drawer .btn-action,
#zoe-lockout-module .drawer .tts-button {
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
}

/* ============================================ */
/* BOUTONS TOGGLE FLOTTANTS                    */
/* ============================================ */
#zoe-lockout-module .drawer-toggles {
  position: fixed;
  z-index: 2100;
  pointer-events: none;
}

#zoe-lockout-module .drawer-toggle {
  position: fixed;
  background: linear-gradient(135deg, #C17F24 0%, #D4A84B 100%);
  border: none;
  color: #FFFAF5;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(193, 127, 36, 0.4);
  transition: all 0.3s ease;
  pointer-events: auto;
  z-index: 2100;
}

#zoe-lockout-module .drawer-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(193, 127, 36, 0.5);
}

#zoe-lockout-module .drawer-toggle:focus-visible {
  outline: 3px solid #FFFAF5;
  outline-offset: 2px;
}

#zoe-lockout-module .drawer-toggle:active {
  transform: scale(0.98);
}

#zoe-lockout-module .drawer-toggle.active {
  background: linear-gradient(135deg, #5D8A48 0%, #4A7039 100%);
  box-shadow: 0 4px 15px rgba(93, 138, 72, 0.4);
}

#zoe-lockout-module .toggle-icon {
  font-size: 1.2rem;
}

#zoe-lockout-module .toggle-label {
  display: inline;
}

/* Position du bouton gauche (pédagogie) */
#zoe-lockout-module .toggle-left {
  left: 15px;
  top: 65px;
}

/* Position du bouton droit (scènes) */
#zoe-lockout-module .toggle-right {
  right: 15px;
  top: 65px;
}

/* Position du bouton haut (phases) */
#zoe-lockout-module .toggle-top {
  left: 50%;
  transform: translateX(-50%);
  top: 65px;
}

#zoe-lockout-module .toggle-top:hover {
  transform: translateX(-50%) scale(1.05);
}

#zoe-lockout-module .toggle-top:active {
  transform: translateX(-50%) scale(0.98);
}

/* Masquer les boutons toggle quand leurs panneaux sont ouverts */
#zoe-lockout-module .drawer-left.open ~ .drawer-toggles .toggle-left,
#zoe-lockout-module .drawer-right.open ~ .drawer-toggles .toggle-right,
#zoe-lockout-module .drawer-top.open ~ .drawer-toggles .toggle-top,
#zoe-lockout-module #pedagogy-panel.open ~ .toggle-left,
#zoe-lockout-module #scene-sidebar.open ~ .toggle-right,
#zoe-lockout-module #phases-drawer.open ~ .toggle-top {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* Version alternative avec body classes */
body.drawer-left-open .toggle-left {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

body.drawer-right-open .toggle-right {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

body.drawer-top-open .toggle-top {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.8);
}

/* Styles spécifiques au panneau pédagogique */
#zoe-lockout-module #pedagogy-panel {
  padding: 15px;
  padding-top: 50px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#zoe-lockout-module #phase-header {
  border-bottom: 1px solid #D4C4B0;
  padding-bottom: 10px;
}

#zoe-lockout-module #phase-title {
  color: #C17F24;
  font-size: 1rem;
  margin-bottom: 5px;
}

#zoe-lockout-module #phase-progress-indicator {
  color: #6B5D4D;
  font-size: 0.8rem;
}

#zoe-lockout-module #phase-intro-text {
  color: #3D3028;
  font-size: 0.85rem;
  line-height: 1.5;
}

#zoe-lockout-module #pedagogy-panel h3 {
  color: #C17F24;
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#zoe-lockout-module #objectives-list {
  list-style: none;
  padding-left: 0;
}

#zoe-lockout-module #objectives-list li {
  color: #3D3028;
  font-size: 0.8rem;
  padding: 5px 0 5px 20px;
  position: relative;
  line-height: 1.4;
}

#zoe-lockout-module #objectives-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #C17F24;
}

#zoe-lockout-module #instructions-text {
  color: #6B5D4D;
  font-size: 0.8rem;
  line-height: 1.5;
  font-style: italic;
}

#zoe-lockout-module #phase-steps {
  background: rgba(193, 127, 36, 0.08);
  border: 1px solid rgba(193, 127, 36, 0.3);
  border-radius: 8px;
  padding: 12px;
}

#zoe-lockout-module #phase-steps h3 {
  margin-bottom: 10px;
}

#steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: none;
}

#zoe-lockout-module .step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(193, 127, 36, 0.15);
  transition: all 0.2s ease;
}

#zoe-lockout-module .step-item:last-child {
  border-bottom: none;
}

#zoe-lockout-module .step-item .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #C17F24;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

#zoe-lockout-module .step-item .step-label {
  color: #3D3028;
  font-size: 0.8rem;
  line-height: 1.3;
}

#zoe-lockout-module .step-item.visited .step-number {
  background: #5D8A48;
}

#zoe-lockout-module .step-item.visited .step-label {
  color: #5D8A48;
}


#zoe-lockout-module #hotspot-info-panel {
  background: rgba(193, 127, 36, 0.15);
  border: 1px solid #C17F24;
  border-radius: 6px;
  padding: 12px;
  margin-top: 20px;
}

#zoe-lockout-module #hotspot-info-panel h3 {
  color: #C17F24;
  font-size: 0.75rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#zoe-lockout-module #hotspot-info-title {
  color: #3D3028;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

#zoe-lockout-module #hotspot-info-text {
  color: #5A4D3E;
  font-size: 0.75rem;
  line-height: 1.4;
}

#zoe-lockout-module #phase-actions {
  margin-top: auto;
  padding-top: 10px;
}

#zoe-lockout-module .btn-action {
  width: 100%;
  background: linear-gradient(135deg, #5D8A48, #4A7039);
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

#zoe-lockout-module .btn-action:hover {
  background: linear-gradient(135deg, #4A7039, #5D8A48);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(93, 138, 72, 0.3);
}

#zoe-lockout-module .btn-action:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .btn-action:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(93, 138, 72, 0.2);
}

/* Styles spécifiques au sidebar des scènes */
#zoe-lockout-module #scene-sidebar {
  padding: 15px;
  padding-top: 50px;
  overflow-y: auto;
}

#zoe-lockout-module #scene-sidebar h2 {
  color: #C17F24;
  font-size: 0.85rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#zoe-lockout-module #scene-list {
  list-style: none;
}

#zoe-lockout-module #scene-list li {
  margin-bottom: 6px;
}

#zoe-lockout-module .scene-btn {
  width: 100%;
  text-align: left;
  background: rgba(212, 196, 176, 0.2);
  border: 1px solid transparent;
  color: #6B5D4D;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

#zoe-lockout-module .scene-btn:hover {
  background: rgba(193, 127, 36, 0.15);
  border-color: #C17F24;
  color: #3D3028;
}

#zoe-lockout-module .scene-btn:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .scene-btn.active {
  background: rgba(193, 127, 36, 0.25);
  border-color: #C17F24;
  color: #3D3028;
}

/* A11Y: Contraste amélioré pour texte informatif */
.no-scenes {
  color: #6B5D4D;
  font-style: italic;
  font-size: 0.75rem;
}

/* A11Y: Classe pour masquer visuellement mais garder accessible aux lecteurs d'écran */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* A11Y: Skip link pour navigation clavier */
#zoe-lockout-module .skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #C17F24;
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  transition: top 0.3s ease;
}

#zoe-lockout-module .skip-link:focus {
  top: 0;
}

#zoe-lockout-module .hotspot {
  /* A11Y: Reset des styles button natifs */
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  /* Styles originaux */
  width: 32px;
  height: 32px;
  cursor: pointer;
  pointer-events: auto !important;
  z-index: 100;
  position: relative;
}

/* A11Y: Focus visible pour les hotspots */
#zoe-lockout-module .hotspot:focus-visible {
  outline: none;
}

#zoe-lockout-module .hotspot:focus-visible .hotspot-icon {
  outline: 3px solid #C17F24;
  outline-offset: 3px;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(255,255,255,0.4);
}

#zoe-lockout-module .hotspot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(0,0,0,0.2);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 16px;
  line-height: 1;
}

#zoe-lockout-module .hotspot:hover .hotspot-icon {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(255,255,255,0.4);
}

#zoe-lockout-module .hotspot-icon:empty::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

#zoe-lockout-module .hotspot.required:not(.visited) .hotspot-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(193, 127, 36, 0.7); }
  70% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 12px rgba(193, 127, 36, 0); }
  100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(193, 127, 36, 0); }
}

#zoe-lockout-module .hotspot.visited .hotspot-icon {
  opacity: 0.85;
  border-color: #5D8A48;
  background-color: #5D8A48;
}

#zoe-lockout-module .hotspot.visited .hotspot-icon::after {
  content: '✓';
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  width: auto;
  height: auto;
}

#zoe-lockout-module .hotspot.validated .hotspot-icon {
  animation: validationPulse 0.6s ease-out;
}

@keyframes validationPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(93, 138, 72, 0.8);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(93, 138, 72, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(93, 138, 72, 0);
  }
}

#zoe-lockout-module .hotspot-info .hotspot-icon { background: #8B6DB8; }
#zoe-lockout-module .hotspot-image .hotspot-icon { background: #5D8A48; }
#zoe-lockout-module .hotspot-video .hotspot-icon { background: #C0392B; }
#zoe-lockout-module .hotspot-quiz .hotspot-icon { background: #8B6DB8; }
#zoe-lockout-module .hotspot-link .hotspot-icon { background: #D68910; }

#zoe-lockout-module .hotspot-video .hotspot-icon::after {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 8px solid #fff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

#zoe-lockout-module .hotspot.hotspot-numbered {
  overflow: visible;
}

#zoe-lockout-module .hotspot-step-number {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 20px;
  height: 20px;
  background: #C17F24;
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

#zoe-lockout-module .hotspot.visited .hotspot-step-number {
  background: #5D8A48;
}

/* ============================================ */
/* BOUTON NAVIGATION PHASE SUIVANTE (fixe)     */
/* Position fixe en bas de l'écran             */
/* ============================================ */
#zoe-lockout-module #nav-next-phase-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  animation: slideUpFadeIn 0.5s ease-out;
}

#zoe-lockout-module #nav-next-phase-container.hidden {
  display: none;
}

#zoe-lockout-module #nav-next-phase-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #C17F24 0%, #D68910 100%);
  border: 3px solid #fff;
  border-radius: 50px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(193, 127, 36, 0.3);
  animation: navBtnPulse 2s infinite;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#zoe-lockout-module #nav-next-phase-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(193, 127, 36, 0.4);
}

#zoe-lockout-module #nav-next-phase-btn:active {
  transform: scale(0.98);
}

#zoe-lockout-module #nav-next-phase-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

#zoe-lockout-module .nav-next-label {
  white-space: nowrap;
}

#zoe-lockout-module .nav-next-arrow {
  font-size: 1.4rem;
  animation: arrowBounce 1s infinite;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes navBtnPulse {
  0% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(193, 127, 36, 0.6);
  }
  70% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(193, 127, 36, 0);
  }
  100% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(193, 127, 36, 0);
  }
}

@keyframes arrowBounce {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

#zoe-lockout-module #calibration-overlay {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(193, 127, 36, 0.95);
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  z-index: 500;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

#zoe-lockout-module #calibration-coords {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  margin-bottom: 10px;
}

#zoe-lockout-module #calibration-coords span {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
}

#zoe-lockout-module #calibration-coords strong {
  font-size: 1.1rem;
}

#zoe-lockout-module #calib-copy {
  background: #fff;
  color: #C17F24;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

#zoe-lockout-module #calib-copy:hover {
  background: #FFF8F0;
}

#zoe-lockout-module #calib-copy:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#zoe-lockout-module #calib-copy:active {
  transform: scale(0.97);
}

#zoe-lockout-module .btn-calibration {
  background: transparent;
  border: 1px solid #D68910 !important;
  color: #D68910 !important;
}

#zoe-lockout-module .btn-calibration:hover {
  background: rgba(214, 137, 16, 0.15) !important;
}

#zoe-lockout-module .btn-calibration.active {
  background: #D68910 !important;
  color: #fff !important;
}

#zoe-lockout-module .btn-calibration:focus-visible {
  outline: 2px solid #C17F24 !important;
  outline-offset: 2px;
}

.calibration-active #pano {
  cursor: crosshair !important;
}

.calibration-active .hotspot {
  pointer-events: none !important;
  opacity: 0.3;
}

#zoe-lockout-module .feedback-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  margin-bottom: 12px;
}

.badge-key {
  background-color: #C17F24;
}

.badge-info {
  background-color: #8B6DB8;
}

#zoe-lockout-module .feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#zoe-lockout-module .feedback-modal.active {
  opacity: 1;
  visibility: visible;
}

#zoe-lockout-module .feedback-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 48, 40, 0.75);
  backdrop-filter: blur(4px);
}

#zoe-lockout-module .feedback-modal-content {
  position: relative;
  background: linear-gradient(145deg, #FFFAF5 0%, #F5EDE4 100%);
  border: 2px solid #C17F24;
  border-radius: 16px;
  padding: 0;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(193, 127, 36, 0.2),
    0 0 80px rgba(193, 127, 36, 0.1),
    0 25px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

#zoe-lockout-module .feedback-modal.active .feedback-modal-content {
  transform: scale(1);
}

#zoe-lockout-module .feedback-modal-header {
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%);
  padding: 25px 25px 20px 25px;
  border-bottom: 1px solid rgba(212, 196, 176, 0.5);
}

#zoe-lockout-module .feedback-modal-header h3 {
  color: #3D3028;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

#zoe-lockout-module #feedback-modal-media {
  padding: 0;
  background: #EDE4D9;
  overflow: hidden;
}

/* ============================================ */
/* CAROUSEL MEDIA                              */
/* ============================================ */
#zoe-lockout-module .media-carousel {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  position: relative;
  background: #EDE4D9;
}

.carousel-track {
  display: flex;
  flex-direction: row;
  transition: transform 0.35s ease-in-out;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  max-width: 100%;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.carousel-slide img {
  max-height: 240px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.carousel-slide video {
  max-height: 240px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.75);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  border: 3px solid #C17F24;
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.carousel-arrow:hover:not(:disabled) {
  background: #C17F24;
  border-color: #3D3028;
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.carousel-arrow:focus-visible {
  outline: 3px solid #C17F24;
  outline-offset: 3px;
}

.carousel-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.carousel-arrow.left {
  left: 10px;
}

.carousel-arrow.right {
  right: 10px;
}

.carousel-pagination {
  text-align: center;
  padding: 10px 0 14px 0;
  margin-bottom: 8px;
  color: #C17F24;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(255, 250, 245, 0.95);
  border-bottom: 1px solid rgba(193, 127, 36, 0.2);
}

/* Legacy support: keep old styles for sidebar */
#zoe-lockout-module #feedback-modal-media img,
#zoe-lockout-module #feedback-sidebar-media img {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  flex-shrink: 0;
}

#zoe-lockout-module #feedback-modal-media video,
#zoe-lockout-module #feedback-sidebar-media video {
  width: 100%;
  max-height: 300px;
  flex-shrink: 0;
}

/* Responsive carousel */
@media (max-width: 600px) {
  .media-carousel {
    max-height: 220px;
  }

  .carousel-slide {
    height: 200px;
  }

  .carousel-slide img,
  .carousel-slide video {
    max-height: 180px;
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-width: 2px;
  }

  .carousel-arrow.left {
    left: 6px;
  }

  .carousel-arrow.right {
    right: 6px;
  }

  .carousel-pagination {
    padding: 8px 0 12px 0;
    margin-bottom: 6px;
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .media-carousel {
    max-height: 180px;
  }

  .carousel-slide {
    height: 160px;
  }

  .carousel-slide img,
  .carousel-slide video {
    max-height: 140px;
  }
}

#zoe-lockout-module .feedback-modal-text {
  padding: 25px;
  max-height: 200px;
  overflow-y: auto;
}

#zoe-lockout-module #feedback-modal-description {
  color: #5A4D3E;
  font-size: 0.95rem;
  line-height: 1.7;
}

#zoe-lockout-module .feedback-modal-actions {
  padding: 20px 25px;
  background: linear-gradient(135deg, #F5EDE4 0%, #EDE4D9 100%);
  border-top: 1px solid rgba(212, 196, 176, 0.5);
  display: flex;
  justify-content: center;
}

#zoe-lockout-module .btn-validate {
  background: linear-gradient(135deg, #5D8A48, #4A7039);
  border: none;
  color: #fff;
  padding: 14px 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(93, 138, 72, 0.3);
}

#zoe-lockout-module .btn-validate:hover {
  background: linear-gradient(135deg, #6B9E54, #5D8A48);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(93, 138, 72, 0.4);
}

#zoe-lockout-module .btn-validate:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 3px;
}

#zoe-lockout-module .btn-validate:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(93, 138, 72, 0.3);
}

#zoe-lockout-module .btn-validate .validate-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

/* ============================================ */
/* TTS: Boutons de lecture vocale              */
/* ============================================ */
#zoe-lockout-module .tts-controls {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

#zoe-lockout-module .tts-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EDE4D9;
  border: 1px solid #C17F24;
  color: #3D3028;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

#zoe-lockout-module .tts-button:hover {
  background: #F5EDE4;
  border-color: #D4A84B;
}

#zoe-lockout-module .tts-button:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
  background: #F5EDE4;
}

#zoe-lockout-module .tts-button:active {
  transform: scale(0.98);
}

#zoe-lockout-module .tts-button.tts-playing {
  background: #C17F24;
  color: #FFFAF5;
  border-color: #C17F24;
}

#zoe-lockout-module .tts-button.tts-stop {
  background: rgba(192, 57, 43, 0.1);
  border-color: #C0392B;
  color: #C0392B;
}

#zoe-lockout-module .tts-button.tts-stop:hover {
  background: rgba(192, 57, 43, 0.2);
}

/* TTS dans sidebar */
#zoe-lockout-module .feedback-sidebar .tts-controls {
  padding: 10px 15px;
  border-top: 1px solid rgba(212, 196, 176, 0.5);
  margin-top: auto;
}

/* TTS dans panneau pédagogique */
#zoe-lockout-module .tts-panel-controls {
  margin-top: 10px;
  margin-right: 0;
}

#zoe-lockout-module .tts-panel-controls .tts-button {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* TTS dans glossaire */
#zoe-lockout-module .glossary-details-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 25px 30px;
  overflow-y: auto;
  background: #FFFAF5;
}

#zoe-lockout-module .tts-glossary-controls {
  margin-bottom: 10px;
  margin-right: 0;
}

#zoe-lockout-module .tts-glossary-controls .tts-button {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* TTS dans micro-QCM */
.microquiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#zoe-lockout-module .tts-microquiz-controls {
  margin-right: 0;
}

#zoe-lockout-module .tts-microquiz-controls .tts-button {
  padding: 6px 10px;
  font-size: 0.8rem;
}

#zoe-lockout-module .feedback-sidebar {
  position: fixed;
  top: 50px;
  right: 0;
  width: 350px;
  bottom: 35px;
  bottom: calc(35px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #FFFAF5 0%, #F5EDE4 100%);
  border-left: 2px solid #C17F24;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
  /* iOS Safari fixes */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#zoe-lockout-module .feedback-sidebar.active {
  transform: translateX(0);
}

#zoe-lockout-module .feedback-sidebar-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(212, 196, 176, 0.5);
  border: 2px solid rgba(212, 196, 176, 0.8);
  color: #3D3028;
  font-size: 28px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
  /* iOS touch target fix */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#zoe-lockout-module .feedback-sidebar-close:hover {
  background: rgba(192, 57, 43, 0.2);
  border-color: #C0392B;
  color: #C0392B;
}

#zoe-lockout-module .feedback-sidebar-close:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .feedback-sidebar .feedback-badge {
  margin-bottom: 10px;
}

#zoe-lockout-module .feedback-sidebar-header {
  padding: 20px 25px 20px 25px;
  border-bottom: 1px solid rgba(212, 196, 176, 0.5);
}

#zoe-lockout-module .feedback-sidebar-header h3 {
  color: #3D3028;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  padding-right: 40px;
}

#zoe-lockout-module #feedback-sidebar-media {
  background: #EDE4D9;
  max-height: 400px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

#zoe-lockout-module #feedback-sidebar-media img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  flex-shrink: 0;
}

#zoe-lockout-module #feedback-sidebar-media video {
  width: 100%;
  max-height: 220px;
  flex-shrink: 0;
}

#zoe-lockout-module .feedback-sidebar-text {
  padding: 20px 25px;
  flex: 1;
  overflow-y: auto;
}

#zoe-lockout-module #feedback-sidebar-description {
  color: #5A4D3E;
  font-size: 0.9rem;
  line-height: 1.7;
}

#zoe-lockout-module .modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* iOS Safari fixes */
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom) 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#zoe-lockout-module .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 48, 40, 0.75);
}

#zoe-lockout-module .modal-content {
  position: relative;
  background: #FFFAF5;
  border-radius: 8px;
  padding: 20px;
  max-width: 90vw;
  max-height: 90dvh; /* Dynamic viewport height for iOS */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #D4C4B0;
  box-sizing: border-box;
}

/* iOS Safari safe area padding */
@supports (-webkit-touch-callout: none) {
  .modal-content {
    padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
  }
}

#modal-body {
  max-width: 100%;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-body img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 4px;
}

#modal-body video {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 4px;
}

#modal-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
}

#zoe-lockout-module .nav-btn {
  background: #C17F24;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s ease;
}

#zoe-lockout-module .nav-btn:hover:not(:disabled) {
  background: #A86A1D;
}

#zoe-lockout-module .nav-btn:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#modal-counter {
  color: #6B5D4D;
  font-size: 0.8rem;
}

#modal-caption {
  color: #3D3028;
  margin-top: 12px;
  text-align: center;
  font-size: 0.85rem;
  max-width: 600px;
  line-height: 1.4;
}

#zoe-lockout-module .quiz-content {
  width: 700px;
  max-width: 95vw;
  max-height: 85dvh; /* Dynamic viewport height for iOS */
  padding: 30px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* iOS Safari safe area for quiz */
@supports (-webkit-touch-callout: none) {
  .quiz-content {
    padding-bottom: calc(env(safe-area-inset-bottom) + 30px);
  }
}

#zoe-lockout-module #quiz-header {
  text-align: center;
  margin-bottom: 25px;
}

#zoe-lockout-module #quiz-header h2 {
  color: #C17F24;
  margin-bottom: 8px;
}

#zoe-lockout-module #quiz-header p {
  color: #6B5D4D;
  font-size: 0.9rem;
}

/* A11Y: Fieldset accessible pour le quiz final */
#zoe-lockout-module .quiz-question {
  border: none;
  padding: 0;
  margin: 0;
}

#zoe-lockout-module .quiz-question-legend {
  color: #3D3028;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.4;
  display: block;
  width: 100%;
}

#zoe-lockout-module .quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#zoe-lockout-module .quiz-option {
  display: flex;
  align-items: center;
  background: rgba(212, 196, 176, 0.2);
  border: 1px solid #D4C4B0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#zoe-lockout-module .quiz-option:hover {
  background: rgba(193, 127, 36, 0.1);
  border-color: #C17F24;
}

#zoe-lockout-module .quiz-option:focus-within {
  background: rgba(193, 127, 36, 0.15);
  border-color: #C17F24;
  box-shadow: 0 0 0 2px rgba(193, 127, 36, 0.3);
}

#zoe-lockout-module .quiz-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 12px 0 12px 15px;
  accent-color: #C17F24;
  cursor: pointer;
  flex-shrink: 0;
}

#zoe-lockout-module .quiz-option input[type="radio"]:focus-visible {
  outline: 3px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .quiz-option label {
  flex: 1;
  padding: 12px 15px 12px 12px;
  color: #3D3028;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.4;
}

#zoe-lockout-module #quiz-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #D4C4B0;
}

#zoe-lockout-module #quiz-progress {
  color: #6B5D4D;
  font-size: 0.85rem;
}

#zoe-lockout-module #quiz-submit-container {
  text-align: center;
  margin-top: 20px;
}

#zoe-lockout-module .btn-submit {
  background: linear-gradient(135deg, #5D8A48, #4A7039);
  border: none;
  color: #fff;
  padding: 15px 40px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

#zoe-lockout-module .btn-submit:hover {
  background: linear-gradient(135deg, #6B9E54, #5D8A48);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(93, 138, 72, 0.3);
}

#zoe-lockout-module .btn-submit:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 3px;
}

#zoe-lockout-module .btn-submit:active {
  transform: translateY(0);
}

#zoe-lockout-module #quiz-results {
  text-align: center;
}

#results-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

#zoe-lockout-module #quiz-results h3 {
  color: #5D8A48;
}

#results-score {
  color: #3D3028;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

#results-message {
  color: #6B5D4D;
  margin-bottom: 20px;
}

#results-details {
  margin: 20px 0;
}

#results-details h4 {
  color: #6B5D4D;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.result-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  margin: 3px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.result-item.correct {
  background: rgba(93, 138, 72, 0.2);
  color: #5D8A48;
}

.result-item.incorrect {
  background: rgba(192, 57, 43, 0.2);
  color: #C0392B;
}

#zoe-lockout-module .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: #6B5D4D;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

#zoe-lockout-module .close-btn:hover {
  background: rgba(192, 57, 43, 0.2);
  color: #C0392B;
}

#zoe-lockout-module .close-btn:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

/* ============================================ */
/* FOOTER COMPACT                              */
/* ============================================ */
#zoe-lockout-module #footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35px;
  background: linear-gradient(135deg, rgba(255, 250, 245, 0.95) 0%, rgba(245, 237, 228, 0.95) 100%);
  border-top: 1px solid #D4C4B0;
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 12px;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

#progress-container {
  flex: 1;
  max-width: 300px;
  height: 8px;
  background: #EDE4D9;
  border-radius: 4px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5D8A48, #6B9E54);
  border-radius: 4px;
  transition: width 0.3s ease;
}

#progress-text {
  color: #6B5D4D;
  font-size: 0.8rem;
}

/* A11Y: Contraste amélioré pour boutons footer */
#zoe-lockout-module .btn-small {
  background: transparent;
  border: 1px solid #D4C4B0;
  color: #5A4D3E;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s ease;
}

#zoe-lockout-module .btn-small:hover {
  border-color: #C17F24;
  color: #C17F24;
}

#zoe-lockout-module .btn-small:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module #scorm-status {
  margin-left: auto;
}

#zoe-lockout-module #connection-status {
  color: #C0392B;
  font-size: 0.75rem;
}

#zoe-lockout-module #connection-status.connected {
  color: #5D8A48;
}

#zoe-lockout-module .hidden {
  display: none !important;
}

/* ============================================
   Glossary Styles
   ============================================ */

#zoe-lockout-module .header-btn {
  background: rgba(139, 109, 184, 0.15);
  border: 1px solid #8B6DB8;
  color: #8B6DB8;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

#zoe-lockout-module .header-btn:hover {
  background: rgba(139, 109, 184, 0.25);
  border-color: #7A5BA7;
  color: #7A5BA7;
}

#zoe-lockout-module .header-btn:focus-visible {
  outline: 2px solid #8B6DB8;
  outline-offset: 2px;
}

#zoe-lockout-module .glossary-icon {
  font-size: 1rem;
}

#zoe-lockout-module .glossary-content {
  width: 900px;
  max-width: 95vw;
  max-height: 85dvh; /* Dynamic viewport height for iOS */
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* iOS Safari safe area for glossary */
@supports (-webkit-touch-callout: none) {
  .glossary-content {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

#zoe-lockout-module .glossary-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #D4C4B0;
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%);
}

#zoe-lockout-module .glossary-header .badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

#zoe-lockout-module .glossary-header .badge-info {
  background: #8B6DB8;
  color: white;
}

#zoe-lockout-module .glossary-header h2 {
  color: #3D3028;
  font-size: 1.2rem;
  font-weight: 600;
}

#zoe-lockout-module .glossary-search-bar {
  padding: 15px 30px;
  background: #F5EDE4;
  border-bottom: 1px solid #D4C4B0;
}

#zoe-lockout-module #glossary-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #D4C4B0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #3D3028;
  background: #FFFAF5;
  transition: all 0.2s ease;
}

#zoe-lockout-module #glossary-search-input:focus {
  outline: none;
  border-color: #8B6DB8;
  box-shadow: 0 0 0 3px rgba(139, 109, 184, 0.15);
}

/* A11Y: Contraste amélioré pour placeholder */
#zoe-lockout-module #glossary-search-input::placeholder {
  color: #6B5D4D;
}

#zoe-lockout-module .glossary-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#zoe-lockout-module .glossary-list {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid #D4C4B0;
  background: rgba(245, 237, 228, 0.5);
  padding: 15px 0;
}

#zoe-lockout-module .glossary-category {
  margin-bottom: 15px;
}

#zoe-lockout-module .glossary-category-title {
  color: #8B6DB8;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 20px;
  margin: 0;
  background: rgba(139, 109, 184, 0.1);
  border-top: 1px solid rgba(139, 109, 184, 0.2);
  border-bottom: 1px solid rgba(139, 109, 184, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

#zoe-lockout-module .glossary-category-title .category-icon {
  font-size: 1rem;
}

#zoe-lockout-module .glossary-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

#zoe-lockout-module .glossary-item {
  padding: 10px 20px;
  color: #3D3028;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(212, 196, 176, 0.3);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

#zoe-lockout-module .glossary-item .item-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

#zoe-lockout-module .glossary-item:hover {
  background: rgba(193, 127, 36, 0.1);
  color: #C17F24;
}

/* A11Y: Focus visible pour navigation clavier */
#zoe-lockout-module .glossary-item:focus-visible {
  background: rgba(193, 127, 36, 0.15);
  color: #C17F24;
  outline: 2px solid #C17F24;
  outline-offset: -2px;
}

#zoe-lockout-module .glossary-item.selected {
  background: rgba(193, 127, 36, 0.2);
  color: #C17F24;
  font-weight: 600;
  border-left: 3px solid #C17F24;
}

#zoe-lockout-module .glossary-details {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  background: #FFFAF5;
}

/* A11Y: Contraste amélioré */
#zoe-lockout-module .glossary-placeholder {
  color: #6B5D4D;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}

#zoe-lockout-module .glossary-no-results {
  color: #6B5D4D;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  padding: 30px 20px;
}

#zoe-lockout-module .glossary-term-title {
  color: #3D3028;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

#zoe-lockout-module .glossary-term-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 109, 184, 0.15);
  color: #8B6DB8;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 20px;
}

#zoe-lockout-module .glossary-term-category .category-icon {
  font-size: 1rem;
}

#zoe-lockout-module .glossary-term-definition {
  color: #5A4D3E;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

#zoe-lockout-module .glossary-term-aliases {
  color: #6B5D4D;
  font-size: 0.85rem;
  background: rgba(212, 196, 176, 0.2);
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 3px solid #C17F24;
}

#zoe-lockout-module .glossary-term-aliases strong {
  color: #C17F24;
}

/* Glossary link in feedbacks */
#zoe-lockout-module .glossary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8B6DB8;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  background: rgba(139, 109, 184, 0.1);
  border: 1px solid rgba(139, 109, 184, 0.3);
  border-radius: 6px;
  margin-right: 15px;
  transition: all 0.2s ease;
}

#zoe-lockout-module .glossary-link:hover {
  background: rgba(139, 109, 184, 0.2);
  border-color: #8B6DB8;
  color: #7A5BA7;
}

#zoe-lockout-module .feedback-sidebar-text .glossary-link {
  margin-top: 15px;
  display: inline-flex;
}

#zoe-lockout-module .feedback-modal-actions {
  padding: 20px 25px;
  background: linear-gradient(135deg, #F5EDE4 0%, #EDE4D9 100%);
  border-top: 1px solid rgba(212, 196, 176, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

/* ============================================ */
/* iOS Safari specific fixes for feedback sidebar */
@supports (-webkit-touch-callout: none) {
  .feedback-sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .feedback-modal-actions {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .feedback-sidebar .tts-controls {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* RESPONSIVE - MODE IMMERSIF                  */
/* ============================================ */
@media (max-width: 1200px) {
  .drawer-left {
    width: 280px;
  }
  .drawer-right {
    width: 220px;
  }
  .feedback-sidebar {
    width: 320px;
  }
}

@media (max-width: 900px) {
  .drawer-left {
    width: 260px;
  }
  .drawer-right {
    width: 200px;
  }
  .phase-btn {
    padding: 6px 8px;
    font-size: 0.6rem;
  }
  .feedback-sidebar {
    width: 100%;
    max-width: 350px;
  }
  .feedback-modal-content {
    width: 95%;
    max-width: 500px;
  }
  .toggle-label {
    display: none;
  }
  .drawer-toggle {
    padding: 10px 12px;
  }
}

@media (max-width: 768px) {
  .drawer-left,
  .drawer-right {
    width: 100%;
    max-width: 320px;
  }

  .drawer-top {
    max-height: 200px;
    padding-top: 55px;
  }

  .glossary-content {
    width: 100%;
    max-width: 100vw;
    max-height: 100dvh; /* Dynamic viewport height for iOS */
    border-radius: 0;
  }

  .glossary-body {
    flex-direction: column;
  }

  .glossary-list {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #D4C4B0;
  }

  .glossary-details {
    padding: 20px;
  }

  .header-btn span.glossary-icon + span {
    display: none;
  }
}

@media (max-width: 600px) {
  .feedback-sidebar {
    width: 100%;
    max-width: none;
  }

  .header-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* ============================================ */
/* MICRO-QCM PAR SCÈNE                         */
/* ============================================ */

#zoe-lockout-module #scene-quiz-modal {
  z-index: 2500;
  /* iOS Safari fixes */
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom) 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#zoe-lockout-module #scene-quiz-modal .modal-content.microquiz {
  max-width: 500px;
  width: 90%;
  background: #FFFAF5;
  border-radius: 12px;
  border: 2px solid #C17F24;
  box-shadow: 0 8px 32px rgba(61, 48, 40, 0.3);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 90dvh;
  animation: microquizFadeIn 0.4s ease-out;
}

/* iOS Safari safe area for micro-QCM */
@supports (-webkit-touch-callout: none) {
  #scene-quiz-modal .modal-content.microquiz {
    padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
  }
}

@keyframes microquizFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.microquiz-title {
  background: linear-gradient(135deg, #C17F24 0%, #D4A84B 100%);
  color: #FFFAF5;
  margin: 0;
  padding: 18px 25px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

/* A11Y: Fieldset et legend accessibles pour micro-QCM */
.microquiz-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.microquiz-legend,
#microquiz-question {
  color: #3D3028;
  font-size: 1rem;
  line-height: 1.6;
  padding: 25px 25px 20px;
  margin: 0;
  text-align: center;
  font-weight: 500;
  display: block;
  width: 100%;
}

#microquiz-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 25px 20px;
}

/* A11Y: Styles pour les options radio accessibles */
.microquiz-option {
  display: flex;
  align-items: center;
  background: #FFFAF5;
  border: 2px solid #D4C4B0;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.microquiz-option:hover:not(.selected-correct):not(.selected-wrong) {
  border-color: #C17F24;
  background: rgba(193, 127, 36, 0.08);
  transform: translateX(4px);
}

.microquiz-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 14px 0 14px 16px;
  accent-color: #C17F24;
  cursor: pointer;
  flex-shrink: 0;
}

.microquiz-option input[type="radio"]:focus-visible {
  outline: 3px solid #C17F24;
  outline-offset: 2px;
}

.microquiz-option label {
  flex: 1;
  padding: 14px 20px 14px 12px;
  color: #3D3028;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.4;
}

.microquiz-option input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.microquiz-option input[type="radio"]:disabled + label {
  cursor: not-allowed;
}

.microquiz-option.selected-correct {
  background: rgba(93, 138, 72, 0.15);
  border-color: #5D8A48;
}

.microquiz-option.selected-correct label {
  color: #5D8A48;
}

.microquiz-option.selected-wrong {
  background: rgba(192, 57, 43, 0.1);
  border-color: #C0392B;
}

.microquiz-option.selected-wrong label {
  color: #C0392B;
}

.microquiz-option.correct-answer {
  background: rgba(93, 138, 72, 0.15);
  border-color: #5D8A48;
}

.microquiz-option.correct-answer label {
  color: #5D8A48;
}

#microquiz-feedback {
  padding: 15px 25px;
  margin: 0 25px 15px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

#microquiz-feedback.correct {
  background: rgba(93, 138, 72, 0.15);
  border: 1px solid #5D8A48;
  color: #3D6B2E;
}

#microquiz-feedback.error {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid #C0392B;
  color: #A32B1F;
}

#microquiz-feedback.wrong {
  background: rgba(212, 196, 176, 0.3);
  border: 1px solid #D4C4B0;
  color: #6B5D4D;
}

#microquiz-close {
  display: block;
  margin: 0 auto 25px;
  padding: 12px 40px;
  background: linear-gradient(135deg, #C17F24 0%, #D4A84B 100%);
  border: none;
  border-radius: 8px;
  color: #FFFAF5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(193, 127, 36, 0.3);
}

/* iOS Safari: ensure button is visible above safe area */
@supports (-webkit-touch-callout: none) {
  #microquiz-close {
    margin-bottom: calc(25px + env(safe-area-inset-bottom));
  }
}

#microquiz-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(193, 127, 36, 0.4);
}

/* A11Y: Focus visible pour bouton Continuer */
#microquiz-close:focus-visible {
  outline: 3px solid #FFFAF5;
  outline-offset: 3px;
  box-shadow: 0 4px 12px rgba(193, 127, 36, 0.4);
}

#microquiz-close.hidden {
  display: none;
}

/* Responsive micro-QCM */
@media (max-width: 500px) {
  #scene-quiz-modal .modal-content.microquiz {
    width: 95%;
    margin: 10px;
  }

  .microquiz-title {
    font-size: 1rem;
    padding: 15px 20px;
  }

  #microquiz-question {
    font-size: 0.95rem;
    padding: 20px 20px 15px;
  }

  #microquiz-answers {
    padding: 0 20px 15px;
  }

  .microquiz-option input[type="radio"] {
    margin: 12px 0 12px 12px;
  }

  .microquiz-option label {
    padding: 12px 16px 12px 10px;
    font-size: 0.9rem;
  }
}

/* ======================================== */
/* EXERCICE EPI - CLASSEMENT PPE           */
/* ======================================== */

/* Bouton exercice dans le panneau pédagogique */
#zoe-lockout-module .btn-exercise {
  background: linear-gradient(135deg, #8B6DB8 0%, #7A5BA7 100%);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#zoe-lockout-module .btn-exercise:hover {
  background: linear-gradient(135deg, #7A5BA7 0%, #8B6DB8 100%);
}

/* Modal de l'exercice */
#zoe-lockout-module .epi-exercise-content {
  width: 900px;
  max-width: 95vw;
  max-height: 90dvh;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

#zoe-lockout-module .epi-exercise-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #D4C4B0;
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%);
}

#zoe-lockout-module .epi-exercise-header h2 {
  color: #3D3028;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
}

#zoe-lockout-module .epi-exercise-intro {
  color: #5A4D3E;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

#zoe-lockout-module .epi-exercise-categories-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

#zoe-lockout-module .epi-exercise-categories-legend li {
  color: #6B5D4D;
  font-size: 0.85rem;
  padding: 6px 12px;
  background: rgba(212, 196, 176, 0.3);
  border-radius: 6px;
}

#zoe-lockout-module .epi-exercise-categories-legend li:first-child {
  background: rgba(93, 138, 72, 0.15);
  border: 1px solid rgba(93, 138, 72, 0.3);
}

#zoe-lockout-module .epi-exercise-categories-legend li:last-child {
  background: rgba(139, 109, 184, 0.15);
  border: 1px solid rgba(139, 109, 184, 0.3);
}

/* Corps de l'exercice */
#zoe-lockout-module .epi-exercise-body {
  padding: 20px 30px;
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 300px;
}

/* Zone source des items */
#zoe-lockout-module .epi-items-source {
  flex: 1;
  min-width: 200px;
}

#zoe-lockout-module .epi-items-source h3 {
  color: #C17F24;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

#zoe-lockout-module .epi-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Item EPI */
#zoe-lockout-module .epi-item {
  background: #FFFAF5;
  border: 2px solid #D4C4B0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: grab;
  font-size: 0.9rem;
  color: #3D3028;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

#zoe-lockout-module .epi-item:hover {
  border-color: #C17F24;
  background: rgba(193, 127, 36, 0.08);
  transform: translateX(4px);
}

#zoe-lockout-module .epi-item:focus {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .epi-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

#zoe-lockout-module .epi-item.placed {
  padding-right: 36px;
}

#zoe-lockout-module .epi-item.correct {
  background: rgba(93, 138, 72, 0.15);
  border-color: #5D8A48;
  color: #3D6B2E;
}

#zoe-lockout-module .epi-item.incorrect {
  background: rgba(192, 57, 43, 0.1);
  border-color: #C0392B;
  color: #A32B1F;
}

/* Bouton de suppression */
#zoe-lockout-module .epi-item-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #C0392B;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#zoe-lockout-module .epi-item-remove:hover {
  background: rgba(192, 57, 43, 0.2);
  border-color: #C0392B;
}

/* Sélecteur d'item (alternative au drag) */
#zoe-lockout-module .epi-item-selector {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFFAF5;
  border: 2px solid #C17F24;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#zoe-lockout-module .epi-select-btn {
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  transition: background 0.2s ease;
}

#zoe-lockout-module .epi-select-btn:hover {
  background: rgba(193, 127, 36, 0.1);
}

#zoe-lockout-module .epi-select-btn.mandatory {
  color: #5D8A48;
  border-bottom: 1px solid #D4C4B0;
}

#zoe-lockout-module .epi-select-btn.other {
  color: #8B6DB8;
  border-bottom: 1px solid #D4C4B0;
}

#zoe-lockout-module .epi-select-btn.cancel {
  color: #6B5D4D;
  font-size: 0.8rem;
}

/* Zones de dépôt */
#zoe-lockout-module .epi-drop-zones {
  flex: 2;
  display: flex;
  gap: 15px;
}

#zoe-lockout-module .epi-drop-zone {
  flex: 1;
  background: rgba(212, 196, 176, 0.1);
  border: 2px dashed #D4C4B0;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

#zoe-lockout-module .epi-drop-zone h4 {
  color: #6B5D4D;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center;
}

#epi-drop-mandatory {
  border-color: rgba(93, 138, 72, 0.4);
  background: rgba(93, 138, 72, 0.05);
}

#epi-drop-mandatory h4 {
  color: #5D8A48;
}

#epi-drop-other {
  border-color: rgba(139, 109, 184, 0.4);
  background: rgba(139, 109, 184, 0.05);
}

#epi-drop-other h4 {
  color: #8B6DB8;
}

#zoe-lockout-module .epi-drop-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

#zoe-lockout-module .epi-drop-area.drag-over {
  background: rgba(193, 127, 36, 0.1);
  border: 2px dashed #C17F24;
}

/* Feedback */
#zoe-lockout-module .epi-exercise-feedback {
  margin: 0 30px 15px;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

#zoe-lockout-module .epi-exercise-feedback.success {
  background: rgba(93, 138, 72, 0.15);
  border: 1px solid #5D8A48;
  color: #3D6B2E;
}

#zoe-lockout-module .epi-exercise-feedback.error {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid #C0392B;
  color: #A32B1F;
}

/* Actions */
#zoe-lockout-module .epi-exercise-actions {
  padding: 20px 30px;
  background: linear-gradient(135deg, #F5EDE4 0%, #EDE4D9 100%);
  border-top: 1px solid #D4C4B0;
  display: flex;
  justify-content: center;
  gap: 15px;
}

#zoe-lockout-module .btn-secondary {
  background: transparent;
  border: 2px solid #D4C4B0;
  color: #6B5D4D;
}

#zoe-lockout-module .btn-secondary:hover {
  border-color: #C17F24;
  color: #C17F24;
  background: rgba(193, 127, 36, 0.08);
}

/* Responsive exercice EPI */
@media (max-width: 768px) {
  .epi-exercise-content {
    max-height: 100dvh;
  }

  .epi-exercise-body {
    flex-direction: column;
    padding: 15px 20px;
  }

  .epi-items-source {
    min-width: 100%;
  }

  .epi-drop-zones {
    flex-direction: column;
  }

  .epi-exercise-categories-legend {
    flex-direction: column;
    gap: 8px;
  }

  .epi-exercise-actions {
    flex-direction: column;
    padding: 15px 20px;
  }

  .epi-exercise-actions button {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .epi-exercise-header {
    padding: 20px 15px 15px;
  }

  .epi-exercise-header h2 {
    font-size: 1.1rem;
  }

  .epi-exercise-body {
    padding: 10px 15px;
  }

  .epi-drop-zone {
    padding: 10px;
  }

  .epi-drop-zone h4 {
    font-size: 0.75rem;
  }

  .epi-item {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .epi-exercise-feedback {
    margin: 0 15px 10px;
    padding: 12px 15px;
    font-size: 0.9rem;
  }
}

/* ============================================ */
/* MOODLE COMPATIBILITY FIX - EPI EXERCISE     */
/* ============================================ */
/* Forces stable layout in Moodle iframe context */

/* A — Force stable modal container in Moodle */
#zoe-lockout-module .modal-content.epi-exercise-content,
#zoe-lockout-module .epi-exercise-content {
  width: 900px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: 0 !important;
  position: relative !important;
}

/* B — Force horizontal layout for exercise body */
#zoe-lockout-module .epi-exercise-body {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;  /* ✅ CORRIGÉ : évite conflits */
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* B — Force drop zones container */
#zoe-lockout-module .epi-drop-zones {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  flex: 2 1 0% !important;
  min-width: 0 !important;
  gap: 15px !important;
}

/* B — Force each drop zone column to 50% */
#zoe-lockout-module .epi-drop-zone {
  flex: 1 1 50% !important;
  min-width: 120px !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

/* C — Fix items box model */
#zoe-lockout-module .epi-item {
  box-sizing: border-box !important;
  width: auto !important;
  max-width: 100% !important;
  flex-shrink: 0 !important;
}

#zoe-lockout-module .epi-items-source {
  flex: 1 1 auto !important;
  min-width: 180px !important;
  max-width: 280px !important;
}

#zoe-lockout-module .epi-items-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

/* D — Center footer buttons */
#zoe-lockout-module .epi-exercise-actions {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  flex-wrap: wrap !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .epi-exercise-actions button {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* E — Responsive override for mobile only */
@media (max-width: 700px) {
  .epi-exercise-body {
    flex-direction: column !important;
  }

  .epi-drop-zones {
    flex-direction: column !important;
  }

  .epi-items-source {
    max-width: 100% !important;
    min-width: 100% !important;
  }

  .epi-drop-zone {
    flex: 1 1 auto !important;
    min-width: 100% !important;
  }

  .epi-exercise-actions {
    flex-direction: column !important;
  }

  .epi-exercise-actions button {
    width: 100% !important;
  }
}

/* Prevent Moodle modal overrides */
#zoe-lockout-module .modal.epi-exercise-modal,
#zoe-lockout-module #epi-exercise-modal {
  position: fixed !important;
  z-index: 10000 !important;
}

#zoe-lockout-module .modal.epi-exercise-modal .modal-content,
#zoe-lockout-module #epi-exercise-modal .modal-content {
  transform: none !important;
  margin: auto !important;
}

/* ============================================ */
/* EXERCICE 7 - ORDONNER LES 4 ÉTAPES          */
/* ============================================ */

/* Modal de l'exercice */
#zoe-lockout-module .steps-exercise-content {
  width: 900px;
  max-width: 95vw;
  max-height: 90dvh;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

#zoe-lockout-module .steps-exercise-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #D4C4B0;
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%);
}

#zoe-lockout-module .steps-exercise-header h2 {
  color: #3D3028;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
}

#zoe-lockout-module .steps-exercise-intro {
  color: #5A4D3E;
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Corps de l'exercice */
#zoe-lockout-module .steps-exercise-body {
  padding: 20px 30px;
  display: flex;
  gap: 25px;
  flex: 1 1 auto;
  min-height: 0;  /* ✅ Évite les conflits de hauteur */
  overflow-y: auto;
}

/* Colonne source */
#zoe-lockout-module .steps-source-column {
  flex: 1;
  min-width: 280px;
}

#zoe-lockout-module .steps-source-column h3,
#zoe-lockout-module .steps-target-column h3 {
  color: #C17F24;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

#zoe-lockout-module .steps-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  padding: 10px;
  background: rgba(212, 196, 176, 0.1);
  border: 2px dashed #D4C4B0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

#zoe-lockout-module .steps-items-list--drag-over {
  background: rgba(193, 127, 36, 0.1);
  border-color: #C17F24;
}

/* Colonne cible */
#zoe-lockout-module .steps-target-column {
  flex: 1;
  min-width: 280px;
}

#zoe-lockout-module .steps-slots-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Carte d'étape */
#zoe-lockout-module .step-card {
  background: #FFFAF5;
  border: 2px solid #D4C4B0;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: grab;
  font-size: 0.9rem;
  color: #3D3028;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
  line-height: 1.4;
}

#zoe-lockout-module .step-card:hover {
  border-color: #C17F24;
  background: rgba(193, 127, 36, 0.08);
  transform: translateX(4px);
}

#zoe-lockout-module .step-card:focus {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .step-card--dragging {
  opacity: 0.5;
  cursor: grabbing;
}

#zoe-lockout-module .step-card--placed {
  padding-right: 36px;
  cursor: grab;
}

#zoe-lockout-module .step-card--correct {
  background: rgba(93, 138, 72, 0.15);
  border-color: #5D8A48;
  color: #3D6B2E;
}

#zoe-lockout-module .step-card--incorrect {
  background: rgba(192, 57, 43, 0.1);
  border-color: #C0392B;
  color: #A32B1F;
}

#zoe-lockout-module .step-card-label {
  display: block;
}

/* Bouton de suppression de carte */
#zoe-lockout-module .step-card-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #C0392B;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#zoe-lockout-module .step-card-remove:hover {
  background: rgba(192, 57, 43, 0.2);
  border-color: #C0392B;
}

/* Sélecteur de slot */
#zoe-lockout-module .step-card-selector {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFFAF5;
  border: 2px solid #C17F24;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#zoe-lockout-module .step-select-btn {
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  transition: background 0.2s ease;
  color: #3D3028;
}

#zoe-lockout-module .step-select-btn:hover:not(:disabled) {
  background: rgba(193, 127, 36, 0.1);
}

#zoe-lockout-module .step-select-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: #6B5D4D;
}

#zoe-lockout-module .step-select-btn.cancel {
  color: #6B5D4D;
  font-size: 0.8rem;
  border-top: 1px solid #D4C4B0;
}

/* Slot de placement */
#zoe-lockout-module .step-slot {
  background: rgba(212, 196, 176, 0.1);
  border: 2px dashed #D4C4B0;
  border-radius: 10px;
  padding: 10px 15px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

#zoe-lockout-module .step-slot--drag-over {
  background: rgba(193, 127, 36, 0.1);
  border-color: #C17F24;
  border-style: solid;
}

#zoe-lockout-module .step-slot--filled {
  border-style: solid;
  border-color: #D4C4B0;
  background: rgba(212, 196, 176, 0.05);
}

#zoe-lockout-module .step-slot--correct {
  border-color: #5D8A48;
  background: rgba(93, 138, 72, 0.08);
}

#zoe-lockout-module .step-slot--incorrect {
  border-color: #C0392B;
  background: rgba(192, 57, 43, 0.05);
}

#zoe-lockout-module .slot-number {
  color: #C17F24;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#zoe-lockout-module .step-slot--correct .slot-number {
  color: #5D8A48;
}

#zoe-lockout-module .step-slot--incorrect .slot-number {
  color: #C0392B;
}

#zoe-lockout-module .slot-content {
  flex: 1;
  display: flex;
  align-items: stretch;
}

#zoe-lockout-module .slot-content .step-card {
  flex: 1;
  margin: 0;
}

/* Feedback */
#zoe-lockout-module .steps-exercise-feedback {
  margin: 0 30px 15px;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  flex: 0 1 auto;
  max-height: 50vh;      /* ✅ Limite la hauteur */
  overflow-y: auto;      /* ✅ Scroll si nécessaire */
}

#zoe-lockout-module .steps-feedback--success {
  background: rgba(93, 138, 72, 0.15);
  border: 1px solid #5D8A48;
  color: #3D6B2E;
}

#zoe-lockout-module .steps-feedback--error {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid #C0392B;
  color: #A32B1F;
}

/* Révélation du bon ordre (exercice intuition) */
#zoe-lockout-module .steps-reveal {
  text-align: left;
}

#zoe-lockout-module .steps-reveal-title {
  font-weight: 700;
  color: #5D8A48;
  margin-bottom: 15px;
  font-size: 1rem;
}

#zoe-lockout-module .steps-reveal-list {
  margin: 0;
  padding-left: 25px;
}

#zoe-lockout-module .steps-reveal-list li {
  margin-bottom: 12px;
  color: #3D3D3D;
  line-height: 1.4;
}

#zoe-lockout-module .steps-reveal-list li strong {
  color: #2D2D2D;
}

#zoe-lockout-module .steps-reveal-list .step-description {
  font-size: 0.85rem;
  color: #6B5D4D;
  display: block;
  margin-top: 3px;
}

#zoe-lockout-module .steps-reveal-note {
  margin-top: 15px;
  font-style: italic;
  color: #C17F24;
  text-align: center;
}

/* État "solution affichée" : masquer les colonnes de l'exercice */
#zoe-lockout-module .steps-show-solution .steps-exercise-body {
  display: none;
  min-height: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

#zoe-lockout-module .steps-show-solution .steps-exercise-feedback {
  margin-top: 0;
  flex: 1 1 auto;  /* ✅ Prend l'espace libéré */
}

/* Actions */
#zoe-lockout-module .steps-exercise-actions {
  padding: 20px 30px;
  background: linear-gradient(135deg, #F5EDE4 0%, #EDE4D9 100%);
  border-top: 1px solid #D4C4B0;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-shrink: 0;  /* ✅ Ne pas disparaître */
}

/* Responsive exercice Étapes */
@media (max-width: 768px) {
  #zoe-lockout-module .steps-exercise-content {
    max-height: 100dvh;
  }

  #zoe-lockout-module .steps-exercise-body {
    flex-direction: column;
    padding: 15px 20px;
  }

  #zoe-lockout-module .steps-source-column,
  #zoe-lockout-module .steps-target-column {
    min-width: 100%;
  }

  #zoe-lockout-module .steps-exercise-actions {
    flex-direction: column;
    padding: 15px 20px;
  }

  #zoe-lockout-module .steps-exercise-actions button {
    width: 100%;
  }
}

@media (max-width: 500px) {
  #zoe-lockout-module .steps-exercise-header {
    padding: 20px 15px 15px;
  }

  #zoe-lockout-module .steps-exercise-header h2 {
    font-size: 1.1rem;
  }

  #zoe-lockout-module .steps-exercise-body {
    padding: 10px 15px;
  }

  #zoe-lockout-module .step-slot {
    padding: 8px 12px;
    min-height: 60px;
  }

  #zoe-lockout-module .step-card {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  #zoe-lockout-module .steps-exercise-feedback {
    margin: 0 15px 10px;
    padding: 12px 15px;
    font-size: 0.9rem;
  }
}

/* ============================================ */
/* EXERCICE CAS PRATIQUE - ALERTE HAUTE TENSION */
/* ============================================ */

/* Bouton spécifique cas pratique */
#zoe-lockout-module .btn-exercise-case-study {
  background: linear-gradient(135deg, #D35400 0%, #E67E22 100%);
}

#zoe-lockout-module .btn-exercise-case-study:hover {
  background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
}

/* Modal du cas pratique */
#zoe-lockout-module .case-study-content {
  width: 700px;
  max-width: 95vw;
  max-height: 90dvh;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* En-tête */
#zoe-lockout-module .case-study-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #D4C4B0;
  background: linear-gradient(135deg, #FFF5E6 0%, #FFE8CC 100%);
}

#zoe-lockout-module .case-study-badge {
  display: inline-block;
  background: linear-gradient(135deg, #D35400 0%, #E67E22 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

#zoe-lockout-module .case-study-header h2 {
  color: #3D3028;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 15px 0;
}

/* Barre de progression */
#zoe-lockout-module .case-study-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

#case-study-step-indicator {
  color: #6B5D4D;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

#zoe-lockout-module .case-study-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(212, 196, 176, 0.4);
  border-radius: 3px;
  overflow: hidden;
}

#zoe-lockout-module .case-study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #D35400 0%, #E67E22 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 25%;
}

/* Corps de l'exercice */
#zoe-lockout-module .case-study-body {
  padding: 25px 30px;
  flex: 1;
}

#zoe-lockout-module .case-study-step-title {
  color: #D35400;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#zoe-lockout-module .case-study-step-title::before {
  content: "⚡";
}

/* Contexte */
#zoe-lockout-module .case-study-context {
  background: rgba(212, 196, 176, 0.2);
  border-left: 4px solid #D35400;
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 0 8px 8px 0;
  color: #3D3028;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Question */
#zoe-lockout-module .case-study-question {
  color: #3D3028;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-left: 5px;
}

/* Choix */
#zoe-lockout-module .case-study-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#zoe-lockout-module .case-study-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFAF5;
  border: 2px solid #D4C4B0;
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  color: #3D3028;
  transition: all 0.2s ease;
}

#zoe-lockout-module .case-study-choice:hover:not(:disabled) {
  border-color: #D35400;
  background: rgba(211, 84, 0, 0.05);
  transform: translateX(4px);
}

#zoe-lockout-module .case-study-choice:focus {
  outline: 2px solid #D35400;
  outline-offset: 2px;
}

#zoe-lockout-module .case-study-choice:disabled {
  cursor: default;
  opacity: 0.8;
}

#zoe-lockout-module .case-study-choice.selected {
  border-width: 2px;
}

#zoe-lockout-module .case-study-choice.correct {
  background: rgba(93, 138, 72, 0.15);
  border-color: #5D8A48;
}

#zoe-lockout-module .case-study-choice.incorrect {
  background: rgba(192, 57, 43, 0.1);
  border-color: #C0392B;
}

.choice-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: linear-gradient(135deg, #D35400 0%, #E67E22 100%);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

#zoe-lockout-module .case-study-choice.correct .choice-letter {
  background: linear-gradient(135deg, #5D8A48 0%, #6B9D56 100%);
}

#zoe-lockout-module .case-study-choice.incorrect .choice-letter {
  background: linear-gradient(135deg, #C0392B 0%, #E74C3C 100%);
}

.choice-text {
  flex: 1;
  line-height: 1.5;
  padding-top: 2px;
}

/* Feedback */
#zoe-lockout-module .case-study-feedback {
  margin-top: 20px;
  padding: 15px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}

#zoe-lockout-module .case-study-feedback.success {
  background: rgba(93, 138, 72, 0.15);
  border: 1px solid rgba(93, 138, 72, 0.3);
  color: #3D6B2E;
}

#zoe-lockout-module .case-study-feedback.error {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #A32B1F;
}

#zoe-lockout-module .case-study-feedback.partial {
  background: rgba(211, 84, 0, 0.1);
  border: 1px solid rgba(211, 84, 0, 0.3);
  color: #A34500;
}

/* Actions */
#zoe-lockout-module .case-study-actions {
  padding: 15px 30px 25px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  border-top: 1px solid #D4C4B0;
  background: #FFFAF5;
}

#zoe-lockout-module .case-study-actions .btn-validate {
  background: linear-gradient(135deg, #5D8A48 0%, #6B9D56 100%);
}

#zoe-lockout-module .case-study-actions .btn-validate:hover {
  background: linear-gradient(135deg, #6B9D56 0%, #5D8A48 100%);
}

/* Responsive cas pratique */
@media (max-width: 600px) {
  .case-study-content {
    max-height: 95dvh;
  }

  .case-study-header {
    padding: 20px;
  }

  .case-study-header h2 {
    font-size: 1.2rem;
  }

  .case-study-body {
    padding: 20px;
  }

  .case-study-step-title {
    font-size: 1rem;
  }

  .case-study-context {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .case-study-question {
    font-size: 0.95rem;
  }

  .case-study-choice {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .choice-letter {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 0.8rem;
  }

  .case-study-feedback {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .case-study-actions {
    padding: 15px 20px 20px;
  }

  .case-study-actions button {
    flex: 1;
    min-width: 120px;
  }
}

/* ============================================ */
/* EXERCICE REPÉRAGE 360° - PHASE 1            */
/* ============================================ */

/* Bouton exercice violet */
#zoe-lockout-module .btn-exercise-purple {
  background: linear-gradient(135deg, #7B5CB0 0%, #5D4290 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 3px 8px rgba(123, 92, 176, 0.3);
}

#zoe-lockout-module .btn-exercise-purple:hover {
  background: linear-gradient(135deg, #8B6CC0 0%, #6D52A0 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(123, 92, 176, 0.4);
}

/* Bouton exercice orange (Phase 4 HT) */
#zoe-lockout-module .btn-exercise-orange {
  background: linear-gradient(135deg, #D35400 0%, #E67E22 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 3px 8px rgba(211, 84, 0, 0.3);
}

#zoe-lockout-module .btn-exercise-orange:hover {
  background: linear-gradient(135deg, #E67E22 0%, #F39C12 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(211, 84, 0, 0.4);
}

/* Bouton exercice terminé */
#zoe-lockout-module .btn-exercise-completed {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
  box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3) !important;
  cursor: pointer;
}

#zoe-lockout-module .btn-exercise-completed:hover {
  background: linear-gradient(135deg, #2ecc71 0%, #58d68d 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4) !important;
}

/* Modal 360° */
#zoe-lockout-module .click360-content {
  width: 90vw;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#zoe-lockout-module .click360-header {
  padding: 25px 30px 15px;
  text-align: center;
  border-bottom: 1px solid #E8DFD0;
}

#zoe-lockout-module .click360-header h2 {
  color: #7B5CB0;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

#zoe-lockout-module .click360-intro {
  color: #6B5D4D;
  font-size: 0.95rem;
  line-height: 1.5;
}

#zoe-lockout-module .click360-body {
  padding: 20px 30px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Compteur */
#zoe-lockout-module .click360-counter {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #4D4D4D;
  padding: 10px;
  background: rgba(123, 92, 176, 0.08);
  border-radius: 8px;
}

#zoe-lockout-module .click360-counter-found {
  color: #7B5CB0;
  font-size: 1.3rem;
}

#zoe-lockout-module .click360-counter-total {
  color: #7B5CB0;
}

/* Liste des cibles */
#zoe-lockout-module .click360-targets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#zoe-lockout-module .click360-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: rgba(123, 92, 176, 0.05);
  border: 2px solid rgba(123, 92, 176, 0.2);
  border-radius: 10px;
  transition: all 0.3s ease;
}

#zoe-lockout-module .click360-target-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(123, 92, 176, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #7B5CB0;
  flex-shrink: 0;
}

#zoe-lockout-module .click360-target-label {
  flex: 1;
  font-weight: 500;
  color: #4D4D4D;
}

#zoe-lockout-module .click360-target-status {
  font-size: 0.85rem;
  color: #888;
}

/* Cible trouvée */
#zoe-lockout-module .click360-target--found {
  background: rgba(93, 138, 72, 0.1);
  border-color: #5D8A48;
}

#zoe-lockout-module .click360-target--found .click360-target-icon {
  background: #5D8A48;
  color: white;
}

#zoe-lockout-module .click360-target--found .click360-target-label {
  color: #3D6B2E;
}

#zoe-lockout-module .click360-target--found .click360-target-status {
  color: #5D8A48;
  font-weight: 600;
}

/* Instruction */
#zoe-lockout-module .click360-instruction {
  padding: 15px;
  background: rgba(193, 127, 36, 0.1);
  border: 1px solid rgba(193, 127, 36, 0.3);
  border-radius: 8px;
  text-align: center;
  color: #8B6914;
  font-size: 0.95rem;
}

/* Feedback */
#zoe-lockout-module .click360-feedback {
  padding: 15px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  background: rgba(123, 92, 176, 0.1);
  color: #5D4290;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoe-lockout-module .click360-feedback.feedback-success {
  background: rgba(93, 138, 72, 0.15);
  color: #3D6B2E;
  border: 1px solid #5D8A48;
}

#zoe-lockout-module .click360-feedback.feedback-error {
  background: rgba(192, 57, 43, 0.1);
  color: #A32B1F;
  border: 1px solid #C0392B;
}

#zoe-lockout-module .click360-feedback.feedback-info {
  background: rgba(193, 127, 36, 0.1);
  color: #8B6914;
  border: 1px solid #C17F24;
}

/* Actions */
#zoe-lockout-module .click360-actions {
  padding: 20px 30px;
  background: linear-gradient(135deg, #F5EDE4 0%, #EDE4D9 100%);
  border-top: 1px solid #D4C4B0;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .click360-content {
    width: 95vw;
    max-height: 95vh;
  }

  .click360-header {
    padding: 20px;
  }

  .click360-header h2 {
    font-size: 1.2rem;
  }

  .click360-body {
    padding: 15px;
  }

  .click360-counter {
    font-size: 1rem;
  }

  .click360-target {
    padding: 10px 12px;
  }

  .click360-actions {
    padding: 15px 20px;
  }

  .click360-actions button {
    flex: 1;
    min-width: 100px;
  }
}

/* ============================================ */
/* HOTSPOTS CACHÉS (EXERCICE 360° PHASE 1)     */
/* ============================================ */

/* Hotspot masqué - invisible et non cliquable */
/* IMPORTANT: Ne pas utiliser transform car Marzipano l'utilise pour positionner */
#zoe-lockout-module .hotspot.hotspot-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Animation de révélation du hotspot */
/* Utilise uniquement opacity, pas transform */
@keyframes hotspotReveal {
  0% {
    opacity: 0;
    visibility: visible;
  }
  100% {
    opacity: 1;
    visibility: visible;
  }
}

/* Hotspot révélé - animation d'apparition */
#zoe-lockout-module .hotspot.hotspot-revealed {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  animation: hotspotReveal 0.5s ease-out forwards;
}

/* Mise en valeur temporaire après révélation */
#zoe-lockout-module .hotspot.hotspot-just-revealed {
  box-shadow: 0 0 20px 8px rgba(123, 92, 176, 0.6),
              0 0 40px 15px rgba(123, 92, 176, 0.3) !important;
}

#zoe-lockout-module .hotspot.hotspot-just-revealed::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 3px solid rgba(123, 92, 176, 0.8);
  border-radius: 50%;
  animation: hotspotPulse 1s ease-out 2;
}

@keyframes hotspotPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ============================================ */
/* INDICES VISUELS EXERCICES REPÉRAGE          */
/* ============================================ */

/* Animation de halo pulsant subtil pour les zones à trouver */
@keyframes hintGlow {
  0%, 100% {
    box-shadow: 0 0 15px 5px rgba(193, 127, 36, 0.3),
                0 0 30px 10px rgba(193, 127, 36, 0.15);
  }
  50% {
    box-shadow: 0 0 25px 10px rgba(193, 127, 36, 0.5),
                0 0 50px 20px rgba(193, 127, 36, 0.25);
  }
}

/* Hotspot avec indice actif - bien visible pour aider les apprenants */
#zoe-lockout-module .hotspot.hotspot-hint-active {
  opacity: 0.5 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  animation: hintGlow 2s ease-in-out infinite;
  background-color: rgba(193, 127, 36, 0.3) !important;
  border: 3px solid rgba(193, 127, 36, 0.8) !important;
  border-radius: 50% !important;
}

/* Augmenter l'indice après délai (classe ajoutée par JS après 15s) */
#zoe-lockout-module .hotspot.hotspot-hint-stronger {
  opacity: 0.7 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  animation: hintGlow 1.5s ease-in-out infinite;
  background-color: rgba(193, 127, 36, 0.5) !important;
  border: 4px solid rgba(193, 127, 36, 1) !important;
  border-radius: 50% !important;
}

/* IMPORTANT: hotspot-revealed MUST override hint classes */
/* This ensures revealed hotspots are fully visible even if hint classes weren't properly removed */
#zoe-lockout-module .hotspot.hotspot-revealed.hotspot-hint-active,
#zoe-lockout-module .hotspot.hotspot-revealed.hotspot-hint-stronger {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: 0 0 20px 8px rgba(123, 92, 176, 0.6),
              0 0 40px 15px rgba(123, 92, 176, 0.3) !important;
}

#zoe-lockout-module .hotspot.hotspot-revealed {
  opacity: 1 !important;
  visibility: visible !important;
  animation: hotspotReveal 0.5s ease-out forwards !important;
  background-color: transparent !important;
  border: none !important;
}

/* Zone cliquable avec curseur spécial pendant exercice */
#pano.spotting-active {
  cursor: crosshair;
}

/* Effet de proximité - curseur change quand proche d'une cible */
#pano.spotting-active.near-target {
  cursor: pointer;
}

/* Animation tremblement pour indicateur de proximité */
@keyframes cursorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Indicateur de proximité affiché dans le coin */
#proximity-indicator {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #C17F24, #A86A1D);
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1500;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#proximity-indicator.visible {
  opacity: 1;
  animation: cursorShake 0.3s ease infinite;
}

#proximity-indicator.very-close {
  background: linear-gradient(135deg, #5D8A48, #4A7039);
  animation: cursorShake 0.15s ease infinite;
}

/* ============================================ */
/* EXERCICE SÉQUENCE CONSIGNATION HABITACLE    */
/* ============================================ */

/* Container principal de la modal */
#zoe-lockout-module .habitacle-sequence-content {
  max-width: 800px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%) !important;
  border: 2px solid #C17F24;
}

/* Header de l'exercice */
#zoe-lockout-module .habitacle-sequence-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(193, 127, 36, 0.3);
}

#zoe-lockout-module .habitacle-sequence-header h2 {
  font-size: 1.4rem;
  color: #3D3028;
  margin-bottom: 0.75rem;
}

#zoe-lockout-module .habitacle-sequence-intro {
  font-size: 0.95rem;
  color: #5A4D3E;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Indicateur de progression */
#zoe-lockout-module .habitacle-sequence-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(193, 127, 36, 0.15);
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #3D3028;
}

#zoe-lockout-module .habitacle-sequence-progress .progress-current {
  color: #C17F24;
  font-size: 1.3rem;
}

/* Body de l'exercice */
#zoe-lockout-module .habitacle-sequence-body {
  margin-bottom: 1.5rem;
}

/* Grille des cartes */
#zoe-lockout-module .habitacle-sequence-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Carte cliquable */
#zoe-lockout-module .habitacle-sequence-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 2px solid #D4C4B0;
  border-radius: 12px;
  color: #3D3028;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

#zoe-lockout-module .habitacle-sequence-card:hover:not(.is-correct):not(.is-disabled) {
  background: #FFF8F0;
  border-color: #C17F24;
  transform: translateX(4px);
}

#zoe-lockout-module .habitacle-sequence-card:focus-visible {
  outline: 2px solid #C17F24;
  outline-offset: 2px;
}

#zoe-lockout-module .habitacle-sequence-card .card-text {
  flex: 1;
  line-height: 1.4;
}

#zoe-lockout-module .habitacle-sequence-card .card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Carte validée (correcte) */
#zoe-lockout-module .habitacle-sequence-card.is-correct {
  background: rgba(93, 138, 72, 0.15);
  border-color: #5D8A48;
  cursor: default;
}

#zoe-lockout-module .habitacle-sequence-card.is-correct .card-icon {
  color: #5D8A48;
}

/* Carte en erreur (animation shake) */
#zoe-lockout-module .habitacle-sequence-card.is-error {
  animation: habitacleShake 0.5s ease;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

@keyframes habitacleShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* Carte désactivée */
#zoe-lockout-module .habitacle-sequence-card.is-disabled {
  pointer-events: none;
  opacity: 0.85;
}

/* Zone de feedback */
#zoe-lockout-module .habitacle-sequence-feedback {
  min-height: 2.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.3s ease;
}

#zoe-lockout-module .habitacle-sequence-feedback.feedback-success {
  background: rgba(93, 138, 72, 0.15);
  color: #3D5A30;
  border: 1px solid rgba(93, 138, 72, 0.4);
}

#zoe-lockout-module .habitacle-sequence-feedback.feedback-error {
  background: rgba(192, 57, 43, 0.1);
  color: #922B21;
  border: 1px solid rgba(192, 57, 43, 0.4);
}

/* Zone finale (succès complet) */
#zoe-lockout-module .habitacle-sequence-final {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(93, 138, 72, 0.1);
  border: 2px solid #5D8A48;
  border-radius: 12px;
}

#zoe-lockout-module .habitacle-sequence-success {
  text-align: center;
  margin-bottom: 1.25rem;
}

#zoe-lockout-module .habitacle-sequence-success .success-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

#zoe-lockout-module .habitacle-sequence-success .success-message {
  font-size: 1.1rem;
  color: #3D5A30;
  font-weight: 600;
}

/* Récapitulatif officiel */
#zoe-lockout-module .habitacle-sequence-recap {
  background: rgba(193, 127, 36, 0.1);
  padding: 1rem 1.25rem;
  border-radius: 8px;
}

#zoe-lockout-module .habitacle-sequence-recap h3 {
  font-size: 1rem;
  color: #3D3028;
  margin-bottom: 0.75rem;
}

#zoe-lockout-module .habitacle-sequence-official-list {
  margin: 0;
  padding-left: 1.5rem;
  color: #5A4D3E;
  font-size: 0.9rem;
  line-height: 1.6;
}

#zoe-lockout-module .habitacle-sequence-official-list li {
  margin-bottom: 0.4rem;
}

/* Zone des actions */
#zoe-lockout-module .habitacle-sequence-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(193, 127, 36, 0.3);
}

/* Responsive mobile */
@media (max-width: 600px) {
  .habitacle-sequence-content {
    padding: 1rem;
    max-height: 95vh;
  }

  .habitacle-sequence-header h2 {
    font-size: 1.2rem;
  }

  .habitacle-sequence-intro {
    font-size: 0.9rem;
  }

  .habitacle-sequence-card {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .habitacle-sequence-actions {
    flex-direction: column;
  }

  .habitacle-sequence-actions button {
    width: 100%;
  }
}

/* ============================================ */
/* EXERCICE REPÉRAGE HT 360° - PHASE 4         */
/* ============================================ */

#zoe-lockout-module .engine-hv-spotting-content {
  max-width: 500px;
  padding: 2rem;
  text-align: center;
}

#zoe-lockout-module .engine-hv-spotting-header {
  margin-bottom: 1.5rem;
}

#zoe-lockout-module .engine-hv-spotting-header h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #D35400;
}

#zoe-lockout-module .engine-hv-spotting-intro {
  font-size: 1rem;
  color: #6B5D4D;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

#zoe-lockout-module .engine-hv-spotting-instruction {
  font-size: 0.95rem;
  color: #8B7355;
  font-style: italic;
}

#zoe-lockout-module .engine-hv-spotting-body {
  margin-bottom: 1.5rem;
}

#zoe-lockout-module .engine-hv-spotting-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.15) 0%, rgba(255, 69, 0, 0.15) 100%);
  border: 2px solid #D35400;
  border-radius: 12px;
  margin-bottom: 1rem;
}

#zoe-lockout-module .engine-hv-icon {
  font-size: 3rem;
}

#zoe-lockout-module .engine-hv-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #D35400;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#zoe-lockout-module .engine-hv-spotting-feedback {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #F5F0EB;
  color: #6B5D4D;
  transition: all 0.3s ease;
}

#zoe-lockout-module .engine-hv-spotting-feedback.feedback-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #166534;
}

#zoe-lockout-module .engine-hv-spotting-feedback.feedback-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #b91c1c;
}

#zoe-lockout-module .engine-hv-spotting-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Toast de feedback sur le panorama */
#zoe-lockout-module .engine-hv-toast {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#zoe-lockout-module .engine-hv-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#zoe-lockout-module .engine-hv-toast--success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#zoe-lockout-module .engine-hv-toast--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive mobile */
@media (max-width: 600px) {
  .engine-hv-spotting-content {
    padding: 1.25rem;
    max-height: 90vh;
  }

  .engine-hv-spotting-header h2 {
    font-size: 1.2rem;
  }

  .engine-hv-spotting-intro,
  .engine-hv-spotting-instruction {
    font-size: 0.9rem;
  }

  .engine-hv-icon {
    font-size: 2.5rem;
  }

  .engine-hv-label {
    font-size: 1rem;
  }

  .engine-hv-toast {
    bottom: 15%;
    font-size: 0.9rem;
    padding: 0.85rem 1.25rem;
  }
}

/* ================================================================== */
/* MOODLE GLOBAL COMPATIBILITY SAFEGUARD                              */
/* ================================================================== */
/*
 * This section ensures ALL modals and exercises work correctly
 * inside Moodle's constrained iframe environment.
 * Moodle overrides: .modal, .modal-dialog, .modal-content,
 * width, max-height, overflow, margins, z-index, flexbox defaults
 */

/* ------------------------------------------------------------------ */
/* 1. GLOBAL MODAL PROTECTION                                         */
/* ------------------------------------------------------------------ */

/* Force all custom modals to use fixed positioning with high z-index */
/* NOTE: .hidden class must override display - do NOT use display: flex !important here */
#zoe-lockout-module .modal:not(.hidden),
#zoe-lockout-module #media-modal:not(.hidden),
#zoe-lockout-module #quiz-modal:not(.hidden),
#zoe-lockout-module #glossary-modal:not(.hidden),
#zoe-lockout-module #scene-quiz-modal:not(.hidden),
#zoe-lockout-module #epi-exercise-modal:not(.hidden),
#zoe-lockout-module #steps-exercise-modal:not(.hidden),
#zoe-lockout-module #case-study-modal:not(.hidden),
#zoe-lockout-module #click360-modal:not(.hidden),
#zoe-lockout-module #engine-hv-spotting-modal:not(.hidden),
#zoe-lockout-module #habitacle-sequence-modal:not(.hidden),
#zoe-lockout-module #feedback-modal:not(.hidden) {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Force modal overlays */
#zoe-lockout-module .modal-overlay,
#zoe-lockout-module .feedback-modal-overlay,
#zoe-lockout-module .steps-exercise-overlay,
#zoe-lockout-module .case-study-overlay,
#zoe-lockout-module .click360-overlay,
#zoe-lockout-module .engine-hv-spotting-overlay,
#zoe-lockout-module .habitacle-sequence-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(61, 48, 40, 0.75) !important;
  z-index: 1 !important;
}

/* Force all modal-content containers */
#zoe-lockout-module .modal .modal-content,
#zoe-lockout-module .modal-content {
  position: relative !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: auto !important;
  transform: none !important;
  flex-shrink: 0 !important;
}

/* ------------------------------------------------------------------ */
/* 2. MICRO-QCM MODAL (Phase 3)                                       */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #scene-quiz-modal {
  z-index: 10001 !important;
}

#zoe-lockout-module #scene-quiz-modal .modal-content.microquiz {
  width: 500px !important;
  max-width: 95vw !important;
  min-width: 300px !important;
  max-height: 85vh !important;
  max-height: 85dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.microquiz-header {
  flex-shrink: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

#microquiz-answers {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 0 20px 20px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.microquiz-option {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

#microquiz-feedback {
  flex-shrink: 0 !important;
  margin: 0 20px 15px !important;
  box-sizing: border-box !important;
}

#microquiz-close {
  flex-shrink: 0 !important;
  margin: 0 20px 20px !important;
  box-sizing: border-box !important;
}

/* ------------------------------------------------------------------ */
/* 3. STEPS EXERCISE (Phase 0 - 4 étapes) — MOODLE SAFEGUARD          */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #steps-exercise-modal {
  z-index: 10002 !important;
}

#zoe-lockout-module .modal-content.steps-exercise-content,
#zoe-lockout-module .steps-exercise-content {
  width: 900px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;  /* ✅ CORRIGÉ : permet le scroll */
  overflow-x: hidden !important;
}

#zoe-lockout-module .steps-exercise-header {
  flex-shrink: 0 !important;
  padding: 25px 30px 20px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .steps-exercise-body {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 25px !important;
  padding: 20px 30px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;  /* ✅ CORRIGÉ : évite les conflits */
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .steps-source-column,
#zoe-lockout-module .steps-target-column {
  flex: 1 1 45% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .steps-exercise-feedback {
  flex: 0 1 auto !important;  /* ✅ CORRIGÉ : peut rétrécir */
  margin: 0 30px 15px !important;
  max-height: 50vh !important;  /* ✅ AJOUTÉ : limite hauteur */
  overflow-y: auto !important;  /* ✅ AJOUTÉ : scroll si nécessaire */
  box-sizing: border-box !important;
}

#zoe-lockout-module .steps-exercise-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 20px 30px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .steps-exercise-actions button {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* 4. CASE STUDY EXERCISE (Phase 5)                                   */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #case-study-modal {
  z-index: 10003 !important;
}

#zoe-lockout-module .modal-content.case-study-content,
#zoe-lockout-module .case-study-content {
  width: 800px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;  /* ✅ CORRIGÉ : permet scroll */
  overflow-x: hidden !important;
}

#zoe-lockout-module .case-study-header {
  flex-shrink: 0 !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .case-study-body {
  flex: 1 1 auto !important;
  padding: 20px 25px !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .case-study-choices {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .case-study-choice {
  display: flex !important;
  align-items: flex-start !important;
  gap: 15px !important;
  padding: 16px 20px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  width: 100% !important;
  text-align: left !important;
}

#zoe-lockout-module .case-study-feedback {
  flex-shrink: 0 !important;
  margin: 0 25px 15px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .case-study-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .case-study-actions button {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* 5. CLICK 360 EXERCISE (Phase 1)                                    */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #click360-modal {
  z-index: 10004 !important;
}

#zoe-lockout-module .modal-content.click360-content,
#zoe-lockout-module .click360-content {
  width: 600px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#zoe-lockout-module .click360-header {
  flex-shrink: 0 !important;
  padding: 20px 25px 15px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .click360-body {
  flex: 1 1 auto !important;
  padding: 15px 25px !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .click360-counter {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .click360-targets-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .click360-target {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

#zoe-lockout-module .click360-feedback {
  flex-shrink: 0 !important;
  margin: 15px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .click360-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .click360-actions button {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* 6. ENGINE HV SPOTTING (Phase 4)                                    */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #engine-hv-spotting-modal {
  z-index: 10005 !important;
}

#zoe-lockout-module .modal-content.engine-hv-spotting-content,
#zoe-lockout-module .engine-hv-spotting-content {
  width: 700px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#zoe-lockout-module .engine-hv-spotting-header {
  flex-shrink: 0 !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .engine-hv-spotting-body {
  flex: 1 1 auto !important;
  padding: 20px 25px !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

#zoe-lockout-module .engine-hv-spotting-visual {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 15px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .engine-hv-spotting-feedback {
  flex-shrink: 0 !important;
  margin: 0 25px 15px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .engine-hv-spotting-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .engine-hv-spotting-actions button {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* Toast notification for engine HV */
#zoe-lockout-module .engine-hv-toast {
  position: fixed !important;
  bottom: 20% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10010 !important;
  box-sizing: border-box !important;
  max-width: 90vw !important;
}

/* ------------------------------------------------------------------ */
/* 7. HABITACLE SEQUENCE EXERCISE                                     */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #habitacle-sequence-modal {
  z-index: 10006 !important;
}

#zoe-lockout-module .modal-content.habitacle-sequence-content,
#zoe-lockout-module .habitacle-sequence-content {
  width: 800px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#zoe-lockout-module .habitacle-sequence-header {
  flex-shrink: 0 !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .habitacle-sequence-body {
  flex: 1 1 auto !important;
  padding: 20px 25px !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .habitacle-sequence-cards {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .habitacle-sequence-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  min-width: 140px !important;
  max-width: 200px !important;
}

#zoe-lockout-module .habitacle-sequence-feedback {
  flex-shrink: 0 !important;
  margin: 0 25px 15px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .habitacle-sequence-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .habitacle-sequence-actions button {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------ */
/* 8. FINAL QUIZ MODAL                                                */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #quiz-modal {
  z-index: 10007 !important;
}

#zoe-lockout-module .modal-content.quiz-content,
#zoe-lockout-module .quiz-content {
  width: 800px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#zoe-lockout-module #quiz-header {
  flex-shrink: 0 !important;
  padding: 20px 25px !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module #quiz-container {
  flex: 1 1 auto !important;
  padding: 20px 25px !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module #quiz-navigation,
#zoe-lockout-module #quiz-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 15px 25px !important;
  box-sizing: border-box !important;
}

/* ------------------------------------------------------------------ */
/* 9. GLOSSARY MODAL                                                  */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #glossary-modal {
  z-index: 10008 !important;
}

#zoe-lockout-module .modal-content.glossary-content,
#zoe-lockout-module .glossary-content {
  width: 900px !important;
  max-width: 95vw !important;
  min-width: 320px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#zoe-lockout-module #glossary-header {
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module #glossary-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* ------------------------------------------------------------------ */
/* 10. MEDIA MODAL (Photos/Videos)                                    */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #media-modal {
  z-index: 10009 !important;
}

#zoe-lockout-module #media-modal .modal-content {
  width: auto !important;
  max-width: 95vw !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

#modal-body {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#modal-body img,
#modal-body video {
  max-width: 100% !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  box-sizing: border-box !important;
}

#modal-nav {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 20px !important;
  box-sizing: border-box !important;
}

/* ------------------------------------------------------------------ */
/* 11. FEEDBACK MODAL                                                 */
/* ------------------------------------------------------------------ */

#zoe-lockout-module #feedback-modal {
  z-index: 10010 !important;
}

#zoe-lockout-module .feedback-modal-content {
  width: 600px !important;
  max-width: 95vw !important;
  min-width: 300px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
  z-index: 2 !important;
}

#zoe-lockout-module .feedback-modal-header {
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .feedback-modal-text {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#zoe-lockout-module .feedback-modal-actions {
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  box-sizing: border-box !important;
}

/* ------------------------------------------------------------------ */
/* 12. DRAG & DROP GLOBAL FIXES                                       */
/* ------------------------------------------------------------------ */

/* Ensure draggable items are always visible */
#zoe-lockout-module .epi-item,
#zoe-lockout-module .steps-item,
[draggable="true"] {
  position: relative !important;
  z-index: 1 !important;
  touch-action: none !important;
}

#zoe-lockout-module .epi-item.dragging,
#zoe-lockout-module .steps-item.dragging,
[draggable="true"].dragging {
  z-index: 9999 !important;
  opacity: 0.8 !important;
  cursor: grabbing !important;
}

/* Drop zones must be visible and accept drops */
#zoe-lockout-module .epi-drop-area,
#zoe-lockout-module .steps-drop-area,
.drop-zone,
[data-drop-zone] {
  min-height: 50px !important;
  position: relative !important;
  z-index: 1 !important;
}

#zoe-lockout-module .epi-drop-area.drag-over,
#zoe-lockout-module .steps-drop-area.drag-over,
.drop-zone.drag-over {
  z-index: 2 !important;
}

/* ------------------------------------------------------------------ */
/* 13. BUTTON FIXES                                                   */
/* ------------------------------------------------------------------ */

/* Ensure all exercise buttons are clickable and visible */
#zoe-lockout-module .btn-validate,
#zoe-lockout-module .btn-action,
#zoe-lockout-module .btn-secondary,
#zoe-lockout-module .close-btn {
  position: relative !important;
  z-index: 1 !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  min-height: 44px !important;
  min-width: 44px !important;
}

/* Close buttons in modals */
#zoe-lockout-module .modal .close-btn,
#zoe-lockout-module .modal-content .close-btn {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  z-index: 10 !important;
}

/* ------------------------------------------------------------------ */
/* 14. RESPONSIVE MOODLE FIXES                                        */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
  /* All modals full width on mobile */
  .modal .modal-content,
  .epi-exercise-content,
  .steps-exercise-content,
  .case-study-content,
  .click360-content,
  .engine-hv-spotting-content,
  .habitacle-sequence-content,
  .quiz-content,
  .glossary-content,
  #scene-quiz-modal .modal-content.microquiz {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  /* Stack layouts vertically on mobile */
  .epi-exercise-body,
  .steps-exercise-body {
    flex-direction: column !important;
  }

  .epi-drop-zones,
  .steps-drop-zones {
    flex-direction: column !important;
  }

  .epi-items-source,
  .steps-source,
  .steps-items-source {
    max-width: 100% !important;
    min-width: 100% !important;
  }

  .epi-drop-zone,
  .steps-drop-zone,
  .steps-target {
    min-width: 100% !important;
    flex: 1 1 auto !important;
  }

  /* Stack action buttons on mobile */
  .epi-exercise-actions,
  .steps-exercise-actions,
  .case-study-actions,
  .click360-actions,
  .engine-hv-spotting-actions,
  .habitacle-sequence-actions,
  #quiz-actions {
    flex-direction: column !important;
  }

  .epi-exercise-actions button,
  .steps-exercise-actions button,
  .case-study-actions button,
  .click360-actions button,
  .engine-hv-spotting-actions button,
  .habitacle-sequence-actions button,
  #quiz-actions button {
    width: 100% !important;
  }

  /* Habitacle cards smaller on mobile */
  .habitacle-sequence-card {
    min-width: 100px !important;
    max-width: 150px !important;
    padding: 15px !important;
  }
}

@media (max-width: 500px) {
  /* Extra small screens */
  .modal {
    padding: 8px !important;
  }

  .epi-exercise-header,
  .steps-exercise-header,
  .case-study-header,
  .click360-header,
  .engine-hv-spotting-header,
  .habitacle-sequence-header {
    padding: 15px 20px !important;
  }

  .epi-exercise-body,
  .steps-exercise-body,
  .case-study-body,
  .click360-body,
  .engine-hv-spotting-body,
  .habitacle-sequence-body {
    padding: 15px 20px !important;
  }

  .epi-exercise-actions,
  .steps-exercise-actions,
  .case-study-actions,
  .click360-actions,
  .engine-hv-spotting-actions,
  .habitacle-sequence-actions {
    padding: 15px 20px !important;
  }
}

/* ------------------------------------------------------------------ */
/* 15. PREVENT MOODLE CSS INHERITANCE                                 */
/* ------------------------------------------------------------------ */

/* Reset potential Moodle interference on our containers */
#zoe-lockout-module .modal *,
#zoe-lockout-module #epi-exercise-modal *,
#zoe-lockout-module #steps-exercise-modal *,
#zoe-lockout-module #case-study-modal *,
#zoe-lockout-module #click360-modal *,
#zoe-lockout-module #engine-hv-spotting-modal *,
#zoe-lockout-module #habitacle-sequence-modal *,
#zoe-lockout-module #quiz-modal *,
#zoe-lockout-module #glossary-modal *,
#zoe-lockout-module #scene-quiz-modal *,
#zoe-lockout-module #feedback-modal * {
  box-sizing: border-box;
}

/* Ensure text remains readable */
#zoe-lockout-module .modal p,
#zoe-lockout-module .modal h1, .modal h2, .modal h3, .modal h4,
#zoe-lockout-module .modal label,
#zoe-lockout-module .modal span,
#zoe-lockout-module .modal li {
  line-height: 1.5 !important;
  max-width: 100% !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Prevent Moodle from hiding our scrollbars */
#zoe-lockout-module .modal::-webkit-scrollbar,
#zoe-lockout-module .modal-content::-webkit-scrollbar,
#zoe-lockout-module .epi-exercise-body::-webkit-scrollbar,
#zoe-lockout-module .steps-exercise-body::-webkit-scrollbar,
#zoe-lockout-module .case-study-body::-webkit-scrollbar,
#zoe-lockout-module #quiz-container::-webkit-scrollbar,
#zoe-lockout-module #glossary-body::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

#zoe-lockout-module .modal::-webkit-scrollbar-thumb,
#zoe-lockout-module .modal-content::-webkit-scrollbar-thumb {
  background: rgba(193, 127, 36, 0.4) !important;
  border-radius: 4px !important;
}

#zoe-lockout-module .modal::-webkit-scrollbar-track,
#zoe-lockout-module .modal-content::-webkit-scrollbar-track {
  background: rgba(212, 196, 176, 0.2) !important;
}

/* ================================================================== */
/* END MOODLE GLOBAL COMPATIBILITY SAFEGUARD                          */
/* ================================================================== */

/* MOODLE FIX — Remove dark overlay under exercise buttons (pseudo-elements only) */
#zoe-lockout-module #steps-exercise-modal .modal-content::after,
#zoe-lockout-module #steps-exercise-modal .modal-dialog::after,
#zoe-lockout-module #steps-exercise-modal .steps-exercise-content::after,
#zoe-lockout-module .steps-exercise-content::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure steps-exercise-actions container is visible */
#zoe-lockout-module #steps-exercise-modal .steps-exercise-actions,
#zoe-lockout-module .steps-exercise-actions {
    display: flex !important;
    box-shadow: none !important;
    /* Note: background and border-top are set by NUCLEAR rules below */
}

/* Remove Moodle modal footer padding */
#zoe-lockout-module #steps-exercise-modal .modal-footer {
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure buttons sit above any Moodle overlay */
#zoe-lockout-module .steps-exercise-actions button {
    position: relative !important;
    z-index: 100000 !important;
}

/* ============================================================
   🚨 NUCLEAR ANTI-MOODLE PATCH — LAST RESORT OVERRIDES
   These rules use maximum specificity to defeat ANY Moodle CSS
   ============================================================ */

/* NUCLEAR: Force height chain from root to content */
html, body {
  height: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
}

#zoe-lockout-module {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  isolation: isolate !important;  /* Create new stacking context */
  contain: layout style paint !important;  /* CSS containment */
}

/* NUCLEAR: Modal positioning - defeats transform ancestors */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;  /* Shorthand for top/right/bottom/left: 0 */
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;  /* Dynamic viewport for mobile */
  z-index: 2147483647 !important;  /* Max z-index */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  background: rgba(0, 0, 0, 0.01) !important;  /* Force layer creation */
  transform: translateZ(0) !important;  /* Force GPU layer */
  will-change: transform !important;
}

/* NUCLEAR: Content container - guaranteed sizing */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-content {
  position: relative !important;
  width: 900px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: hidden !important;  /* Vertical overflow hidden - body scrolls */
  overflow-x: visible !important;  /* Allow horizontal content to be visible */
  box-sizing: border-box !important;
  background: #FFFAF5 !important;
  border-radius: 8px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  transform: translateZ(0) !important;
}

/* NUCLEAR: Header - fixed, never shrink */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-header {
  flex: 0 0 auto !important;
  padding: 25px 30px 20px !important;
  border-bottom: 1px solid #D4C4B0 !important;
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%) !important;
}

/* NUCLEAR: Body - SCROLLABLE area */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-body {
  flex: 1 1 0% !important;  /* Take remaining space, CAN shrink to 0 */
  min-height: 0 !important;  /* CRITICAL: allows flex shrink */
  max-height: none !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 25px !important;
  padding: 20px 30px !important;
  overflow-y: auto !important;  /* BODY scrolls, not container */
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

/* NUCLEAR: Columns */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-source-column,
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-target-column {
  flex: 1 1 45% !important;
  min-width: 0 !important;  /* Allow shrinking */
  display: flex !important;
  flex-direction: column !important;
}

/* NUCLEAR: Items list - REMOVE conflicting min-height */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-items-list {
  min-height: 100px !important;  /* Reduced from 200px */
  flex: 1 1 auto !important;
}

/* NUCLEAR: Feedback - limited height with scroll */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-feedback {
  flex: 0 1 auto !important;  /* Can shrink but not grow */
  max-height: 40vh !important;
  overflow-y: auto !important;
  margin: 0 30px 15px !important;
}

/* NUCLEAR: Actions - fixed at bottom, NEVER disappear */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;  /* Allow buttons to wrap */
  gap: 15px !important;
  padding: 20px 30px !important;
  border-top: 1px solid #E8DFD0 !important;
  background: linear-gradient(135deg, #F5EDE4 0%, #EDE4D9 100%) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;  /* Ensure buttons are not clipped */
}

/* NUCLEAR: Buttons - guaranteed visibility */
#zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-actions button {
  position: relative !important;
  z-index: 1 !important;
  flex-shrink: 0 !important;
  min-width: 120px !important;
  padding: 12px 24px !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* NUCLEAR: Mobile responsive */
@media (max-width: 768px) {
  #zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-content {
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }

  #zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-body {
    flex-direction: column !important;
    gap: 20px !important;
    padding: 15px 20px !important;
  }

  #zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-source-column,
  #zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-target-column {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  #zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-actions {
    flex-wrap: wrap !important;
    padding: 15px !important;
  }

  #zoe-lockout-module #steps-exercise-modal:not(.hidden) .steps-exercise-actions button {
    min-width: 100% !important;
  }
}

/* NUCLEAR: Defeat Bootstrap .hidden override */
#zoe-lockout-module .hidden,
#zoe-lockout-module [hidden],
#zoe-lockout-module .modal.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* NUCLEAR: Scrollbar styling (WebKit) */
#zoe-lockout-module #steps-exercise-modal .steps-exercise-body::-webkit-scrollbar {
  width: 8px !important;
}

#zoe-lockout-module #steps-exercise-modal .steps-exercise-body::-webkit-scrollbar-track {
  background: rgba(212, 196, 176, 0.2) !important;
  border-radius: 4px !important;
}

#zoe-lockout-module #steps-exercise-modal .steps-exercise-body::-webkit-scrollbar-thumb {
  background: #C17F24 !important;
  border-radius: 4px !important;
}

#zoe-lockout-module #steps-exercise-modal .steps-exercise-body::-webkit-scrollbar-thumb:hover {
  background: #A66A1D !important;
}

/* ============================================================
   END NUCLEAR PATCH
   ============================================================ */

/* ============================================================
   BOUTON RESET TRAINING - Recommencer la formation
   ============================================================ */

#zoe-lockout-module #reset-training-container {
  margin-top: 20px;
  padding: 15px 10px;
  border-top: 1px solid rgba(193, 127, 36, 0.3);
}

#zoe-lockout-module .btn-reset-training {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b2be2 0%, #6f21b5 100%);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(139, 43, 226, 0.3);
}

#zoe-lockout-module .btn-reset-training:hover {
  background: linear-gradient(135deg, #9b3bf2 0%, #7f31c5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 43, 226, 0.4);
}

#zoe-lockout-module .btn-reset-training:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(139, 43, 226, 0.3);
}

/* ============================================ */
/* TUTORIEL D'INTRODUCTION                      */
/* ============================================ */

#zoe-lockout-module #tutorial-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoe-lockout-module #tutorial-modal.hidden {
  display: none;
}

#zoe-lockout-module .tutorial-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 48, 40, 0.85);
  backdrop-filter: blur(5px);
}

#zoe-lockout-module .tutorial-content {
  position: relative;
  max-width: 550px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #FFFAF5 0%, #F5EDE4 100%);
  border-radius: 16px;
  border: 2px solid #C17F24;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: tutorialFadeIn 0.4s ease-out;
}

@keyframes tutorialFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#zoe-lockout-module .tutorial-header {
  padding: 25px 30px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(193, 127, 36, 0.2);
}

#zoe-lockout-module .tutorial-header h2 {
  color: #3D3028;
  font-size: 1.4rem;
  margin-top: 12px;
}

#zoe-lockout-module .tutorial-body {
  padding: 25px 30px;
}

#zoe-lockout-module .tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  border: 1px solid rgba(212, 196, 176, 0.5);
}

#zoe-lockout-module .tutorial-step:last-child {
  margin-bottom: 0;
}

#zoe-lockout-module .tutorial-step-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #C17F24, #A86A1D);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

#zoe-lockout-module .tutorial-step-text strong {
  display: block;
  color: #3D3028;
  font-size: 1rem;
  margin-bottom: 5px;
}

#zoe-lockout-module .tutorial-step-text p {
  color: #5A4D3E;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

#zoe-lockout-module .tutorial-footer {
  padding: 20px 30px 25px;
  border-top: 1px solid rgba(193, 127, 36, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#zoe-lockout-module .tutorial-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #5A4D3E;
  font-size: 0.9rem;
}

#zoe-lockout-module .tutorial-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #C17F24;
}

#zoe-lockout-module #tutorial-start {
  padding: 14px 40px;
  font-size: 1.1rem;
}

/* Responsive tutoriel */
@media (max-width: 600px) {
  #zoe-lockout-module .tutorial-content {
    width: 95%;
    max-height: 95vh;
  }

  #zoe-lockout-module .tutorial-header,
  #zoe-lockout-module .tutorial-body,
  #zoe-lockout-module .tutorial-footer {
    padding: 15px 20px;
  }

  #zoe-lockout-module .tutorial-step {
    padding: 12px;
    gap: 12px;
  }

  #zoe-lockout-module .tutorial-step-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  #zoe-lockout-module .tutorial-header h2 {
    font-size: 1.2rem;
  }
}

/* ============================================ */
/* RAPPORT DE PROGRESSION                       */
/* ============================================ */

#zoe-lockout-module .progress-report-content {
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: #FFFCF7;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#zoe-lockout-module .progress-report-header {
  background: linear-gradient(135deg, #C17F24 0%, #E6A642 100%);
  padding: 25px 30px;
  border-radius: 16px 16px 0 0;
  color: white;
  text-align: center;
}

#zoe-lockout-module .progress-report-header h2 {
  margin: 10px 0 5px 0;
  font-size: 1.5rem;
  font-weight: 700;
}

#zoe-lockout-module .report-timestamp {
  font-size: 0.85rem;
  opacity: 0.9;
  margin: 0;
}

#zoe-lockout-module .progress-report-body {
  padding: 25px 30px;
}

#zoe-lockout-module .report-section {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #E6DFD4;
}

#zoe-lockout-module .report-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#zoe-lockout-module .report-section h3 {
  color: #5A4D3E;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #C17F24;
  display: inline-block;
}

/* Grille de stats */
#zoe-lockout-module .report-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

#zoe-lockout-module .report-stat-card {
  background: white;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #E6DFD4;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#zoe-lockout-module .report-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

#zoe-lockout-module .stat-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

#zoe-lockout-module .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #5A4D3E;
  line-height: 1.2;
}

#zoe-lockout-module .stat-label {
  font-size: 0.8rem;
  color: #8B7355;
  margin-top: 5px;
}

#zoe-lockout-module .stat-progress .stat-value { color: #C17F24; }
#zoe-lockout-module .stat-time .stat-value { color: #2E86AB; }
#zoe-lockout-module .stat-phases .stat-value { color: #5D8A48; }
#zoe-lockout-module .stat-hotspots .stat-value { color: #A23B72; }

/* Barre de progression globale */
#zoe-lockout-module .report-progress-bar-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

#zoe-lockout-module .report-progress-bar {
  flex: 1;
  height: 12px;
  background: #E6DFD4;
  border-radius: 6px;
  overflow: hidden;
}

#zoe-lockout-module .report-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #C17F24 0%, #5D8A48 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
}

#zoe-lockout-module .report-progress-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #5A4D3E;
  white-space: nowrap;
}

/* Liste des phases */
#zoe-lockout-module .report-phases-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#zoe-lockout-module .report-phase-item {
  background: white;
  border-radius: 10px;
  padding: 12px 15px;
  border: 1px solid #E6DFD4;
  transition: all 0.2s ease;
}

#zoe-lockout-module .report-phase-item.phase-completed {
  border-left: 4px solid #5D8A48;
  background: linear-gradient(90deg, rgba(93, 138, 72, 0.05) 0%, white 100%);
}

#zoe-lockout-module .report-phase-item.phase-in-progress {
  border-left: 4px solid #C17F24;
  background: linear-gradient(90deg, rgba(193, 127, 36, 0.05) 0%, white 100%);
}

#zoe-lockout-module .report-phase-item.phase-not-started {
  border-left: 4px solid #BFBFBF;
  opacity: 0.7;
}

#zoe-lockout-module .phase-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#zoe-lockout-module .phase-status-icon {
  font-size: 1.1rem;
}

#zoe-lockout-module .phase-name {
  flex: 1;
  font-weight: 600;
  color: #5A4D3E;
  font-size: 0.95rem;
}

#zoe-lockout-module .phase-status-text {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

#zoe-lockout-module .phase-completed .phase-status-text {
  background: rgba(93, 138, 72, 0.15);
  color: #5D8A48;
}

#zoe-lockout-module .phase-in-progress .phase-status-text {
  background: rgba(193, 127, 36, 0.15);
  color: #C17F24;
}

#zoe-lockout-module .phase-not-started .phase-status-text {
  background: rgba(139, 115, 85, 0.15);
  color: #8B7355;
}

#zoe-lockout-module .phase-item-details {
  display: flex;
  gap: 20px;
  padding-left: 30px;
}

#zoe-lockout-module .phase-detail {
  font-size: 0.85rem;
  color: #8B7355;
  display: flex;
  align-items: center;
  gap: 5px;
}

#zoe-lockout-module .detail-icon {
  font-size: 0.9rem;
}

/* Section Exercices interactifs */
#zoe-lockout-module .report-exercises-summary,
#zoe-lockout-module .report-scene-quizzes-summary {
  background: #F9F6F1;
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 15px;
}

#zoe-lockout-module .exercises-stats,
#zoe-lockout-module .scene-quizzes-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #5A4D3E;
  font-size: 0.9rem;
}

#zoe-lockout-module .stat-separator {
  color: #BFBFBF;
}

#zoe-lockout-module .report-exercises-list,
#zoe-lockout-module .report-scene-quizzes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#zoe-lockout-module .report-exercise-item {
  background: white;
  border-radius: 10px;
  padding: 12px 15px;
  border: 1px solid #E6DFD4;
  transition: all 0.2s ease;
}

#zoe-lockout-module .report-exercise-item.exercise-success {
  border-left: 4px solid #5D8A48;
  background: linear-gradient(90deg, rgba(93, 138, 72, 0.05) 0%, white 100%);
}

#zoe-lockout-module .report-exercise-item.exercise-failed {
  border-left: 4px solid #C94C4C;
  background: linear-gradient(90deg, rgba(201, 76, 76, 0.05) 0%, white 100%);
}

#zoe-lockout-module .report-exercise-item.exercise-not-done {
  border-left: 4px solid #BFBFBF;
  opacity: 0.7;
}

#zoe-lockout-module .exercise-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

#zoe-lockout-module .exercise-status-icon {
  font-size: 1rem;
}

#zoe-lockout-module .exercise-name {
  flex: 1;
  font-weight: 500;
  color: #5A4D3E;
  font-size: 0.9rem;
}

#zoe-lockout-module .exercise-status-text {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 500;
}

#zoe-lockout-module .exercise-success .exercise-status-text {
  background: rgba(93, 138, 72, 0.15);
  color: #5D8A48;
}

#zoe-lockout-module .exercise-failed .exercise-status-text {
  background: rgba(201, 76, 76, 0.15);
  color: #C94C4C;
}

#zoe-lockout-module .exercise-not-done .exercise-status-text {
  background: rgba(139, 115, 85, 0.15);
  color: #8B7355;
}

#zoe-lockout-module .exercise-item-details {
  display: flex;
  gap: 10px;
  padding-left: 26px;
  flex-wrap: wrap;
  align-items: center;
}

#zoe-lockout-module .exercise-attempts,
#zoe-lockout-module .exercise-score {
  font-size: 0.8rem;
  color: #8B7355;
}

#zoe-lockout-module .badge-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #F5D442 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Section Micro-quiz par scène */
#zoe-lockout-module .report-scene-quiz-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #E6DFD4;
  transition: all 0.2s ease;
}

#zoe-lockout-module .report-scene-quiz-item.scene-quiz-correct {
  border-left: 3px solid #5D8A48;
  background: linear-gradient(90deg, rgba(93, 138, 72, 0.03) 0%, white 100%);
}

#zoe-lockout-module .report-scene-quiz-item.scene-quiz-incorrect {
  border-left: 3px solid #C94C4C;
  background: linear-gradient(90deg, rgba(201, 76, 76, 0.03) 0%, white 100%);
}

#zoe-lockout-module .report-scene-quiz-item.scene-quiz-not-done {
  border-left: 3px solid #BFBFBF;
  opacity: 0.6;
}

#zoe-lockout-module .scene-quiz-status-icon {
  font-size: 0.9rem;
}

#zoe-lockout-module .scene-quiz-name {
  flex: 1;
  font-size: 0.85rem;
  color: #5A4D3E;
}

#zoe-lockout-module .scene-quiz-status-text {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}

#zoe-lockout-module .scene-quiz-correct .scene-quiz-status-text {
  background: rgba(93, 138, 72, 0.15);
  color: #5D8A48;
}

#zoe-lockout-module .scene-quiz-incorrect .scene-quiz-status-text {
  background: rgba(201, 76, 76, 0.15);
  color: #C94C4C;
}

#zoe-lockout-module .scene-quiz-not-done .scene-quiz-status-text {
  background: rgba(139, 115, 85, 0.15);
  color: #8B7355;
}

#zoe-lockout-module .scene-quiz-attempts {
  font-size: 0.75rem;
  color: #8B7355;
}

/* Section Quiz Final */
#zoe-lockout-module .report-quiz-summary {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #E6DFD4;
}

#zoe-lockout-module .quiz-not-started,
#zoe-lockout-module .quiz-in-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #8B7355;
}

#zoe-lockout-module .quiz-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

#zoe-lockout-module .quiz-result {
  display: flex;
  align-items: center;
  gap: 25px;
}

#zoe-lockout-module .quiz-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

#zoe-lockout-module .quiz-passed .quiz-score-circle {
  background: linear-gradient(135deg, #5D8A48 0%, #7AB35A 100%);
  color: white;
}

#zoe-lockout-module .quiz-failed .quiz-score-circle {
  background: linear-gradient(135deg, #C94C4C 0%, #E06666 100%);
  color: white;
}

#zoe-lockout-module .quiz-result-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#zoe-lockout-module .quiz-result-icon {
  font-size: 1.5rem;
}

#zoe-lockout-module .quiz-result-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #5A4D3E;
}

#zoe-lockout-module .quiz-attempts {
  font-size: 0.85rem;
  color: #8B7355;
}

/* Statut SCORM */
#zoe-lockout-module .scorm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
}

#zoe-lockout-module .scorm-status-badge .status-icon {
  font-size: 1.3rem;
}

#zoe-lockout-module .scorm-status-badge.status-passed {
  background: linear-gradient(135deg, rgba(93, 138, 72, 0.15) 0%, rgba(122, 179, 90, 0.15) 100%);
  color: #5D8A48;
  border: 2px solid #5D8A48;
}

#zoe-lockout-module .scorm-status-badge.status-completed {
  background: linear-gradient(135deg, rgba(93, 138, 72, 0.15) 0%, rgba(122, 179, 90, 0.15) 100%);
  color: #5D8A48;
  border: 2px solid #5D8A48;
}

#zoe-lockout-module .scorm-status-badge.status-failed {
  background: rgba(201, 76, 76, 0.1);
  color: #C94C4C;
  border: 2px solid #C94C4C;
}

#zoe-lockout-module .scorm-status-badge.status-incomplete {
  background: rgba(193, 127, 36, 0.1);
  color: #C17F24;
  border: 2px solid #C17F24;
}

#zoe-lockout-module .scorm-status-badge.status-not-attempted {
  background: rgba(139, 115, 85, 0.1);
  color: #8B7355;
  border: 2px solid #8B7355;
}

/* Footer du rapport */
#zoe-lockout-module .progress-report-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 30px;
  background: #F5F0E8;
  border-radius: 0 0 16px 16px;
  border-top: 1px solid #E6DFD4;
}

/* Responsive rapport */
@media (max-width: 768px) {
  #zoe-lockout-module .report-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #zoe-lockout-module .progress-report-content {
    width: 95%;
    max-height: 95vh;
  }

  #zoe-lockout-module .progress-report-header,
  #zoe-lockout-module .progress-report-body {
    padding: 20px;
  }

  #zoe-lockout-module .phase-item-details {
    flex-direction: column;
    gap: 5px;
    padding-left: 30px;
  }

  #zoe-lockout-module .quiz-result {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  #zoe-lockout-module .report-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #zoe-lockout-module .stat-value {
    font-size: 1.2rem;
  }

  #zoe-lockout-module .stat-icon {
    font-size: 1.4rem;
  }

  #zoe-lockout-module .report-progress-bar-container {
    flex-direction: column;
    align-items: stretch;
  }

  #zoe-lockout-module .report-progress-text {
    text-align: center;
  }

  #zoe-lockout-module .phase-name {
    font-size: 0.85rem;
  }
}
