/* ── SPA overrides : styles nécessaires au mode SPA (iframe + transitions) ── */

html {
  height: auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
}

body {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

/* Jamais de scrollbar à l'intérieur du panneau — le scroll se fait sur html si besoin */
#page { overflow: visible !important; }
#levels, .scrollable { overflow: visible !important; max-height: none !important; }
#btm { overflow: visible !important; }
body:not(.course-loaded) {
  background: #1a2b4a !important;
  background-image: none !important;
}

#bg-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
body.course-loaded #bg-canvas { display: none !important; }

#tools { display: none !important; }

/* ── Bouton retour « dans le cours : petit, mi-hauteur, bord gauche ── */
#spa-back-btn {
  transition: transform 0.06s ease, border-bottom-width 0.06s ease, opacity 0.15s ease;
}
#spa-back-btn:active {
  transform: translateY(calc(-50% + 3px)) !important;
  border-bottom-width: 0px !important;
}

#index-view { transition: opacity 0.35s ease; }

#course-view {
  display: none; opacity: 0;
  transition: opacity 0.4s ease;
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 500;
  background: #000;
  overflow: hidden;
}
body.course-loaded { overflow: hidden !important; }
html:has(body.course-loaded) { overflow: hidden !important; }

/* ── Styles injectés dans l'iframe d3mindmaps ── */
#classes {
  position: fixed !important; top: 0 !important; left: 0 !important;
  width: 100% !important; z-index: 510 !important;
}
#conteneur {
  position: absolute !important; top: 82px !important;
  left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: 1;
  display: flex !important; align-items: center !important; justify-content: center !important;
  margin-top: 0 !important;
}
#conteneur > table { height: auto !important; }

.modal, .modal2 {
  position: fixed !important; left: 6px !important; top: 6px !important;
  width: calc(100% - 12px) !important; height: calc(100% - 12px) !important;
}
.modal-box, .modal-box2 {
  position: fixed !important; left: 0 !important; top: 0 !important;
  width: 100% !important; height: 100% !important;
}

#classes { margin-top: 0 !important; padding-top: 0 !important; }

#bcontainer {
  position: fixed !important; bottom: 14px !important;
  left: 50% !important; transform: translateX(-50%) !important;
  width: auto !important; height: auto !important;
  z-index: 9998 !important;
  background: transparent !important; border: none !important;
  pointer-events: none !important;
}
#bcontainer td { padding: 0 !important; background: transparent !important; }

body:not(.course-loaded) .breadcrumb {
  font-size: 0.75vmax !important;
  font-family: Nunito, sans-serif !important;
  padding: 3px 14px !important;
  border-radius: 20px !important;
  max-width: 55vw !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  opacity: 0.82 !important;
  color: #fff !important;
}
