/* ═══════════════════════════════════════════════════════════════════
   style.css — Estilos principales de J.E.D.U.: Juego y Estrategia Digital Universal
   Proyecto: J.E.D.U. — Plataforma Interactiva con Three.js
   Tema visual: Oscuro con acentos neón azul/violeta
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset global ─────────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* Modelo de caja coherente en todos los elementos */
}

/* Cuerpo principal: fondo oscuro, sin scroll (la navegación es 3D) */
body {
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  background: #0a0a1a;
}

/* Contenedor del canvas Three.js: ocupa toda la pantalla */
#canvas-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}


/* ── HUD Superior ─────────────────────────────────────────────────── */
/* Barra superior tipo heads-up display con degradado hacia transparente */
#hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(10,10,30,0.95) 0%, transparent 100%);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

#hud-top h2 {
  color: #7dd3fc;         /* Azul cielo — color de marca del aula */
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

#hud-top .subtitle {
  color: #94a3b8;
  font-size: 12px;
}

/* Badges de modo de usuario (observador / estudiante / profesor) */
.mode-badge {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

/* Cada modo tiene su identidad de color */
.mode-profesor   { background: #7c3aed; color: white; border: 1px solid #a855f7; }
.mode-estudiante { background: #0369a1; color: white; border: 1px solid #38bdf8; }
.mode-observador { background: #374151; color: #9ca3af; border: 1px solid #4b5563; }

/* Botón toggle iluminación día/noche */
#daymode-btn {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fcd34d;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s;
}
#daymode-btn:hover {
  background: rgba(251, 191, 36, 0.28);
}


/* ── Panel lateral derecho ────────────────────────────────────────── */
/* Panel con blur glass-morphism que se desliza en/fuera de la pantalla */
#panel-right {
  position: absolute;
  right: 0; top: 60px; bottom: 0;
  width: 300px;
  background: rgba(10,10,30,0.92);
  backdrop-filter: blur(12px);   /* Efecto cristal esmerilado */
  border-left: 1px solid rgba(99,102,241,0.3);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.3s;
}

/* Clase que oculta el panel deslizándolo fuera del viewport */
#panel-right.hidden {
  transform: translateX(300px);
}

/* Contenedor de botones de pestaña */
.panel-tab {
  display: flex;
  border-bottom: 1px solid rgba(99,102,241,0.2);
}

