/* ==========================================================================
   ESTILOS DE LA TORRE DE RECURSIA - EPCR-10
   Diseño responsivo, oscuro elegante con efectos glassmorphic y acentos neón
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Paleta de colores principales */
  --bg-primary: #090d16;
  --bg-surface: #131b2e;
  --bg-card: rgba(23, 32, 54, 0.75);
  --bg-card-hover: rgba(30, 41, 69, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(56, 189, 248, 0.3);
  
  /* Color de Acento y Neón */
  --primary-cyan: #38bdf8;
  --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --accent-purple: #818cf8;
  --accent-amber: #fbbf24;
  --accent-emerald: #34d399;
  --accent-rose: #f87171;

  /* Texto */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Código */
  --bg-code: #0b1120;
  --text-code: #e2e8f0;
  
  /* Fuentes */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Sombras y Bordes */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Reset básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: #0b1120;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    url('../img/imagen 1.jpg');
  background-size: 650px auto;
  background-position: center 90px;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Remover filtros oscuros para imagen 1.jpg 100% nítida y completa */
body::before, body::after {
  display: none !important;
}

/* Encabezado global y Navegación */
.app-header {
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--border-glow);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.app-header__container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-main);
}

/* Insignia Dividida 50/50 Unimayor / Torre */
.split-logo-badge {
  position: relative;
  width: 100px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  display: flex;
  background: #0f172a;
}

.split-logo-badge__half {
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
}

.split-logo-badge__half--left {
  left: 0;
  width: 55%;
  background: url('../img/imagen 2.png') no-repeat center center / contain, linear-gradient(135deg, #0284c7 0%, #0f172a 100%);
  clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
  z-index: 2;
  border-right: 2px solid var(--primary-cyan);
}

.split-logo-badge__half--right {
  right: 0;
  width: 55%;
  background: url('../img/imagen 1.jpg') no-repeat center center / cover, linear-gradient(135deg, #4f46e5 0%, #090d16 100%);
  z-index: 1;
}

.split-logo-badge__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 45%;
  width: 3px;
  background: var(--primary-cyan);
  box-shadow: 0 0 12px var(--primary-cyan);
  z-index: 3;
  transform: skewX(-15deg);
}

.brand__title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand__subtitle {
  font-size: 0.75rem;
  color: var(--primary-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

/* Contenedor Principal Alineado al Lado del Logo */
.main-container {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 2rem 2rem 2rem 4rem;
  padding: 0 1rem;
}

@media (max-width: 900px) {
  .main-container {
    margin: 2rem auto;
    max-width: 100%;
  }
}

/* Tarjetas de Ventanas con Excelente Lectura */
.glass-card {
  position: relative;
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  z-index: 10;
}

.glass-card:hover {
  border-color: var(--primary-cyan);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.3);
}

/* Barra de Arrastre de Ventanas con Logo de UNIMAYOR */
.drag-handle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(19, 27, 46, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  margin-bottom: 1.5rem;
  cursor: grab;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.drag-handle-bar:hover {
  background: rgba(30, 41, 69, 0.95);
  border-color: var(--primary-cyan);
}

.drag-handle-bar:active {
  cursor: grabbing;
}

.unimayor-header-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.unimayor-card-logo-img {
  height: 28px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.unimayor-card-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-cyan);
  letter-spacing: 1px;
}

.drag-dots-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.drag-dots {
  display: flex;
  gap: 4px;
}

.drag-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.drag-handle-bar:hover .drag-dots span {
  background: var(--primary-cyan);
}

.drag-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.drag-handle-bar:hover .drag-text {
  color: var(--primary-cyan);
}

/* Títulos y Encabezados */
.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
  line-height: 1.2;
}

.page-subtitle {
  color: #cbd5e1;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 2rem;
}

/* Botones con estilo Neón */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(56, 189, 248, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary-cyan);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Formularios y Inputs */
.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(11, 17, 32, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Escala Likert */
.likert-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.likert-option {
  position: relative;
}

.likert-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.likert-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.25rem;
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s ease;
}

.likert-option input[type="radio"]:checked + .likert-label {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Checkbox personalizado */
.checkbox-custom {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-custom input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--primary-cyan);
  cursor: pointer;
}

/* Selector de Modo Pretest / Postest */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.mode-card {
  background: rgba(11, 17, 32, 0.7);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.mode-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-3px);
}

.mode-card.selected {
  border-color: var(--primary-cyan);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: var(--shadow-glow);
}

.mode-card__badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(56, 189, 248, 0.2);
  color: var(--primary-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.mode-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Bloque de Código en las preguntas */
.code-block-container {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-cyan);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-code);
  white-space: pre;
  line-height: 1.5;
}

/* Indicador de Salas / Mapa de Preguntas */
.tower-navigator {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tower-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(11, 17, 32, 0.8);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.tower-step.current {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.15);
  font-weight: 800;
}

.tower-step.answered {
  background: rgba(52, 211, 153, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

/* Opciones de respuesta */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.option-item {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 69, 0.5);
}

.option-item.selected {
  border-color: var(--primary-cyan);
  background: rgba(56, 189, 248, 0.12);
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.option-item.selected .option-key {
  background: var(--primary-cyan);
  color: #0f172a;
  border-color: var(--primary-cyan);
}

.option-text {
  flex: 1;
  font-size: 1rem;
}

/* Cronómetro bar */
.timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 17, 32, 0.9);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.timer-clock {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timer-clock.warning {
  color: var(--accent-rose);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Tabla de Resultados */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.results-table th, .results-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.results-table th {
  background: rgba(11, 17, 32, 0.8);
  color: var(--primary-cyan);
  font-weight: 700;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge.correct {
  background: rgba(52, 211, 153, 0.2);
  color: var(--accent-emerald);
}

.status-badge.incorrect {
  background: rgba(248, 113, 113, 0.2);
  color: var(--accent-rose);
}

/* Tarjetas de Nivel */
.level-badge-card {
  text-align: center;
  padding: 2rem;
  background: rgba(11, 17, 32, 0.7);
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary-cyan);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-glow);
}

.level-badge-card__title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-cyan);
}

.score-display {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.5rem 0;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Alertas de Notificación */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.alert-warning {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.alert-info {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

/* Animaciones suaves */
.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsivo */
@media (max-width: 768px) {
  .glass-card {
    padding: 1.5rem;
  }
  
  .mode-grid {
    grid-template-columns: 1fr;
  }
  
  .page-title {
    font-size: 1.75rem;
  }
  
  .likert-group {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .likert-label {
    font-size: 0.75rem;
    padding: 0.5rem 0.1rem;
  }

  .results-table th, .results-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
}
