/* ==========================================================================
   ENCARDOMY — MINWEB 415 (Mobile-First / Christmas Edition)
   Diseño Estilo Apple + Temática Navideña Sutil + Encardomy Agency
   ========================================================================== */

:root {
  /* Paleta Base Apple iOS */
  --bg-main: #06140e;
  --bg-gradient: radial-gradient(circle at 50% -10%, #163824 0%, #081a11 50%, #030a06 100%);
  --surface-glass: rgba(255, 255, 255, 0.08);
  --surface-glass-card: rgba(255, 255, 255, 0.07);
  --surface-glass-elevated: rgba(255, 255, 255, 0.12);
  --surface-glass-active: rgba(255, 255, 255, 0.18);
  --surface-glass-border: rgba(255, 255, 255, 0.14);
  --surface-glass-border-subtle: rgba(255, 255, 255, 0.08);

  /* Texto */
  --text-primary: #F5F5F7;
  --text-secondary: rgba(235, 235, 245, 0.75);
  --text-tertiary: rgba(235, 235, 245, 0.45);
  --text-muted: rgba(235, 235, 245, 0.3);

  /* Acentos Navideños Elegantes Apple */
  --accent-gold: #E5C07B;
  --accent-gold-glow: rgba(229, 192, 123, 0.35);
  --accent-gold-soft: rgba(229, 192, 123, 0.12);
  --accent-red: #FF453A;
  --accent-red-glow: rgba(255, 69, 58, 0.35);
  --accent-green: #30D158;
  --accent-green-pennant: #15803d;
  --accent-blue: #2997FF;

  /* Dimensiones y Bordes */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Menú Inferior */
  --nav-height: 70px;
  --nav-bg: rgba(7, 21, 14, 0.92);
  --nav-border: rgba(255, 255, 255, 0.12);

  /* Sombras */
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(229, 192, 123, 0.2);

  /* Tipografía del Sistema */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset y Reglas de Scroll Estrictas */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Scroll EXCLUSIVAMENTE VERTICAL para la página completa */
  overflow-x: hidden !important;
  overflow-y: auto;
  position: relative;
}

/* VIDEO DE FONDO EN BUCLE (Solicitado por el usuario) */
.bg-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
  filter: brightness(0.68) saturate(1.2);
}

.bg-video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(6, 20, 14, 0.45) 0%, rgba(3, 10, 6, 0.88) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Decoraciones Navideñas Geométricas Sutiles */
.christmas-star-accent {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 20px 4px rgba(229, 192, 123, 0.8), 0 0 40px 12px rgba(229, 192, 123, 0.4);
  pointer-events: none;
  z-index: 1;
  opacity: 0.8;
}

/* Copos de nieve sutiles en CSS puro */
.snowfall-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: fall linear infinite;
  filter: blur(0.5px);
}

@keyframes fall {
  0% { transform: translateY(-10px) translateX(0); opacity: 0; }
  15% { opacity: 0.75; }
  85% { opacity: 0.75; }
  100% { transform: translateY(105vh) translateX(25px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .snowflake {
    animation: none;
    display: none;
  }
}

/* Contenedor Principal (Mobile-First) */
.mobile-app-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px calc(var(--nav-height) + 32px) 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  overflow-x: hidden;
}

/* Encabezado Principal */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 6px 0;
}