/* Botón de pestaña individual (chat / clase / preguntas) */
.tab-btn {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Pestaña activa resaltada con azul */
.tab-btn.active {
  color: #7dd3fc;
  border-bottom: 2px solid #7dd3fc;
  background: rgba(125,211,252,0.05);
}


/* ── Sistema de Chat ──────────────────────────────────────────────── */
/* Contenedor de mensajes con scroll automático */
#chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Burbuja de mensaje de chat */
.chat-msg {
  background: rgba(30,41,59,0.8);
  border-radius: 10px;
  padding: 8px 10px;
  border-left: 3px solid #4f46e5;   /* Línea lateral de color como indicador de tipo */
  animation: slideIn 0.3s ease;      /* Animación de entrada */
}

/* Variantes por tipo de remitente */
.chat-msg.profesor { border-left-color: #7c3aed; }  /* Violeta para el profesor */
.chat-msg.sistema  { border-left-color: #10b981; background: rgba(16,185,129,0.08); } /* Verde para sistema */

.chat-msg .sender { font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.chat-msg .text   { font-size: 12px; color: #cbd5e1; line-height: 1.4; }
.chat-msg .time   { font-size: 10px; color: #475569; margin-top: 3px; }

/* Área de entrada de texto del chat */
#chat-input-area {
  padding: 10px;
  border-top: 1px solid rgba(99,102,241,0.2);
  display: flex;
  gap: 6px;
}

#chat-input {
  flex: 1;
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(99,102,241,0.3);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
}

/* Borde azul al enfocar el input */
#chat-input:focus { border-color: #7dd3fc; }

/* Botón de enviar mensaje */
#chat-send {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

#chat-send:hover { background: #6366f1; }


/* ── Lista de Estudiantes ─────────────────────────────────────────── */
#students-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* Tarjeta de estudiante en la lista */
.student-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(30,41,59,0.6);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.student-item:hover {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.3);
}

/* Avatar circular pequeño con iniciales */
.student-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.student-info { flex: 1; }
.student-name   { font-size: 12px; font-weight: 600; color: #e2e8f0; }
.student-status { font-size: 10px; color: #64748b; }

/* Botón eliminar estudiante avatar */
.remove-student-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  line-height: 1;
}
.student-item:hover .remove-student-btn { opacity: 1; }
.remove-student-btn:hover { background: rgba(239,68,68,0.15); }

/* Indicador de estado (punto de color) */
.status-dot    { width: 8px; height: 8px; border-radius: 50%; }
.status-online { background: #10b981; } /* Verde = conectado */
.status-away   { background: #f59e0b; } /* Amarillo = ausente */

/* Botón para agregar nuevo estudiante avatar */
#add-student-btn {
  margin: 10px;
  background: rgba(99,102,241,0.2);
  border: 1px dashed rgba(99,102,241,0.5);
  color: #818cf8;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  width: calc(100% - 20px);
}

#add-student-btn:hover { background: rgba(99,102,241,0.3); }


/* ── Panel de Preguntas ───────────────────────────────────────────── */
#questions-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* Tarjeta de pregunta con borde amarillo de alerta */
.question-item {
  background: rgba(30,41,59,0.8);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border-left: 3px solid #f59e0b; /* Amarillo = pendiente de respuesta */
}

.question-item .q-text   { font-size: 12px; color: #fde68a; margin-bottom: 6px; }
.question-item .q-meta   { font-size: 10px; color: #64748b; }

/* Respuesta generada por IA */
.question-item .q-answer {
  font-size: 12px;
  color: #86efac;        /* Verde claro = respuesta positiva */
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(99,102,241,0.2);
}

/* Botón para que el profesor solicite respuesta IA */
.answer-btn {
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
}

.answer-btn:hover { background: #6d28d9; }


/* ── Cuadro de Diálogo 3D ─────────────────────────────────────────── */
/* Panel flotante que aparece al interactuar con un personaje */
#dialogue-box {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(10,10,30,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 16px;
  padding: 18px;
  width: 380px;
  z-index: 20;
  display: none;           /* Oculto por defecto, se activa al interactuar */
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

#dialogue-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* Avatar circular del personaje en el diálogo */
#dialogue-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

#dialogue-name { font-size: 14px; font-weight: 700; color: #e2e8f0; }
#dialogue-role { font-size: 11px; color: #64748b; }

/* Historial de mensajes del diálogo con scroll */
#dialogue-content {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* Burbuja de mensaje en el diálogo */
.d-msg {
  background: rgba(30,41,59,0.7);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Mensaje enviado por el usuario (tono violeta) */
.d-msg.user {
  background: rgba(99,102,241,0.2);
  border-left: 2px solid #818cf8;
}

/* Opciones de respuesta predefinidas */
.d-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Botón de opción de respuesta */
.d-option {
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: all 0.2s;
}

/* Efecto de desplazamiento lateral al hover */
.d-option:hover {
  background: rgba(99,102,241,0.2);
  border-color: #818cf8;
  color: #e2e8f0;
  transform: translateX(3px);
}

/* Área de entrada personalizada en el diálogo */
#dialogue-custom {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

#d-input {
  flex: 1;
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(99,102,241,0.3);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  outline: none;
}

#d-input:focus { border-color: #7dd3fc; }

#d-send {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

/* Botón para cerrar el diálogo */
#d-close {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 16px;
}


/* ── Botón de Música Lo-Fi ────────────────────────────────────────── */
#music-ctrl {
  position: fixed;
  bottom: 70px; right: 20px;
  width: 52px; height: 52px;
  background: rgba(15,23,42,0.75);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 100;
  backdrop-filter: blur(6px);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  user-select: none;
}

#music-ctrl:hover {
  background: rgba(99,102,241,0.2);
  border-color: rgba(139,92,246,0.7);
}

#music-ctrl.playing {
  background: rgba(99,102,241,0.25);
  border-color: rgba(139,92,246,0.8);
  box-shadow: 0 0 12px rgba(139,92,246,0.4);
}

#music-icon {
  font-size: 18px;
  line-height: 1;
}

#music-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: #94a3b8;
  font-family: 'Segoe UI', sans-serif;
  text-transform: uppercase;
}

#music-ctrl.playing #music-label {
  color: #a5b4fc;
}


/* ── Controles de Teclado (Hint) ──────────────────────────────────── */
/* Pequeño panel de ayuda con los atajos de teclado */
#controls-hint {
  position: absolute;
  bottom: 20px; right: 310px;
  background: rgba(10,10,30,0.85);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  color: #64748b;
  font-size: 11px;
  z-index: 10;
}

/* Teclas resaltadas en violeta */
#controls-hint span {
  color: #818cf8;
  font-weight: 600;
}


/* ── Prompt de Interacción ────────────────────────────────────────── */
/* Indicador flotante centrado que aparece al acercarse a un personaje */
#interact-prompt {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) translateY(80px);
  background: rgba(99,102,241,0.9);
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: none;           /* Solo visible cuando hay personaje cercano */
  z-index: 15;
  pointer-events: none;    /* No interfiere con los clics del usuario */
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}


/* ── Toggle del Panel Lateral ─────────────────────────────────────── */
/* Botón pequeño que permite colapsar/expandir el panel derecho */
#panel-toggle {
  position: absolute;
  right: 300px; top: 50%;
  transform: translateY(-50%);
  background: rgba(99,102,241,0.8);
  color: white;
  border: none;
  width: 24px; height: 50px;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  font-size: 12px;
  z-index: 11;
  transition: all 0.2s;
}

/* Posición cuando el panel está oculto */
#panel-toggle.panel-hidden { right: 0; }
#panel-toggle:hover        { background: rgba(99,102,241,1); }


/* ── Modal: Agregar Estudiante ────────────────────────────────────── */
/* Ventana modal centrada para crear un nuevo avatar de estudiante */
#add-modal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10,10,30,0.98);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 16px;
  padding: 24px;
  width: 340px;
  z-index: 30;
  display: none;           /* Oculto por defecto */
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

#add-modal h3 {
  color: #7dd3fc;
  margin-bottom: 16px;
  font-size: 16px;
}

/* Campo de formulario del modal */
.modal-field {
  margin-bottom: 12px;
}

