/* ==========================================================================
   ESTILOS PREMIUM - PRESENTACIÓN RIZOMÁTICA (PREZI NO LINEAL)
   ========================================================================== */

:root {
    --bg-dark: #05030b;
    --bg-card: rgba(16, 12, 30, 0.65);
    --bg-card-hover: rgba(22, 16, 42, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --accent-cyan: #00f2fe;
    --accent-magenta: #ff0844;
    --accent-purple: #7f00ff;
    
    --accent-cyan-glow: rgba(0, 242, 254, 0.25);
    --accent-magenta-glow: rgba(255, 8, 68, 0.25);
    --accent-purple-glow: rgba(127, 0, 255, 0.3);
    
    --text-primary: #f8f7fc;
    --text-secondary: #c0bccc;
    --text-muted: #747087;
    
    --shadow-main: 0 15px 45px rgba(0, 0, 0, 0.7);
    --backdrop-blur: blur(24px);
    
    --font-titles: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Reset de estructura */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ==========================================================================
   MODO EDICIÓN EN CALIENTE (ESTILOS ACTIVOS)
   ========================================================================== */

body.edit-mode-active {
    user-select: text; /* Permitir seleccionar texto para editar */
}

/* Contornos para elementos de texto editables activos */
body.edit-mode-active .editable-text[contenteditable="true"] {
    outline: none;
    border: 1px dashed var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
    border-radius: 6px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.25);
    cursor: text;
    transition: all 0.3s;
}

body.edit-mode-active .editable-text[contenteditable="true"]:focus {
    border-color: var(--accent-magenta);
    box-shadow: 0 0 12px rgba(255, 8, 68, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

/* Evitar que clics en enlaces en modo edición naveguen */
body.edit-mode-active a {
    pointer-events: none;
}

/* Botón de modo edición encendido */
#btnEditMode.active {
    background: var(--accent-magenta) !important;
    color: #fff !important;
    border-color: var(--accent-magenta) !important;
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.5) !important;
}

/* ==========================================================================
   FONDO DE ORBES DINÁMICOS
   ========================================================================== */

.bg-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #0a0617 0%, #020104 100%);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.16;
    mix-blend-mode: screen;
    animation: orb-float 22s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: var(--accent-cyan);
    bottom: -200px;
    right: -100px;
    animation-delay: -6s;
    animation-duration: 28s;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: var(--accent-magenta);
    top: 30%;
    left: 50%;
    animation-delay: -12s;
    animation-duration: 18s;
}

@keyframes orb-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 60px) scale(1.1); }
}

/* ==========================================================================
   ESTILOS DE VIDRIO (GLASSMORPHISM)
   ========================================================================== */

.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-main);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   HEADER Y LEYENDAS FLOTANTES
   ========================================================================== */

.app-header {
    position: fixed;
    top: 25px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
}

.badge-rizoma {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, rgba(0, 242, 254, 0.2) 100%);
    border: 1px solid rgba(0, 242, 254, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.logo-area h1 {
    font-family: var(--font-titles);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.author-area {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    pointer-events: auto;
}

.legend-box {
    position: fixed;
    top: 85px;
    left: 40px;
    padding: 10px 18px;
    border-radius: 30px;
    z-index: 100;
    font-size: 0.8rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.legend-box i {
    color: var(--accent-cyan);
    margin-right: 5px;
}

.animate-wiggle {
    animation: wiggle 2s infinite ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

/* ==========================================================================
   VIEWPORT Y LIENZO INFINITO (PREZI)
   ========================================================================== */

.app-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 10;
    cursor: grab;
}

.app-viewport:active {
    cursor: grabbing;
}

.prezi-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Capa SVG para conexiones */
.connections-layer {
    position: absolute;
    top: -2000px;
    left: -2000px;
    width: 4000px;
    height: 4000px;
    pointer-events: none;
    z-index: 1;
}

.connection-line {
    stroke: rgba(0, 242, 254, 0.12);
    stroke-width: 1.5px;
    stroke-dasharray: 6 6;
    transition: stroke 0.5s, stroke-width 0.5s;
}

.connection-line.highlighted {
    stroke: var(--accent-cyan);
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 4px var(--accent-cyan));
}

/* ==========================================================================
   NODOS DEL MAPA (CONSTELACIÓN)
   ========================================================================== */

.nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    z-index: 5;
}

.node {
    position: absolute;
    transform-style: preserve-3d;
    transform: translate3d(-50%, -50%, 0);
    z-index: 10;
    transition: opacity 0.6s, filter 0.6s, transform 0.3s;
}

/* Reducir brillo de nodos inactivos cuando hay uno seleccionado */
.prezi-canvas.has-active-node .node {
    opacity: 0.35;
    filter: blur(1.5px);
}

.prezi-canvas.has-active-node .node.active,
.prezi-canvas.has-active-node .node.connected {
    opacity: 1;
    filter: blur(0);
}

/* Círculo interior del nodo */
.node-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent-cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-cyan-glow);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.node-num {
    font-family: var(--font-titles);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent-cyan);
}