.brand-badge {
  display: flex;
  flex-direction: column;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-subtitle::before {
  content: "✦";
  font-size: 10px;
  color: var(--accent-gold);
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botón de Sonido Navideño (Campanitas) */
.sound-toggle-btn {
  border: 1px solid var(--surface-glass-border);
  background: rgba(229, 192, 123, 0.12);
  color: var(--accent-gold);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.sound-toggle-btn:active {
  transform: scale(0.92);
  background: var(--accent-gold);
  color: #04140b;
}

/* Selector de Sección (Estilo Segmented Control iOS) */
.section-selector-pill {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(12px);
}

.section-btn {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 42px;
  text-align: center;
}

.section-btn.active {
  background: var(--text-primary);
  color: #05140b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-weight: 700;
}

/* ==========================================================================
   LUCES NAVIDEÑAS ANIMADAS (Materia Actual en Curso)
   ========================================================================== */
.christmas-lights-garland {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 12px 10px 12px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.christmas-bulb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: relative;
  animation: bulb-twinkle 1.6s infinite alternate ease-in-out;
}

.christmas-bulb::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 2.5px;
  width: 4px;
  height: 3px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px 2px 0 0;
}

.christmas-bulb.red {
  background: #ff453a;
  box-shadow: 0 0 10px 3px rgba(255, 69, 58, 0.85);
  animation-delay: 0s;
}

.christmas-bulb.green {
  background: #30d158;
  box-shadow: 0 0 10px 3px rgba(48, 209, 88, 0.85);
  animation-delay: 0.35s;
}

.christmas-bulb.gold {
  background: #ffd60a;
  box-shadow: 0 0 10px 3px rgba(255, 214, 10, 0.85);
  animation-delay: 0.7s;
}

.christmas-bulb.blue {
  background: #0a84ff;
  box-shadow: 0 0 10px 3px rgba(10, 132, 255, 0.85);
  animation-delay: 1.05s;
}

.christmas-bulb.purple {
  background: #bf5af2;
  box-shadow: 0 0 10px 3px rgba(191, 90, 242, 0.85);
  animation-delay: 1.4s;
}

@keyframes bulb-twinkle {
  0% {
    opacity: 0.3;
    transform: scale(0.85);
    filter: brightness(0.65);
  }
  100% {
    opacity: 1;
    transform: scale(1.25);
    filter: brightness(1.5);
  }
}

/* Tarjetas Vidrio Estilo Apple (Glassmorphism) */
.glass-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.glass-card-elevated {
  background: var(--surface-glass-elevated);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Bloque Superior: Materia Actual */
.current-class-card {
  border-left: 5px solid var(--accent-gold);
  background: linear-gradient(135deg, rgba(229, 192, 123, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.card-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-gold);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-gold);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--accent-gold); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.current-time-badge {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-glass-border-subtle);
}

.current-subject-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.class-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--surface-glass-border-subtle);
}

.meta-pill-salon {
  background: rgba(41, 151, 255, 0.18);
  border-color: rgba(41, 151, 255, 0.35);
  color: #70baff;
}

.meta-pill-prof {
  background: rgba(229, 192, 123, 0.16);
  border-color: rgba(229, 192, 123, 0.35);
  color: var(--accent-gold);
}

.meta-pill-free {
  background: rgba(142, 142, 147, 0.2);
  border-color: rgba(142, 142, 147, 0.4);
  color: #aeaeb2;
}

/* Alerta de Cambio de Salón (Física III) */
.room-change-alert {
  background: linear-gradient(90deg, rgba(255, 149, 0, 0.18), rgba(255, 69, 58, 0.15));
  border: 1px solid rgba(255, 149, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.room-change-icon {
  font-size: 18px;
  line-height: 1;
}

.room-change-content {
  font-size: 13px;
  line-height: 1.35;
  color: #ffd8a8;
}

.room-change-title {
  font-weight: 700;
  color: #ffa94d;
  margin-bottom: 2px;
}

/* Contador Regresivo Principal (Tiempo Restante) */
.countdown-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid var(--surface-glass-border-subtle);
}

.countdown-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.countdown-digits {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

/* Bloque Condicional: Siguiente Clase (≥ 10 minutos) */
.next-class-card {
  border-left: 5px solid var(--accent-blue);
  background: linear-gradient(135deg, rgba(41, 151, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.next-class-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.next-subject-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.next-subject-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Bloque Condicional: Tolerancias (< 10 minutos o sin clase inmediata) */
.tolerances-wrapper {
  margin-bottom: 16px;
}

.tolerances-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tolerance-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tolerance-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.tolerance-card.teacher::before {
  background: var(--accent-gold);
}

.tolerance-card.student::before {
  background: var(--accent-green);
}

.tolerance-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.tolerance-digits {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.tolerance-card.teacher .tolerance-digits {
  color: var(--accent-gold);
}

.tolerance-card.student .tolerance-digits {
  color: var(--accent-green);
}

.tolerance-note {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Sección Exclusiva: 3 Materias con Página Propia */
.special-subjects-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.special-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.special-subject-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-glass-card);
  border: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(20px);
  color: var(--text-primary);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  min-height: 84px;
  justify-content: center;
}

.special-subject-link:active {
  transform: scale(0.96);
  background: var(--surface-glass-active);
}

.special-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.special-subject-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.special-subject-link.historia {
  border-bottom: 3px solid #AF52DE;
}

.special-subject-link.espanol {
  border-bottom: 3px solid #FF9500;
}

.special-subject-link.fisica {
  border-bottom: 3px solid #00C7BE;
}

/* ==========================================================================
   SECCIÓN DE TRABAJOS NECESARIOS / ENTREGAS CLAVE (Para las 3 materias)
   ========================================================================== */
.required-works-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}

.required-works-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.required-works-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-work-btn {
  background: var(--accent-gold);
  color: #04140b;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}

.add-work-btn:active {
  transform: scale(0.94);
}

.add-work-form {
  display: none;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  gap: 10px;
  flex-direction: column;
}

.add-work-form.show {
  display: flex;
}

.work-item-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--surface-glass-border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.work-item-card.completed {
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.2);
}

.work-item-card.completed .work-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.work-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-green);
  cursor: pointer;
  margin-top: 2px;
}

.work-details {
  flex: 1;
}

.work-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.work-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-meta-badge {
  background: rgba(229, 192, 123, 0.15);
  color: var(--accent-gold);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}

.delete-work-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.delete-work-btn:hover {
  color: var(--accent-red);
}

/* Sección: Horario Semanal Completo */
.schedule-section {
  margin-bottom: 28px;
}

.days-tab-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
  padding-bottom: 4px;
}

.days-tab-nav::-webkit-scrollbar {
  display: none;
}

.day-tab-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--surface-glass-border-subtle);
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.day-tab-btn.active {
  background: var(--accent-gold);
  color: #04140b;
  font-weight: 700;
  border-color: var(--accent-gold);
  box-shadow: 0 4px 14px var(--accent-gold-glow);
}