.modal-field label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.modal-field input,
.modal-field select {
  width: 100%;
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(99,102,241,0.3);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.modal-field input:focus,
.modal-field select:focus { border-color: #7dd3fc; }

/* Grilla de opciones de color para el avatar */
.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 4px;
}

/* Círculo de color seleccionable */
.color-opt {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

/* Color seleccionado: borde blanco y escala aumentada */
.color-opt.selected {
  border-color: white;
  transform: scale(1.2);
}

/* Botones de acción del modal */
.modal-btns {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-primary {
  flex: 1;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary:hover { background: #6366f1; }

.btn-secondary {
  flex: 1;
  background: transparent;
  color: #64748b;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-secondary:hover { color: #94a3b8; }


/* ── Indicadores de Carga ─────────────────────────────────────────── */
/* Punto pulsante para indicar que la IA está generando respuesta */
.loading-dot {
  display: inline-block;
  animation: pulse 1s infinite;
}

/* Animaciones de utilidad */
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}


/* ── Overlay del Pizarrón ─────────────────────────────────────────── */
/* Panel en la esquina superior izquierda con el tema de la clase */
#board-overlay {
  position: absolute;
  top: 70px; left: 20px;
  background: rgba(10,10,30,0.92);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 12px;
  padding: 12px;
  width: 260px;
  z-index: 10;
}

#board-overlay h4 {
  color: #7dd3fc;
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

#board-topic {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 6px;
}

#board-subtopics {
  font-size: 11px;
  color: #64748b;
  line-height: 1.8;
}

#board-subtopics span { display: block; }

/* Flecha de color violeta antes de cada subtema */
#board-subtopics span::before {
  content: "→ ";
  color: #818cf8;
}


/* ── Notificaciones Flotantes ─────────────────────────────────────── */
/* Toast de notificación que aparece brevemente en la parte superior */
.notif {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16,185,129,0.9);  /* Verde success */
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 25;
  animation: notifAnim 3s forwards;  /* Aparece y desaparece automáticamente */
  pointer-events: none;
}

/* Animación completa del toast: sube, se queda, y desaparece */
@keyframes notifAnim {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}


/* ═══════════════════════════════════════════════════════════════════
   MÓDULOS — HUB 3D: Hint de proximidad
   ═══════════════════════════════════════════════════════════════════ */

#module-proximity-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,30,0.92);
  border: 1px solid rgba(99,102,241,0.5);
  color: #a5b4fc;
  padding: 8px 22px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  z-index: 20;
  backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}

/* ── Botón único de Configuración del Profesor ───────────────────── */
#prof-settings-btn {
  background: rgba(99,102,241,0.2);
  border: 1px solid rgba(99,102,241,0.45);
  color: #c4b5fd;
  border-radius: 8px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
  white-space: nowrap;
}
#prof-settings-btn:hover { background: rgba(99,102,241,0.38); }
.psb-arrow { font-size: 9px; opacity: 0.7; }

/* Dropdown del menú de configuración */
#prof-settings-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(8,8,24,0.97);
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.65);
  backdrop-filter: blur(12px);
}
#prof-settings-dropdown.open { display: flex; }

#prof-settings-dropdown button {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  width: 100%;
}
#prof-settings-dropdown button:hover {
  background: rgba(99,102,241,0.22);
  color: #e2e8f0;
}


/* ═══════════════════════════════════════════════════════════════════
   POPUP — MÓDULO BLOQUEADO
   ═══════════════════════════════════════════════════════════════════ */

#module-locked-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#module-locked-popup.active { display: flex; }

.locked-popup-card {
  background: linear-gradient(135deg, #0a0f1a 0%, #0d1628 100%);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 20px;
  padding: 44px 48px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 60px rgba(239,68,68,0.15), inset 0 1px rgba(255,255,255,0.04);
}

.locked-icon-big {
  font-size: 68px;
  margin-bottom: 18px;
  display: block;
  animation: lockPulse 2.2s ease-in-out infinite;
}
@keyframes lockPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40%       { transform: scale(1.12) rotate(-4deg); }
  60%       { transform: scale(1.12) rotate(4deg); }
}

.locked-popup-card h2 {
  color: #ef4444;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 14px;
}
.locked-popup-card p {
  color: #94a3b8;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.locked-popup-card strong { color: #fbbf24; }

.locked-countdown {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 28px;
  color: #fca5a5;
  font-size: 14px;
}

.locked-popup-card button {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  border: none;
  padding: 12px 36px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.5px;
}
.locked-popup-card button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}


/* ═══════════════════════════════════════════════════════════════════
   POPUP — MÓDULO YA COMPLETADO
   ═══════════════════════════════════════════════════════════════════ */
