/* =====================================================
   WRAPPER GLOBAL
   → CONTEXTE DE POSITIONNEMENT OBLIGATOIRE
===================================================== */

.graph-wrapper {
  position: relative;              /* 🔴 CRUCIAL */
  width: 100%;
  height: 80vh;
  min-height: 520px;
  margin: 0 auto;
  background: #000;
  overflow: hidden;                /* 🔴 CRUCIAL */
}

/* =====================================================
   CONTAINER DU GRAPH 3D
===================================================== */

#links-graph-3d {
  position: absolute;
  inset: 0;                        /* top/right/bottom/left = 0 */
  width: 100%;
  height: 100%;
  background: #000;
}

/* =====================================================
   CANVAS WEBGL (Three.js)
===================================================== */

#links-graph-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  outline: none;
  cursor: grab;
}

#links-graph-3d canvas:active {
  cursor: grabbing;
}

/* =====================================================
   FILTRES (UI)
===================================================== */

#graph-filters {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;                     /* AU-DESSUS DU CANVAS */
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

#graph-filters strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

#graph-filters label {
  display: block;
  cursor: pointer;
  user-select: none;
}

#graph-filters input {
  margin-right: 6px;
}

/* =====================================================
   ZOOM CONTROLS
===================================================== */

#zoom-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 20;                     /* AU-DESSUS DU CANVAS */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#zoom-controls button {
  width: 38px;
  height: 38px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
}

#zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {
  .graph-wrapper {
    height: 70vh;
    min-height: 420px;
  }

  #graph-filters {
    font-size: 12px;
    padding: 10px 12px;
  }

  #zoom-controls button {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}