/* Lista de Bloques del Horario */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-block-card {
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-block-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background-color: var(--block-color, var(--accent-blue));
}

/* EFECTO DE LUCES NAVIDEÑAS EN EL BLOQUE ACTUAL DEL HORARIO */
.schedule-block-card.is-active-subject {
  border: 2px solid var(--accent-gold) !important;
  background: linear-gradient(135deg, rgba(229, 192, 123, 0.16) 0%, rgba(48, 209, 88, 0.12) 100%) !important;
  box-shadow: 0 0 24px rgba(229, 192, 123, 0.4), inset 0 0 16px rgba(48, 209, 88, 0.15) !important;
  transform: scale(1.02);
}

.schedule-block-card.is-active-subject::after {
  content: "✨ CLASE ACTUAL EN VIVO";
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.6px;
}

.schedule-block-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 72px;
}

.time-start {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.time-end {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.time-duration {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-top: 3px;
}

.schedule-block-info {
  flex: 1;
}

.schedule-block-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 4px;
}

.schedule-block-prof {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 500;
}

.schedule-block-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.tag-badge.two-hours {
  background: rgba(229, 192, 123, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 192, 123, 0.3);
}

.tag-badge.room-change {
  background: rgba(255, 149, 0, 0.18);
  color: #ff9f1a;
  border: 1px solid rgba(255, 149, 0, 0.35);
}

.tag-badge.free-class {
  background: rgba(142, 142, 147, 0.2);
  color: #c7c7cc;
  border: 1px solid rgba(142, 142, 147, 0.35);
}

/* Simulador Escolar para pruebas / revisión de horarios */
.schedule-simulator-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--surface-glass-border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.simulator-controls {
  display: none;
  background: var(--surface-glass-card);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--surface-glass-border);
  gap: 8px;
  flex-direction: column;
}

.simulator-controls.show {
  display: flex;
}

.sim-input-row {
  display: flex;
  gap: 8px;
}

.sim-select, .sim-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--surface-glass-border);
  color: var(--text-primary);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

/* ==========================================================================
   MENÚ DE NAVEGACIÓN INFERIOR (ÚNICA EXCEPCIÓN CON DESPLAZAMIENTO HORIZONTAL)
   ========================================================================== */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-top: 1px solid var(--nav-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  /* Scroll horizontal suave, sin scrollbar visible */
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  padding: 0 10px;
}

.bottom-nav-bar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.nav-track {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: max-content;
  padding: 4px 6px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 68px;
  gap: 3px;
}

.nav-item .nav-icon {
  font-size: 19px;
  line-height: 1;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
}

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

/* ==========================================================================
   ESTADOS VACÍOS OFICIALES Y TARJETAS DE CONTENIDO
   ========================================================================== */
.empty-state-card {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface-glass-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.empty-state-icon {
  font-size: 38px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}

.empty-state-subtext {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* Filtros Estilo Apple */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 14px 0;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--surface-glass-border-subtle);
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: var(--text-primary);
  color: #04140b;
  font-weight: 700;
}

/* Buscador de Profesores / Materias */
.search-box-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px 14px 42px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-gold);
}

.search-icon-btn {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 16px;
  pointer-events: none;
}

/* Modales y Hojas Inferiores (Action Sheets Estilo iOS) */
.ios-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ios-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.ios-modal-card {
  background: #0e271a;
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-modal-backdrop.show .ios-modal-card {
  transform: scale(1);
}

.ios-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.ios-modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 20px;
}

.ios-modal-buttons {
  display: flex;
  gap: 12px;
}