#module-played-popup {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.82); z-index: 2000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
#module-played-popup.active { display: flex; }
.played-popup-card {
  background: linear-gradient(135deg, #0a0f1a, #0d1628);
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 20px; padding: 44px 48px;
  text-align: center; max-width: 420px; width: 90%;
  box-shadow: 0 0 60px rgba(251,191,36,0.12);
}
.played-icon-big {
  font-size: 68px; margin-bottom: 18px; display: block;
  animation: lockPulse 2.2s ease-in-out infinite;
}
.played-popup-card h2 { color: #fbbf24; font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.played-popup-card p  { color: #94a3b8; font-size: 16px; margin-bottom: 18px; }
.played-score-card {
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 14px; padding: 14px 20px; margin-bottom: 14px;
}
.played-score-label { color: #94a3b8; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.played-score-value { color: #fbbf24; font-size: 46px; font-weight: 900; font-family: monospace; }
.played-rank-badge  { color: #a5b4fc; font-size: 15px; font-weight: 600; margin-bottom: 28px; }
.played-popup-card button {
  background: linear-gradient(135deg, #b45309, #92400e);
  color: white; border: none; padding: 12px 36px;
  border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 700;
  transition: opacity 0.2s, transform 0.15s;
}
.played-popup-card button:hover { opacity: 0.88; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════════
   KAHOOT — OVERLAY COMPLETO
   ═══════════════════════════════════════════════════════════════════ */

#kahoot-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a0533, #0d1628);
  z-index: 2000;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
}
#kahoot-overlay.active { display: block; }

/* ── Lobby ── */
#kahoot-lobby {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 0;
}

.kahoot-logo-header {
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
  margin-bottom: 4px;
  text-shadow: 0 0 40px rgba(139,92,246,0.6);
}
.kahoot-logo-header .logo-accent { color: #7c3aed; }

#kahoot-module-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
}

.kahoot-player-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.kahoot-player-setup label {
  color: #c4b5fd;
  font-size: 16px;
  font-weight: 600;
}
#kahoot-player-name {
  background: rgba(255,255,255,0.08);
  border: 2px solid #7c3aed;
  border-radius: 14px;
  color: white;
  font-size: 20px;
  padding: 12px 24px;
  text-align: center;
  outline: none;
  width: 300px;
  transition: border-color 0.2s;
}
#kahoot-player-name:focus { border-color: #a78bfa; }

#kahoot-q-info {
  color: #8b5cf6;
  font-size: 15px;
  margin-bottom: 32px;
}

#kahoot-start-btn {
  background: #46178f;
  color: white;
  border: none;
  border-radius: 18px;
  padding: 18px 52px;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
  width: 300px;
  letter-spacing: 1px;
  box-shadow: 0 8px 32px rgba(70,23,143,0.5);
}
#kahoot-start-btn:hover {
  filter: brightness(1.2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(70,23,143,0.65);
}

.kahoot-close-btn {
  background: transparent;
  color: #6b7280;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 10px 28px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.kahoot-close-btn:hover { color: #9ca3af; border-color: #6b7280; }

/* ── Fase de juego ── */
#kahoot-playing {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.kahoot-game-header {
  background: #46178f;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#kahoot-q-counter {
  color: #c4b5fd;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.kahoot-timer-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #7c3aed;
  border: 4px solid #a78bfa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
}
#kahoot-timer {
  color: white;
  font-size: 24px;
  font-weight: 900;
  transition: transform 0.15s, color 0.3s;
  font-variant-numeric: tabular-nums;
}

#kahoot-score-display {
  color: #a78bfa;
  font-weight: 800;
  font-size: 18px;
}

.kahoot-question-box {
  background: white;
  margin: 20px 20px 10px;
  border-radius: 18px;
  padding: 28px 32px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
#kahoot-question-text {
  font-size: 24px;
  font-weight: 800;
  color: #1a0533;
  text-align: center;
  line-height: 1.4;
}

.kahoot-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 20px 80px;
  flex: 1;
}

.kahoot-opt {
  border: none;
  border-radius: 14px;
  padding: 18px 16px;
  font-size: 18px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s;
  min-height: 75px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.kahoot-opt:hover:not(:disabled) {
  transform: scale(1.03);
  filter: brightness(1.12);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.kahoot-opt:disabled { cursor: default; }
.kahoot-opt .opt-shape { font-size: 22px; flex-shrink: 0; }

.opt-A { background: #e21b3c; }
.opt-B { background: #1368ce; }
.opt-C { background: #26890c; }
.opt-D { background: #ffa602; color: #1a0533; }

.kahoot-opt.correct-reveal {
  outline: 5px solid #4ade80;
  filter: brightness(1.15);
  transform: scale(1.04);
}
.kahoot-opt.wrong { opacity: 0.35; }

/* Barra de feedback respuesta */
#kahoot-answer-feedback {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 16px 24px;
  align-items: center;
  gap: 16px;
  z-index: 10;
  display: none; /* JS usa style.display = 'flex' para mostrarlo */
}
#kahoot-answer-feedback.correct-bg { background: #166534; }
#kahoot-answer-feedback.wrong-bg   { background: #7f1d1d; }
#kahoot-answer-feedback.timeout-bg { background: #1e3a5f; }

.kahoot-feedback-icon { font-size: 40px; flex-shrink: 0; }
.kahoot-feedback-text {
  color: white;
  font-size: 20px;
  font-weight: 800;
  flex: 1;
}
#kahoot-next-btn {
  background: white;
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  color: #1a0533;
  transition: all 0.2s;
  flex-shrink: 0;
}
#kahoot-next-btn:hover { background: #f3f4f6; transform: translateY(-1px); }

/* ── Resultados finales ── */
#kahoot-final {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.kahoot-trophy-icon {
  font-size: 90px;
  margin-bottom: 16px;
  animation: kahooBounce 1s ease infinite;
}
@keyframes kahooBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}

#kahoot-final h2 {
  color: white;
  font-size: 38px;
  font-weight: 900;
  margin-bottom: 24px;
}

.kahoot-final-score-card {
  background: rgba(255,255,255,0.08);
  border: 2px solid #7c3aed;
  border-radius: 22px;
  padding: 28px 64px;
  margin-bottom: 20px;
  box-shadow: 0 0 40px rgba(124,58,237,0.25);
}
.kahoot-score-label {
  color: #c4b5fd;
  font-size: 14px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.kahoot-score-value {
  color: white;
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
}
#kahoot-final-accuracy {
  color: #a78bfa;
  font-size: 18px;
  margin-top: 10px;
}

#kahoot-final-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a0533;
  padding: 10px 30px;
  border-radius: 30px;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 28px;
  display: inline-block;
  min-height: 40px;
  line-height: 20px;
}

