/* Reset y tipografía */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: "Barlow", sans-serif;
}
body {
  background-color: #f5f7fa;
  overflow: hidden;
  color: #333;
}

/* Sidebar */
#sidebar {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100vh;
  background: #fff; padding: 24px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  z-index: 1000;
}
#sidebar h2 {
  font-weight: 600; 
  color: #004080; 
  margin-bottom: 16px;
}
#sidebar h2 .muted {
  font-weight: 300; color: #777;
}
#problematicas-list {
  flex: 1; overflow-y: auto; margin-bottom: 16px;
}
#problematicas-list li {
  list-style: none;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #fafafa;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#problematicas-list li:hover { 
    background: #e8f0fe; 
}
#problematicas-list li.active {
  background: #004080;
  color: #fff;
  font-weight: 500;
}
.btn {
  display: flex; align-items: center;
  justify-content: center;
  border: none; border-radius: 6px;
  font-size: 1em; cursor: pointer;
  gap: 6px;
}
.btn.primary {
  background: #0066cc; color: #fff;
  padding: 10px;
}
.btn.primary:hover { background: #004a99; }
.btn.success {
  background: #28a745; color: #fff;
  padding: 10px 14px;
}
.btn.success:hover { background: #1e7e34; }

/* Header */
#main-header {
  position: fixed; top: 0; left: 260px;
  width: calc(100% - 260px); padding: 16px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center; z-index: 900;
}
#main-header h1 {
  font-size: 1.8em; color: #004080;
}
#objective-title {
  font-size: 1.1em; color: #555; margin-top: 4px;
}

/* SVG Canvas */
#canvas-container {
  position: absolute; top: 80px; left: 260px;
  width: calc(100% - 260px); height: calc(100% - 80px);
}
svg {
  width: 100%; 
  height: 100%;
  /* background-color: #fafbfc; */
}

/* Tooltip */
#tooltip {
  position: absolute; 
  padding: 10px 14px;
  background: #fff; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  pointer-events: none; opacity: 0;
  transition: opacity 0.15s;
  max-width: 220px; 
  font-size: 0.9em;
}
#tooltip h4 {
  margin-bottom: 4px;
  color: #0066cc; font-weight: 600;
}
#tooltip p { color: #333; }

/* Nodos y enlaces */
.node {
    cursor: pointer;
}
/* .node circle {
  stroke: #333; 
  stroke-width: 1.2px;
  transition: stroke-width 0.1s;
}
.node:hover circle { 
    stroke-width: 3px; 
} */
.link {
  stroke-opacity: 0.6; 
  stroke-width: 2px;
}

.node text {
  font-family: "Ubuntu", sans-serif;
  pointer-events: none;
  transition: fill 0.2s;
}

.node:hover text:not(.action-emoji) {
  fill: #004080;       /* solo los labels de nodo pasan a azul */
  stroke: #fff;        /* contorno blanco */
  stroke-width: 3px;
}

/* Modal */
.modal {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}
.modal-body {
  background: #fff; padding: 24px;
  border-radius: 10px; width: 90%; max-width: 400px;
  position: relative; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.close-modal {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 1.4em; color: #666;
}
.modal-body h3 {
  margin-bottom: 12px; color: #004080;
}
.modal-body label {
  display: block; margin: 8px 0 4px;
  font-weight: 500;
}
.modal-body input,
.modal-body textarea {
  width: 100%; padding: 8px;
  border: 1px solid #ccc; border-radius: 6px;
  font-size: 1em; resize: vertical;
}
.modal-body textarea { min-height: 60px; }

/* Floating Action Button “Añadir idea” */
#fab-add-idea {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 1500;
  transition: background 0.2s;
}
#fab-add-idea:hover {
  background: #1e7e34;
}
#fab-add-idea .material-icons {
  font-size: 1.4em;
}

/***************************************/
/* Contenedor de cada botón */
/* Fondo blanco de los botones */
.action-bg {
  fill: #fff;
  stroke: #ccc;
  stroke-width: 1px;
  cursor: pointer;
  transition: stroke 0.2s;
  color: #000;
}
.action-bg:hover {
  stroke: #888;
  color: #000;
}

/* Emoji de acción */
.action-emoji {
  font-size: 16px;
  text-anchor: middle;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}
.action-emoji:hover {
  transform: scale(1.2);
  color: #000;
}

#btn-auth {
  padding: 8px 16px;
  font-size: 1em;
  border-radius: 6px;
}
#auth-send, #btn-save-idea, #btn-save-subidea, #btn-save-problem, #auth-verify, #btn-save-edit{
  margin: 10px auto 0;
}

/* Empieza oculto; JS lo mostrará sólo si canAddProblem o canAddNode == true */
#open-add-problem-btn,
#fab-add-idea {
  display: none;
}

/* al final de style.css */

.btn.danger {
  background: #dc3545;    /* rojo bootstrap */
  color: #fff;
}
.btn.danger:hover {
  background: #bb2d3b;
}


/* ------------------------------------------------------------------------
   Tooltip “bonito” para botones de acción (+, 🖉)
------------------------------------------------------------------------ */
#action-tooltip {
  position: absolute;           /* Para poder moverlo con left/top */
  pointer-events: none;         /* Que no intercepte clics */
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  transition: opacity 0.1s ease;
  opacity: 0;
}

#action-tooltip.visible {
  opacity: 1;                   /* Cuando sea visible, opacity = 1 */
}

#action-tooltip.hidden {
  display: none;                /* Oculto por completo cuando está “hidden” */
}