.btn-primary-ios {
  flex: 1;
  border: none;
  background: var(--accent-gold);
  color: #04140b;
  font-size: 16px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  min-height: 48px;
}

.btn-primary-ios:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-secondary-ios {
  flex: 1;
  border: 1px solid var(--surface-glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 48px;
}

/* Botón de Regreso Estilo iOS */
.back-btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-glass-border-subtle);
  width: fit-content;
}

.back-btn-header:active {
  background: var(--surface-glass-active);
}

/* Formularios Sencillos */
.ios-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.ios-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.ios-form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}

.ios-form-control:focus {
  border-color: var(--accent-gold);
}

textarea.ios-form-control {
  resize: vertical;
  min-height: 100px;
}

/* Espacio Reservado para Publicidad de Encardomy (Oculto temporalmente según Regla 29) */
.encardomy-ad-slot {
  display: none;
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(229, 192, 123, 0.08);
  border: 1px dashed var(--accent-gold);
  text-align: center;
  font-size: 12px;
  color: var(--accent-gold);
}

/* Pie de Página Institucional Encardomy */
.app-footer {
  text-align: center;
  padding: 24px 0 12px 0;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.app-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.app-footer a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   SISTEMA DE INTERFACES INDEPENDIENTES (CELULAR / TABLETA / COMPUTADORA)
   Controlado en tiempo real sin recargar por js/layout-engine.js
   ========================================================================== */
.encardomy-interface-mobile,
.encardomy-interface-tablet,
.encardomy-interface-desktop {
  width: 100%;
  box-sizing: border-box;
}

/* 1. MODO CELULAR */
html[data-current-interface="mobile"] .encardomy-interface-mobile,
body[data-current-interface="mobile"] .encardomy-interface-mobile {
  display: block !important;
}
html[data-current-interface="mobile"] .encardomy-interface-tablet,
body[data-current-interface="mobile"] .encardomy-interface-tablet,
html[data-current-interface="mobile"] .encardomy-interface-desktop,
body[data-current-interface="mobile"] .encardomy-interface-desktop {
  display: none !important;
}

/* 2. MODO TABLETA (iPad) */
html[data-current-interface="tablet"] .encardomy-interface-tablet,
body[data-current-interface="tablet"] .encardomy-interface-tablet {
  display: block !important;
}
html[data-current-interface="tablet"] .encardomy-interface-mobile,
body[data-current-interface="tablet"] .encardomy-interface-mobile,
html[data-current-interface="tablet"] .encardomy-interface-desktop,
body[data-current-interface="tablet"] .encardomy-interface-desktop {
  display: none !important;
}

/* 3. MODO COMPUTADORA (Mac) */
html[data-current-interface="desktop"] .encardomy-interface-desktop,
body[data-current-interface="desktop"] .encardomy-interface-desktop {
  display: block !important;
}
html[data-current-interface="desktop"] .encardomy-interface-mobile,
body[data-current-interface="desktop"] .encardomy-interface-mobile,
html[data-current-interface="desktop"] .encardomy-interface-tablet,
body[data-current-interface="desktop"] .encardomy-interface-tablet {
  display: none !important;
}

/* Fallbacks nativos cuando aún no se ha evaluado data-current-interface */
@media (max-width: 767.98px) {
  html:not([data-current-interface]) .encardomy-interface-mobile { display: block !important; }
  html:not([data-current-interface]) .encardomy-interface-tablet { display: none !important; }
  html:not([data-current-interface]) .encardomy-interface-desktop { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  html:not([data-current-interface]) .encardomy-interface-mobile { display: none !important; }
  html:not([data-current-interface]) .encardomy-interface-tablet { display: block !important; }
  html:not([data-current-interface]) .encardomy-interface-desktop { display: none !important; }
}
@media (min-width: 1200px) {
  html:not([data-current-interface]) .encardomy-interface-mobile { display: none !important; }
  html:not([data-current-interface]) .encardomy-interface-tablet { display: none !important; }
  html:not([data-current-interface]) .encardomy-interface-desktop { display: block !important; }
}

/* ==========================================================================
   DOCUMENTOS LEGALES MÓVIL (ALTA LEGIBILIDAD)
   ========================================================================== */
.legal-document-card {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 20px 18px;
}

.legal-document-card h3 {
  color: var(--accent-gold);
  font-size: 15.5px;
  font-weight: 700;
  margin: 18px 0 8px 0;
}

.legal-document-card p {
  margin-bottom: 12px;
  line-height: 1.65;
}

.legal-document-card ul {
  margin-bottom: 14px;
  padding-left: 20px;
}

.legal-document-card li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.legal-meta-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--surface-glass-border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