.kahoot-return-btn {
  background: #46178f;
  color: white;
  border: none;
  border-radius: 16px;
  padding: 16px 44px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 8px 28px rgba(70,23,143,0.45);
}
.kahoot-return-btn:hover {
  background: #6d28d9;
  transform: translateY(-3px);
}


/* ═══════════════════════════════════════════════════════════════════
   TEACHER ADMIN MODAL
   ═══════════════════════════════════════════════════════════════════ */

#teacher-admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
#teacher-admin-modal.active { display: flex; }

.admin-modal-content {
  background: linear-gradient(160deg, #080e1c, #0d1628);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 22px;
  width: 92%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(99,102,241,0.18), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid rgba(99,102,241,0.2);
  flex-shrink: 0;
}
.admin-modal-header h2 {
  color: #a5b4fc;
  font-size: 18px;
  font-weight: 700;
}
.admin-header-close {
  background: transparent;
  border: 1px solid #374151;
  color: #64748b;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.admin-header-close:hover { border-color: #6b7280; color: #94a3b8; }

#admin-mod-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(99,102,241,0.15);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.admin-mod-tab {
  padding: 8px 20px;
  border-radius: 10px;
  border: 1px solid rgba(99,102,241,0.2);
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.admin-mod-tab:hover { color: #94a3b8; border-color: rgba(99,102,241,0.4); }
.admin-mod-tab.active {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.5);
  color: #a5b4fc;
}

#admin-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
}
#admin-modal-body::-webkit-scrollbar { width: 6px; }
#admin-modal-body::-webkit-scrollbar-track { background: transparent; }
#admin-modal-body::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }

.admin-unlock-field {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(99,102,241,0.18);
  flex-wrap: wrap;
}
.admin-unlock-field label {
  color: #94a3b8;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 600;
}
.admin-unlock-field input[type="date"] {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 8px;
  color: #e2e8f0;
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.admin-unlock-field input[type="date"]:focus { border-color: rgba(99,102,241,0.7); }
.admin-unlock-hint {
  font-size: 13px;
  font-weight: 700;
}

.admin-questions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-questions-header h4 {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.admin-add-q-btn {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.35);
  color: #4ade80;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-add-q-btn:hover { background: rgba(34,197,94,0.22); }

.admin-question-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.admin-question-item:hover { border-color: rgba(99,102,241,0.3); }

.admin-q-textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(99,102,241,0.2);
  color: #e2e8f0;
  font-size: 14px;
  width: 100%;
  padding: 4px 0 10px;
  margin-bottom: 12px;
  outline: none;
  resize: none;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.5;
}
.admin-q-textarea:focus { border-bottom-color: rgba(99,102,241,0.5); }

.admin-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-opt-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.admin-opt-wrapper.is-correct { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.07); }
.admin-opt-shape { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.admin-opt-input {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 12px;
  flex: 1;
  outline: none;
  min-width: 0;
}
.admin-correct-btn {
  background: transparent;
  border: 1px solid #374151;
  border-radius: 50%;
  width: 24px; height: 24px;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.admin-correct-btn:hover { border-color: #4ade80; color: #4ade80; }
.admin-correct-btn.is-correct-btn { background: #166534; border-color: #4ade80; color: #4ade80; }

.admin-q-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.admin-q-footer label { color: #64748b; font-size: 11px; }
.admin-time-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 6px;
  color: #e2e8f0;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}
.admin-del-q-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-del-q-btn:hover { background: rgba(239,68,68,0.2); }

.admin-modal-footer {
  padding: 16px 26px;
  border-top: 1px solid rgba(99,102,241,0.18);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.admin-download-btn {
  background: rgba(6,182,212,0.12);
  border: 1px solid rgba(6,182,212,0.35);
  color: #22d3ee;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-download-btn:hover { background: rgba(6,182,212,0.22); }
.admin-save-btn {
  background: rgba(99,102,241,0.25);
  border: 1px solid rgba(99,102,241,0.5);
  color: #a5b4fc;
  border-radius: 10px;
  padding: 9px 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-save-btn:hover { background: rgba(99,102,241,0.4); }


/* ── Sección CSV del admin ─────────────────────────────────────────── */
.admin-csv-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
}

.admin-csv-header { margin-bottom: 12px; }

.admin-csv-title {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.admin-csv-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* Botón descargar plantilla */
.admin-csv-template-btn {
  background: rgba(6,182,212,0.10);
  border: 1px solid rgba(6,182,212,0.35);
  color: #22d3ee;
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-csv-template-btn:hover { background: rgba(6,182,212,0.20); }

/* Label-botón de importar (envuelve el <input type="file"> invisible) */
.admin-csv-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.38);
  color: #c4b5fd;
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-csv-import-btn:hover { background: rgba(139,92,246,0.22); }

/* Bloque de descripción del formato */
.admin-csv-format {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-csv-format-title {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.admin-csv-code {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 12px;
  color: #a78bfa;
  background: rgba(139,92,246,0.08);
  padding: 6px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  word-break: break-all;
}

.admin-csv-format-note {
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}
.admin-csv-format-note b { color: #94a3b8; }

/* Feedback de importación */
.admin-csv-feedback {
  margin-top: 12px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.admin-csv-feedback--ok {
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.35);
  color: #86efac;
}
.admin-csv-feedback--error {
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.35);
  color: #fca5a5;
}
.admin-csv-feedback ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.admin-csv-feedback li { margin-bottom: 3px; }


/* ═══════════════════════════════════════════════════════════════════
   CONCEPTOS — Hint de proximidad
   ═══════════════════════════════════════════════════════════════════ */

#concept-proximity-hint {
  position: absolute;
  bottom: 115px;          /* Encima del module-proximity-hint */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,30,0.92);
  border: 1px solid rgba(6,182,212,0.5);
  color: #67e8f9;
  padding: 7px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  z-index: 20;
  backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(6,182,212,0.25);
}

/* #concept-admin-btn — reemplazado por #prof-settings-dropdown */


/* ═══════════════════════════════════════════════════════════════════
   CONCEPTOS — Popup de detalle (tecla E)
   ═══════════════════════════════════════════════════════════════════ */

#concept-detail-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#concept-detail-popup.active { display: flex; }

.cd-card {
  background: linear-gradient(150deg, #08101e, #0d1628);
  border: 1px solid rgba(var(--concept-color-rgb, 6,182,212), 0.35);
  border-top: 3px solid var(--concept-color, #06b6d4);
  border-radius: 20px;
  width: 92%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px 30px 24px;
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,0.6),
              0 0 0 1px rgba(255,255,255,0.03) inset;
  animation: cdSlideIn 0.25s ease;
}
@keyframes cdSlideIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cd-close {
  position: absolute;
  top: 14px; right: 14px;
  background: transparent;
  border: 1px solid #374151;
  color: #64748b;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cd-close:hover { border-color: #6b7280; color: #94a3b8; }

.cd-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.cd-icon {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}

.cd-header-text { display: flex; flex-direction: column; gap: 2px; }

.cd-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--concept-color, #06b6d4);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cd-nombre {
  font-size: 22px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.2;
}

.cd-body { display: flex; flex-direction: column; gap: 14px; }

.cd-resumen {
  font-size: 15px;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.5;
}

.cd-divider {
  height: 1px;
  background: linear-gradient(90deg,
    var(--concept-color, #06b6d4) 0%, transparent 100%);
  opacity: 0.3;
}

.cd-detalle {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.7;
}

.cd-ejemplos-section { margin-top: 4px; }

.cd-ejemplos-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--concept-color, #06b6d4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.cd-ejemplos {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

.cd-ejemplos li {
  font-size: 13px;
  color: #94a3b8;
  padding: 7px 12px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--concept-color, #06b6d4);
  border-radius: 0 8px 8px 0;
  line-height: 1.4;
}

/* Scrollbar del popup */
.cd-card::-webkit-scrollbar { width: 5px; }
.cd-card::-webkit-scrollbar-track { background: transparent; }
.cd-card::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }


/* ═══════════════════════════════════════════════════════════════════
   CONCEPTOS — Modal Admin
   ═══════════════════════════════════════════════════════════════════ */

#concept-admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
#concept-admin-modal.active { display: flex; }

.ca-modal-content {
  background: linear-gradient(160deg, #080e1c, #0d1628);
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 22px;
  width: 96%;
  max-width: 860px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(6,182,212,0.12), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

.ca-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid rgba(6,182,212,0.18);
  flex-shrink: 0;
}
.ca-modal-header h2 {
  color: #67e8f9;
  font-size: 18px;
  font-weight: 700;
}

.ca-header-close {
  background: transparent;
  border: 1px solid #374151;
  color: #64748b;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ca-header-close:hover { border-color: #6b7280; color: #94a3b8; }

/* Layout dos columnas */
.ca-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar lista de conceptos */
.ca-sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid rgba(6,182,212,0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ca-sidebar-title {
  padding: 12px 14px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  flex-shrink: 0;
}

#ca-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}
#ca-list::-webkit-scrollbar { width: 4px; }
#ca-list::-webkit-scrollbar-track { background: transparent; }
#ca-list::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); border-radius: 2px; }

.ca-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  margin-bottom: 2px;
}
.ca-list-item:hover { background: rgba(255,255,255,0.04); color: #94a3b8; }
.ca-list-item.active { color: #e2e8f0; }

.ca-list-icon { font-size: 16px; flex-shrink: 0; }
.ca-list-name { flex: 1; font-size: 11px; line-height: 1.3; word-break: break-word; }
.ca-list-num  { font-size: 10px; color: #475569; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* Área de formulario */
.ca-form-area {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}
.ca-form-area::-webkit-scrollbar { width: 5px; }
.ca-form-area::-webkit-scrollbar-track { background: transparent; }
.ca-form-area::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); border-radius: 3px; }

/* Fila de campos horizontales */
.ca-form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ca-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.ca-form-group label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ca-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 8px;
  color: #e2e8f0;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  font-family: 'Segoe UI', sans-serif;
}
.ca-input:focus { border-color: rgba(6,182,212,0.55); }

.ca-icon-input {
  font-size: 22px;
  text-align: center;
  padding: 4px 8px;
}

.ca-textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,102,241,0.22);
  border-radius: 8px;
  color: #e2e8f0;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  width: 100%;
  resize: vertical;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
  transition: border-color 0.2s;
}
.ca-textarea:focus { border-color: rgba(6,182,212,0.5); }

.ca-color-hex {
  font-size: 12px;
  color: #64748b;
  font-family: monospace;
}

/* Sección CSV dentro del admin de conceptos */
.ca-csv-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(6,182,212,0.18);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 6px;
}

.ca-csv-title {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.ca-csv-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ca-csv-template-btn {
  background: rgba(6,182,212,0.10);
  border: 1px solid rgba(6,182,212,0.35);
  color: #22d3ee;
  border-radius: 9px;
  padding: 7px 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.ca-csv-template-btn:hover { background: rgba(6,182,212,0.20); }

.ca-csv-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.38);
  color: #c4b5fd;
  border-radius: 9px;
  padding: 7px 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.ca-csv-import-btn:hover { background: rgba(139,92,246,0.22); }

.ca-csv-format {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.22);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}
.ca-csv-format-title {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}
.ca-csv-code {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 11px;
  color: #a78bfa;
  background: rgba(139,92,246,0.08);
  padding: 5px 9px;
  border-radius: 5px;
  word-break: break-all;
}
.ca-csv-format-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.55;
}
.ca-csv-format-note b { color: #94a3b8; }

/* Footer del modal */
.ca-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(6,182,212,0.14);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   ESTACIÓN DE ESTUDIO — Hint de proximidad y botón HUD
   ═══════════════════════════════════════════════════════════════════ */

#study-proximity-hint {
  position: absolute;
  bottom: 150px;          /* Por encima del concept-proximity-hint */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,30,0.92);
  border: 1px solid rgba(16,185,129,0.5);
  color: #6ee7b7;
  padding: 7px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  z-index: 20;
  backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(16,185,129,0.22);
}

/* #study-admin-btn, #unidades-admin-btn, #dashboard-admin-btn, #prof-avatar-btn
   — reemplazados por #prof-settings-dropdown */

/* Hint de proximidad con la pizarra dashboard */
#board-proximity-hint {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,30,0.85);
  border: 1px solid rgba(251,191,36,0.5);
  color: #fde68a;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  display: none;
  z-index: 20;
  backdrop-filter: blur(6px);
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════
   PIZARRA DASHBOARD — Viewer Modal interactivo
   Abre al presionar E cerca de la pizarra central.
   ═══════════════════════════════════════════════════════════════════ */

/* Overlay fullscreen */
#board-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,5,15,0.82);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

/* Panel central */
.bv-modal {
  width: min(880px, 95vw);
  max-height: 90vh;
  background: rgba(4,8,20,0.98);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(99,102,241,0.2);
}

/* Header */
.bv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(90deg, rgba(6,182,212,0.12) 0%, rgba(139,92,246,0.1) 50%, rgba(16,185,129,0.12) 100%);
  border-bottom: 1px solid rgba(30,58,95,0.8);
}
.bv-header-titles { display: flex; flex-direction: column; gap: 2px; }
.bv-header-title  { color: #f1f5f9; font-size: 16px; font-weight: 700; font-family: monospace; }
.bv-header-sub    { color: #64748b; font-size: 12px; font-family: monospace; }
.bv-close-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.bv-close-btn:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; }

/* Grid 2×2 */
.bv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: #1e3a5f;
  flex: 1;
  overflow: hidden;
}
.bv-section {
  background: #060f1e;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 180px;
}
.bv-section-title {
  font-size: 13px;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Filas de módulo con barra de progreso */
.bv-mod-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bv-mod-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bv-mod-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.bv-mod-name {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bv-mod-sub  { color: #64748b; font-weight: 400; }
.bv-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.bv-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.bv-mod-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.bv-mod-pct    { font-size: 13px; font-weight: 700; font-family: monospace; }
.bv-mod-estado { font-size: 10px; color: #64748b; }

/* Filas de fechas */
.bv-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bv-date-icon  { font-size: 15px; font-weight: 700; width: 18px; text-align: center; flex-shrink: 0; }
.bv-date-name  { color: #cbd5e1; font-size: 13px; font-weight: 600; flex: 1; }
.bv-date-val   { color: #475569; font-size: 12px; font-family: monospace; flex-shrink: 0; }
.bv-date-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  flex-shrink: 0;
}
.bv-hito {
  color: #475569;
  font-size: 12px;
  font-family: monospace;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Filas de quiz */
.bv-quiz-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bv-quiz-medal { font-size: 20px; flex-shrink: 0; }
.bv-quiz-name  { font-size: 14px; font-weight: 600; flex: 1; }
.bv-quiz-pts   { color: #94a3b8; font-size: 13px; font-family: monospace; }

/* Filas de avisos */
.bv-aviso-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  color: #94a3b8;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bv-aviso-dot { color: #10b981; font-size: 16px; flex-shrink: 0; line-height: 1; }

/* Estado vacío */
.bv-empty {
  color: #334155;
  font-size: 13px;
  font-style: italic;
  padding: 10px 0;
}


/* ═══════════════════════════════════════════════════════════════════
   ESTACIÓN DE ESTUDIO — Viewer Modal (NotebookLM sim)
   ═══════════════════════════════════════════════════════════════════ */

#study-viewer-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
#study-viewer-popup.active { display: flex; }

.sv-modal {
  background: #080f1c;
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 18px;
  width: 96%;
  max-width: 1000px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: svSlideIn 0.25s ease;
}
@keyframes svSlideIn {
  from { opacity: 0; transform: scale(0.97) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Barra de color del módulo (top border dinámico) */
.sv-color-bar {
  height: 3px;
  width: 100%;
  flex-shrink: 0;
  transition: background 0.3s;
}

.sv-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sv-title-text {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}

.sv-close-btn {
  background: transparent;
  border: 1px solid #374151;
  color: #64748b;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.sv-close-btn:hover { border-color: #6b7280; color: #94a3b8; }

/* Layout dos columnas */
.sv-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar izquierdo — lista de fuentes */
.sv-sidebar {
  width: 230px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sv-sidebar-label {
  padding: 12px 14px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  flex-shrink: 0;
}

#sv-source-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
#sv-source-list::-webkit-scrollbar { width: 4px; }
#sv-source-list::-webkit-scrollbar-track { background: transparent; }
#sv-source-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Tarjeta de fuente en el sidebar */
.sv-source-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  margin-bottom: 3px;
}
.sv-source-card:hover { background: rgba(255,255,255,0.04); color: #94a3b8; }
.sv-source-card.active { color: #e2e8f0; }

.sv-card-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.sv-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sv-tipo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
}
.sv-tipo-badge--lg {
  font-size: 11px;
  padding: 3px 10px;
  margin-bottom: 4px;
}

.sv-card-title {
  font-size: 12px;
  color: inherit;
  line-height: 1.35;
  word-break: break-word;
}

.sv-card-duration {
  font-size: 10px;
  color: #475569;
}

/* Panel derecho — contenido de la fuente */
.sv-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sv-content::-webkit-scrollbar { width: 5px; }
.sv-content::-webkit-scrollbar-track { background: transparent; }
.sv-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Header del contenido (título + badge) */
.sv-content-header {
  padding-left: 14px;
  margin-bottom: 4px;
}

.sv-content-title {
  font-size: 20px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 6px 0 4px;
  line-height: 1.3;
}

.sv-content-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

/* Iframe wrapper — aspect ratio 16:9 */
.sv-iframe-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;   /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.sv-iframe-wrap--pdf {
  padding-bottom: 70%;       /* PDF más alto */
}

.sv-source-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* Metadatos de la fuente */
.sv-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

/* Botón abrir enlace externo */
.sv-open-btn {
  display: inline-block;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.4);
  color: #a5b4fc;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.sv-open-btn:hover { background: rgba(99,102,241,0.3); color: #c7d2fe; }
.sv-open-btn--lg { padding: 10px 24px; font-size: 14px; }

/* Tarjeta para tipo enlace */
.sv-link-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px;
}

.sv-link-icon { font-size: 48px; flex-shrink: 0; }

.sv-link-body { display: flex; flex-direction: column; gap: 12px; }

.sv-link-url {
  font-size: 12px;
  color: #475569;
  font-family: monospace;
  word-break: break-all;
}

/* Texto de nota */
.sv-nota-body {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 20px 22px;
  flex: 1;
}

.sv-nota-text {
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* Sin embed disponible */
.sv-no-embed {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #64748b;
  font-size: 14px;
  text-align: center;
  padding: 40px;
}


/* ═══════════════════════════════════════════════════════════════════
   ESTACIÓN DE ESTUDIO — Admin Modal
   ═══════════════════════════════════════════════════════════════════ */

#study-admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
#study-admin-modal.active { display: flex; }

/* Reutiliza admin-modal-content de módulos — solo tabs y body difieren */
.admin-modal-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(99,102,241,0.15);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Cuerpo dos columnas del admin de fuentes */
.sa-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sa-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid rgba(16,185,129,0.14);
  overflow-y: auto;
  padding: 8px;
}
.sa-sidebar::-webkit-scrollbar { width: 4px; }
.sa-sidebar::-webkit-scrollbar-track { background: transparent; }
.sa-sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 2px; }

.sa-list-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.18s;
  margin-bottom: 2px;
}
.sa-list-item:hover { background: rgba(255,255,255,0.04); color: #94a3b8; }
.sa-list-item.active { color: #e2e8f0; background: rgba(16,185,129,0.06); }

.sa-list-icon { font-size: 16px; flex-shrink: 0; }
.sa-list-title { flex: 1; font-size: 11px; line-height: 1.3; word-break: break-word; }

.sa-del-btn {
  background: transparent;
  border: none;
  color: #374151;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.sa-del-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

.sa-add-btn {
  width: 100%;
  background: rgba(16,185,129,0.08);
  border: 1px dashed rgba(16,185,129,0.35);
  color: #6ee7b7;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
}
.sa-add-btn:hover { background: rgba(16,185,129,0.16); }

.sa-form-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.sa-form-area::-webkit-scrollbar { width: 5px; }
.sa-form-area::-webkit-scrollbar-track { background: transparent; }
.sa-form-area::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 3px; }

.sa-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.sa-form-group label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Estado vacío del formulario */
.sa-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #475569;
  font-size: 14px;
  text-align: center;
  padding: 40px;
  height: 100%;
}
.sa-empty-state p { line-height: 1.6; }
