/* ============================================================
   Projet Atlas — CSS du schéma interactif (page Structure)
   Extrait de mindmap.php. Scopé sous #mmRoot. @keyframes préfixés mm.
   ============================================================ */

  #mmRoot {
    --bg: #050709;
    --bg2: #0c0f16;
    --center: #f0d882;
    --c1: #38b6ff;
    --c2: #5dd87a;
    --c3: #ffc14d;
    --c4: #ff5f8f;
    --c5: #c97dff;
    --c6: #30d9cc;
    --c7: #ff7043;
    --text: #dde4f0;
    --muted: #606880;
    --panel-bg: #0e1119;
    --border: #1e2538;
    --glow-center: rgba(240,216,130,0.18);

    background: var(--bg);
    color: var(--text);
    font-family: 'Exo 2', sans-serif;
    min-height: 100%;
    position: relative;
  }

  #mmRoot * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  /* ===== STARFIELD ===== */
  #mmRoot #stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
  }
  #mmRoot .star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: mmTwinkle var(--d, 3s) ease-in-out infinite var(--delay, 0s);
  }
  @keyframes mmTwinkle {
    0%,100% { opacity: var(--min-op, 0.1); }
    50%      { opacity: var(--max-op, 0.6); }
  }

  /* ===== HEADER ===== */
  #mmRoot header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 36px 20px 12px;
  }
  #mmRoot .header-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  #mmRoot header h1 {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.1rem, 3.5vw, 2.2rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f0d882, #ffa946, #f0d882);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: mmShimmer 4s linear infinite;
    line-height: 1.2;
  }
  @keyframes mmShimmer { to { background-position: 200% center; } }
  #mmRoot .header-sub {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--muted);
    font-style: italic;
    letter-spacing: 0.05em;
  }
  #mmRoot .header-line {
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--center), transparent);
    margin: 14px auto 0;
  }

  /* ===== HINT ===== */
  #mmRoot .hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    font-style: italic;
    padding: 6px 0 4px;
    position: relative;
    z-index: 10;
    animation: mmFadeHint 1.5s ease-out 1.5s both;
  }
  @keyframes mmFadeHint { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

  /* ===== LEGEND ===== */
  #mmRoot .legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    padding: 6px 20px 14px;
    position: relative;
    z-index: 10;
  }
  #mmRoot .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Orbitron', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, transform 0.15s;
    user-select: none;
  }
  #mmRoot .legend-item:hover, #mmRoot .legend-item:active { color: var(--text); transform: scale(1.05); }
  #mmRoot .legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
  }

  /* ===== SVG WRAPPER ===== */
  #mmRoot .map-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px 20px;
    position: relative;
    z-index: 5;
  }
  #mmRoot svg#mindmap {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
    cursor: default;
  }

  /* Node interactions */
  #mmRoot .node { cursor: pointer; }
  #mmRoot .node-circle {
    transition: filter 0.25s, r 0.25s;
  }
  #mmRoot .node:hover .node-circle, #mmRoot .node.active .node-circle {
    filter: brightness(1.5) drop-shadow(0 0 8px currentColor);
  }
  #mmRoot .node text { pointer-events: none; }

  /* Center pulse */
  @keyframes mmCpulse {
    0%,100% { opacity: 0.12; r: 66; }
    50%      { opacity: 0.22; r: 72; }
  }
  #mmRoot .center-halo { animation: mmCpulse 3s ease-in-out infinite; }

  /* Animated lines */
  #mmRoot .branch-line {
    stroke-dasharray: 8 5;
    animation: mmFlowline 18s linear infinite;
  }
  @keyframes mmFlowline { to { stroke-dashoffset: -200; } }

  /* Sub-node ping on load */
  #mmRoot .sub-node-group {
    opacity: 0;
    animation: mmNodeAppear 0.4s ease-out forwards;
  }
  @keyframes mmNodeAppear {
    from { opacity: 0; transform-origin: center; transform: scale(0.3); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* ===== PANEL ===== */
  #mmRoot .panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,7,9,0.55);
    backdrop-filter: blur(3px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  #mmRoot .panel-overlay.open { opacity: 1; pointer-events: all; }

  #mmRoot .detail-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.88);
    width: min(92vw, 520px);
    max-height: 80vh;
    overflow-y: auto;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 26px 24px;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  }
  #mmRoot .detail-panel.open {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
  }
  #mmRoot .panel-accent-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: var(--accent, var(--center));
    box-shadow: 0 0 20px var(--accent, var(--center));
  }
  #mmRoot .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
  }
  #mmRoot .panel-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent, var(--center));
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--accent, var(--center));
    background: rgba(255,255,255,0.03);
  }
  #mmRoot .panel-title-wrap { flex: 1; }
  #mmRoot .panel-category {
    font-family: 'Orbitron', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--accent, var(--center));
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  #mmRoot .panel-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent, var(--center));
    line-height: 1.3;
  }
  #mmRoot .close-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
  }
  #mmRoot .close-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }

  #mmRoot .panel-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--accent, var(--center)), transparent);
    opacity: 0.25;
    margin-bottom: 14px;
  }
  #mmRoot .panel-body {
    font-size: 0.85rem;
    line-height: 1.75;
    color: #9aa4b8;
  }
  #mmRoot .panel-body p { margin-bottom: 10px; }
  #mmRoot .panel-body ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  #mmRoot .panel-body ul li {
    padding: 8px 12px;
    background: rgba(255,255,255,0.025);
    border-left: 2px solid var(--accent, var(--center));
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    line-height: 1.5;
    opacity: 0;
    animation: mmSlideIn 0.3s ease-out forwards;
  }
  #mmRoot .panel-body ul li strong { color: var(--text); }
  @keyframes mmSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  #mmRoot .alert {
    margin-top: 14px;
    padding: 10px 14px;
    border-left: 3px solid var(--c3);
    background: rgba(255,193,77,0.06);
    font-size: 0.78rem;
    color: var(--c3);
    border-radius: 0 6px 6px 0;
    line-height: 1.55;
  }

  /* ===== WATERMARK ===== */
  #mmRoot .wm {
    text-align: center;
    font-family: 'Orbitron', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    padding: 8px 0 24px;
    position: relative;
    z-index: 10;
    opacity: 0.5;
  }