.node:hover .node-circle {
    transform: scale(1.15);
    border-color: var(--accent-purple);
    box-shadow: 0 0 25px var(--accent-purple-glow);
}

/* Nodo Activo */
.node.active .node-circle {
    transform: scale(1.2);
    border-color: var(--accent-magenta);
    background: var(--bg-card-hover);
    box-shadow: 0 0 30px var(--accent-magenta-glow);
}

.node.active .node-num {
    color: var(--accent-magenta);
}

/* Label del nodo */
.node-label {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    transition: color 0.3s;
}

.node:hover .node-label {
    color: var(--accent-cyan);
}

.node.active .node-label {
    color: var(--accent-magenta);
    font-size: 1.05rem;
}

/* Variaciones del Nodo Central */
.central-node .node-circle {
    width: 90px;
    height: 90px;
    border-color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(20, 12, 45, 0.85) 0%, rgba(127, 0, 255, 0.1) 100%);
    box-shadow: 0 0 25px var(--accent-purple-glow);
}

.central-node .node-circle i {
    font-size: 2rem;
    color: var(--accent-purple);
}

.central-node.active .node-circle i {
    color: var(--accent-magenta);
}

.central-node .node-label {
    top: 105px;
    font-size: 1.05rem;
}

/* ==========================================================================
   TARJETA DE DETALLE INTEGRADA
   ========================================================================== */

.node-card {
    position: absolute;
    top: -160px;
    left: 95px;
    width: 380px;
    max-height: 480px;
    overflow-y: scroll; /* Siempre mostrar la barra de desplazamiento */
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translate3d(-30px, 30px, 0);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 2.2rem;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Personalización y ensanchamiento al doble de la barra de desplazamiento de las tarjetas */
.node-card::-webkit-scrollbar {
    width: 12px; /* Ampliado al doble del ancho original de 6px */
    display: block;
}

.node-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin: 10px 0; /* Margen superior e inferior para no chocar con los bordes de la tarjeta */
}

body.light-theme .node-card::-webkit-scrollbar-track {
    background: rgba(12, 8, 30, 0.04);
}

.node-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18); /* Más visible por defecto */
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.light-theme .node-card::-webkit-scrollbar-thumb {
    background: rgba(85, 0, 179, 0.2);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.node-card::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.light-theme .node-card::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Cuando el nodo está activo, la tarjeta se expande */
.node.active .node-card {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translate3d(0, 0, 0);
}

.node-card h2 {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.node-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.node-card .intro-p {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.5;
}

.step-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.bg-magenta {
    background: rgba(255, 8, 68, 0.15);
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
}

.bg-purple {
    background: rgba(127, 0, 255, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Contenedores de Media (Imágenes / Vídeos) */
.media-container {
    width: 100%;
    margin-bottom: 1.2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.3);
    position: relative; /* Clave para el overlay de edición */
}

.card-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 180px;
    transition: transform 0.5s;
}

.media-container:hover .card-img {
    transform: scale(1.03);
}

.img-caption {
    display: block;
    padding: 8px 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
    background: rgba(10, 8, 22, 0.8);
    border-top: 1px solid var(--border-glass);
}

/* Overlay de Edición sobre la Imagen */
.edit-media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 11, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
    font-family: var(--font-titles);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, background-color 0.3s;
    z-index: 100;
}

.edit-media-overlay:hover {
    background: rgba(5, 3, 11, 0.85);
    color: var(--accent-magenta);
}

body.edit-mode-active .edit-media-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* SoundCloud link box */
.audio-box {
    width: 100%;
    margin-bottom: 1.2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 127, 80, 0.2);
    position: relative;
}

.audio-link {
    display: block;
    background: rgba(255, 127, 80, 0.05);
    transition: background-color 0.3s;
}

.audio-link:hover {
    background: rgba(255, 127, 80, 0.1);
}

.soundcloud-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80px;
    object-fit: cover;
    opacity: 0.85;
}

.audio-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #ff5500;
    font-weight: 600;
}

/* Galería de Vídeos Embebidos */
.videos-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 15px;
}

.video-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative; /* Para el botón flotante de edición */
}

