/* ------------------------ */
/*     Global & Layout      */
/* ------------------------ */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: #F5F5F7; /* Fond clair et neutre, style ChatGPT */
  }
  
  #main {
    flex: 1;
    position: relative;
    overflow: auto;
    background-color: #F5F5F7;
  }
  
  /* ------------------------ */
  /*        Sidebar           */
  /* ------------------------ */
  #sidebar {
    width: 300px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
  }
  
  #sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    text-align: center;
    color: #333;
  }
  
  /* Accordéon (Sections) */
  .sectionHeader {
    background-color: #f0f0f0;
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    margin: 10px 0;
    border-radius: 4px;
    color: #444;
  }
  
  .sectionContent {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #ffffff;
  }
  
  /* Par défaut, les sections importantes sont affichées */
  #dialogueSection,
  #assetSection,
  #saveSection {
    display: block;
  }
  
  /* ------------------------ */
  /*       Formulaires        */
  /* ------------------------ */
  #editForm {
    margin-top: 10px;
  }
  
  #editForm label {
    display: block;
    margin-top: 8px;
    color: #555;
  }
  
  #editForm input,
  #editForm select,
  #editForm textarea {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
  }
  
  #editForm h3,
  #editForm h4 {
    text-align: center;
    margin: 12px 0;
    color: #333;
  }
  
  /* Groupe de sélection du type de dialogue */
  .dialogTypeGroup {
    margin-top: 10px;
  }
  
  /* Groupes spécifiques pour vidéo et dialogues paramétrés */
  #videoUrlGroup,
  #parametrizedGroup {
    margin-top: 10px;
    display: none;
  }
  
  /* ------------------------ */
  /*         Assets           */
  /* ------------------------ */
  .assetPanel {
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
    margin-top: 10px;
  }
  
  .assetPanel h4 {
    text-align: center;
    margin: 10px 0;
    color: #333;
  }
  
  .assetPanel label {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: #555;
  }
  
  .assetPanel input,
  .assetPanel textarea {
    width: 100%;
    padding: 6px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.875rem;
  }
  
  .assetPanel button.plus-btn {
    margin-top: 5px;
    padding: 6px 12px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  /* Listes d'assets */
  .assetList {
    margin-top: 10px;
    padding: 10px;
    border-top: 1px dashed #ccc;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.8rem;
  }
  
  .assetList div {
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
  }
  
  .assetList button.editAssetBtn {
    padding: 4px 6px;
    background-color: #007aff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
  }
  
  /* ------------------------ */
  /*      Notification        */
  /* ------------------------ */
  #notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 100;
  }
  
  /* ------------------------ */
  /*        Drop Zone         */
  /* ------------------------ */
  #dropZone {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    color: #666;
  }
  
  /* ------------------------ */
  /*        Boutons           */
  /* ------------------------ */
  .plus-btn {
    display: inline-block;
    margin: 4px;
    padding: 6px 12px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
  }
  
  /* Bouton du menu contextuel dans les dialogues */
  .nodeMenuBtn {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #eee;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #000;
  }
  
  /* Bouton ajouter réponse dans le graphe */
  .plusChoiceBtn {
    display: inline-block;
    padding: 6px 10px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 4px;
  }
  
  /* Bouton de paramétrage sur les réponses */
  .paramsChoiceBtn {
    display: inline-block;
    padding: 6px 8px;
    background-color: #007aff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
  }
  
  /* Bouton pour ajouter une alternative */
  .altChoiceBtn {
    display: inline-block;
    padding: 6px 10px;
    background-color: #ff9500;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 4px;
  }
  
  /* ------------------------ */
  /*      Graph & Dagre-D3    */
  /* ------------------------ */
  #svgContainer {
    width: 100%;
    height: 100%;
  }
  
  /* Nœuds de dialogue */
  .node rect,
  .choiceNode rect {
    stroke: #e0e0e0;
    stroke-width: 1;
    rx: 10;
    ry: 10;
    fill: #fff;
    
  }

  .choiceNode rect {
    height: 60px;
  }
  
  /* Ajustement du style du texte dans les boîtes de dialogue */
  .node text,
  .choiceNode text {
    font-size: 0.9rem;   /* Augmentez pour plus de lisibilité */
    fill: #333;
    pointer-events: none;
  }
  
  /* Chemins de liaison */
  .edgePath path {
    stroke: #ccc;
    fill: none;
    stroke-width: 1.5px;
  }
  
  /* Étiquettes sur les arêtes (texte, bulles) */
  .edgeLabel text {
    font-size: 0.85rem; /* Taille de police un peu plus grande */
    fill: #555;
    text-anchor: middle;
  }
  
  /* Encadré pour l'étiquette */
  .edgeLabel rect {
    fill: #fff;
    stroke: #ccc;
    rx: 4;
    ry: 4;
  }
  
  /* ------------------------ */
  /*    Panneau de Contrôle   */
  /* ------------------------ */
  #rightMenu {
    position: absolute;
    right: 0;
    top: 0;
    width: 80px;
    height: 100vh;
    background-color: #ffffff;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 20;
  }
  
  #rightMenu h3 {
    margin-top: 0;
    text-align: center;
    font-size: 1rem;
    color: #333;
  }
  
  #rightMenu button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background-color: #007aff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
  }
  
  /* ------------------------ */
  /*       Modales            */
  /* ------------------------ */
  #modalOverlay,
  #linkModalOverlay,
  #colorModalOverlay,
  .assetModalOverlay,
  #paramModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 30;
  }
  
  .assetModal,
  #modal,
  #linkModal,
  #colorModal,
  #paramModal {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  h3 {
    margin-top: 0;
    text-align: center;
    color: #333;
  }
  
  label {
    display: block;
    margin-top: 8px;
    font-size: 0.875rem;
    color: #555;
  }
  
  input,
  textarea,
  select {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
  }
  
  button {
    margin-top: 10px;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
  }
  
  .modalButtons {
    text-align: center;
  }

   /* Menu contextuel */
   #nodeContextMenu {
    margin-left: 10px;
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 3px;
    z-index: 50;
  }
  #nodeContextMenu .contextOption {
    margin: 3px 0;
    cursor: pointer;
  }
  #nodeContextMenu .contextOption.delete {
    color: red;
    font-weight: bold;
  }
  .orphan { background-color: #ffcccc !important; }
  .drag-cursor { cursor: move !important; }