.video-item span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.youtube-player {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: #000;
}

/* Botón flotante para editar la URL de vídeo */
.edit-video-btn {
    position: absolute;
    top: 25px;
    right: 8px;
    background: rgba(12, 8, 30, 0.9);
    border: 1px solid var(--accent-cyan);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--accent-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.edit-video-btn:hover {
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
    transform: translateY(-1px);
}

body.edit-mode-active .edit-video-btn {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   TARJETAS REBATIBLES (FLIP CARDS)
   ========================================================================== */

.flip-card-container {
    width: 100%;
    height: 90px;
    perspective: 800px;
    margin: 1.2rem 0;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

/* Bloquear rebatimiento hover automático si el modo edición está activo para permitir hacer click en los textos */
body:not(.edit-mode-active) .flip-card-container:hover .flip-card-inner,
.flip-card-container.flipped .flip-card-inner {
    transform: rotateX(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border-glass);
}

.flip-card-front {
    background: rgba(0, 242, 254, 0.04);
    border-color: rgba(0, 242, 254, 0.2);
    color: var(--text-primary);
}

.flip-card-front span {
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.flip-card-front strong {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
}

.flip-card-back {
    background: rgba(127, 0, 255, 0.08);
    border-color: rgba(127, 0, 255, 0.3);
    color: var(--text-secondary);
    transform: rotateX(180deg);
}

.flip-card-back p {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0;
}

/* Mini Grid de Tarjetas Rebatibles en Nodo 7 */
.nodes-flip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.small-flip-card {
    height: 80px;
    perspective: 500px;
    cursor: pointer;
}

body:not(.edit-mode-active) .small-flip-card:hover .flip-card-inner,
.small-flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.small-flip-card .flip-card-back {
    transform: rotateY(180deg);
    background: rgba(255, 8, 68, 0.08);
    border-color: rgba(255, 8, 68, 0.3);
}

.small-flip-card .flip-card-front {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-glass);
}

.small-flip-card .flip-card-front strong {
    font-size: 0.82rem;
    color: var(--accent-cyan);
}

.small-flip-card .flip-card-back p {
    font-size: 0.72rem;
    line-height: 1.3;
}

/* ==========================================================================
   DISEÑO RIZOMÁTICO GENERAL
   ========================================================================== */

.concept-split {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.split-col strong {
    color: var(--accent-cyan);
    font-size: 0.88rem;
    display: block;
    margin-bottom: 4px;
}

.split-col p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.timeline-list {
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timeline-list li strong {
    color: var(--text-primary);
}

.question-title {
    font-style: italic;
    border-left: 2px solid var(--accent-cyan);
    padding-left: 12px;
    font-size: 0.88rem !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
}

.cierre-quote {
    font-style: italic;
    color: var(--accent-magenta);
    border-left: 2px solid var(--accent-magenta);
    padding-left: 12px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.center-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
    padding-top: 10px;
    margin-top: 10px;
}

.hint-next {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
    margin-top: 10px;
}

.hint-next:hover {
    color: var(--accent-magenta);
}

.restart-btn {
    font-size: 0.78rem;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-magenta) 100%);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 8, 68, 0.3);
}

/* Ajustes de tarjeta cuando el nodo está en el lado derecho */
#node-2 .node-card,
#node-3 .node-card,
#node-4 .node-card {
    left: auto;
    right: 95px;
    transform: scale(0.8) translate3d(30px, 30px, 0);
}

#node-2.active .node-card,
#node-3.active .node-card,
#node-4.active .node-card {
    transform: scale(1) translate3d(0, 0, 0);
}

/* ==========================================================================
   CONTROLES FLOTANTES
   ========================================================================== */

.floating-controls {
    position: fixed;
    bottom: 30px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 40px;
    z-index: 1100; /* Asegurar que se superponga a modales y overlays */
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.icon-btn:active {
    transform: translateY(1px);
}

.highlight-btn {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--accent-cyan);
}

.highlight-btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.control-divider {
    width: 1px;
    height: 24px;
    background: var(--border-glass);
    margin: 0 4px;
}

/* ==========================================================================
   MINIMAPA (NAVEGADOR VISUAL)
   ========================================================================== */

.minimap-container {
    position: fixed;
    bottom: 30px;
    left: 40px;
    width: 130px;
    height: 130px;
    padding: 10px;
    z-index: 100;
    overflow: hidden;
}

.minimap-viewport {
    position: relative;
    width: 100%;
    height: 100%;
}

.minimap-node {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.center-dot { top: 50%; left: 50%; width: 10px; height: 10px; background: var(--accent-purple); }
.dot-1 { top: 15%; left: 50%; }
.dot-2 { top: 25%; left: 80%; }
.dot-3 { top: 60%; left: 90%; }
.dot-4 { top: 80%; left: 75%; }
.dot-5 { top: 80%; left: 25%; }
.dot-6 { top: 60%; left: 10%; }
.dot-7 { top: 25%; left: 20%; }
.dot-8 { top: 35%; left: 38%; }

.minimap-camera {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 24px;
    border: 1.5px solid var(--accent-cyan);
    background: rgba(0, 242, 254, 0.08);
    transform: translate(-50%, -50%);
    border-radius: 3px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* ==========================================================================
   MODAL DE GLOSARIO
   ========================================================================== */

.glosario-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 2, 7, 0.85);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.glosario-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.glosario-content {
    width: 90%;
    max-width: 600px;
    padding: 2.5rem;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 10px 40px rgba(0, 242, 254, 0.1);
}

.glosario-modal.open .glosario-content {
    transform: scale(1);
}

.glosario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.glosario-header h2 {
    font-family: var(--font-titles);
    font-size: 1.3rem;
    color: var(--accent-cyan);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--accent-magenta);
}

.glosario-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.glosario-item {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.glosario-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 3px;
    font-size: 1rem;
}

/* ==========================================================================
   RESPONSIVIDAD Y AJUSTES DE PANTALLA
   ========================================================================== */

@media (max-width: 1024px) {
    .node-card {
        width: 340px;
        padding: 1.8rem;
    }
}

@media (max-width: 768px) {
    .legend-box {
        display: none;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .node-card {
        position: fixed;
        bottom: 90px;
        left: 5% !important;
        right: 5% !important;
        width: 90% !important;
        top: auto !important;
        transform: scale(0.9) translate3d(0, 30px, 0) !important;
        pointer-events: none;
        max-height: 40vh;
        overflow-y: auto;
    }
    
    .node.active .node-card {
        pointer-events: auto;
        transform: scale(1) translate3d(0, 0, 0) !important;
    }
    
    .minimap-container {
        display: none;
    }
    
    .floating-controls {
        left: 10px !important;
        right: 10px !important;
        bottom: 20px !important;
        justify-content: center;
        gap: 4px !important;
        padding: 6px 10px !important;
        border-radius: 30px !important;
    }
    
    .floating-controls .icon-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.8rem !important;
    }

    .floating-controls .control-divider {
        height: 18px !important;
        margin: 0 2px !important;
    }
}

/* ==========================================================================
   TEMA DE DÍA (LIGHT MODE)
   ========================================================================== */
body.light-theme {
    --bg-dark: #f0ecfa;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.88);
    --border-glass: rgba(12, 8, 30, 0.08);
    
    --accent-cyan: #007799;
    --accent-magenta: #c90035;
    --accent-purple: #5500b3;
    
    --accent-cyan-glow: rgba(0, 119, 153, 0.1);
    --accent-magenta-glow: rgba(201, 0, 53, 0.1);
    --accent-purple-glow: rgba(85, 0, 179, 0.12);
    
    --text-primary: #120c24;
    --text-secondary: #403b54;
    --text-muted: #7f7a93;
    
    --shadow-main: 0 15px 40px rgba(12, 8, 30, 0.12);
}

body.light-theme .bg-mesh {
    background: radial-gradient(circle at 50% 50%, #e8e2fa 0%, #f0ecfa 100%);
}

body.light-theme .glow-orb {
    opacity: 0.18;
    mix-blend-mode: multiply;
}

body.light-theme .node-card h2 {
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .connection-line {
    stroke: rgba(85, 0, 179, 0.15);
}

body.light-theme .connection-line.highlighted {
    stroke: var(--accent-purple);
    filter: drop-shadow(0 0 3px var(--accent-purple-glow));
}

body.light-theme .glosario-modal {
    background: rgba(240, 236, 250, 0.82);
}

body.light-theme .glosario-content {
    border-color: rgba(85, 0, 179, 0.15);
    box-shadow: 0 10px 40px rgba(85, 0, 179, 0.08);
}

body.light-theme .editable-text[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--accent-purple);
}

body.light-theme .edit-media-overlay {
    background: rgba(240, 236, 250, 0.85);
    color: var(--accent-purple);
}

body.light-theme .edit-video-btn {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

body.light-theme .minimap-container {
    border-color: rgba(12, 8, 30, 0.08);
}

body.light-theme .minimap-node {
    background: #a5a0bd;
}

body.light-theme .minimap-camera {
    border-color: var(--accent-purple);
    background: rgba(85, 0, 179, 0.05);
}
