/**
 * Maestría RD — Sistema de Estilos Móvil v1.7.0-beta
 * Directiva: docs/reglas_ux_ui_marca.md (Colores #113B6D / #09254A / #BD2426, cero emojis)
 */

:root {
  --primary: #113B6D;
  --primary-dark: #09254A;
  --primary-light: #1E5BA3;
  --danger: #BD2426;
  --danger-light: #FEE2E2;
  --success: #10B981;
  --success-light: #D1FAE5;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --bg-mobile: #F4F6FA;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --shadow-sm: 0 2px 8px rgba(17, 59, 109, 0.06);
  --shadow-md: 0 8px 24px rgba(17, 59, 109, 0.10);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-mobile);
  font-family: var(--font-family);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: calc(75px + env(safe-area-inset-bottom));
}

/* Cabecera Móvil Inmersiva */
.mobile-header {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  padding: calc(14px + env(safe-area-inset-top)) 18px 28px 18px;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  position: relative;
  box-shadow: 0 4px 20px rgba(9, 37, 74, 0.25);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.user-meta h2 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.user-meta p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #A7F3D0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.sync-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* Contenedor Principal */
.mobile-main {
  padding: 0 16px;
  margin-top: -16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}

/* Tarjeta 1: Notificación Contextual de Horario */
.schedule-hero-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}
.schedule-hero-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--primary);
}

.card-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.class-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  background: #EFF6FF;
  padding: 4px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-box {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #0F172A;
  background: #F1F5F9;
  padding: 4px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.class-title {
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
}

.class-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-primary-action {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(17, 59, 109, 0.25);
}
.btn-primary-action:active { transform: scale(0.97); }

.btn-outline-action {
  background: #F8FAFC;
  color: var(--primary);
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}
.btn-outline-action:active { transform: scale(0.97); }

.schedule-full-link {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  text-align: center;
}
.schedule-full-link a {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tarjeta 2: TizaBot Oficial */
.tizabot-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 16px;
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tizabot-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tizabot-img-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #FFFFFF;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.tizabot-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tizabot-texts h4 {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
}
.tizabot-texts p {
  font-size: 12px;
  color: #BFDBFE;
}

.tizabot-input-bubble {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Tarjeta 3: Diario Reflexivo Texto / Audio */
.reflection-section {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.section-head h4 {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dual-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.record-btn-tile {
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: 16px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.record-btn-tile:active { transform: scale(0.96); }

.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.tile-icon.voice {
  background: var(--danger-light);
  color: var(--danger);
}
.tile-icon.text {
  background: #E0E7FF;
  color: var(--primary);
}

/* Barra Inferior Fija (Bottom Navigation) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(65px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  flex: 1;
  padding: 8px 0;
  cursor: pointer;
}
.nav-tab i { font-size: 20px; }
.nav-tab.active { color: var(--primary); }
.nav-tab.active i { transform: translateY(-2px); }

/* Modales Deslizables (Bottom Sheets) */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.bottom-sheet-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet-content {
  background: #FFFFFF;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom)) 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  overflow-y: auto;
}
.bottom-sheet-overlay.active .bottom-sheet-content {
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 44px;
  height: 5px;
  background: #CBD5E1;
  border-radius: 3px;
  align-self: center;
  margin-bottom: 16px;
}

/* Grabación de Audio Visual */
.audio-pulse-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger) 0%, #991B1B 100%);
  color: #FFFFFF;
  border: none;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(189, 36, 38, 0.2);
  animation: pulse-ring 1.8s infinite;
  margin: 18px 0;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(189, 36, 38, 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(189, 36, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(189, 36, 38, 0); }
}

.timer-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 800;
  color: var(--danger);
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes biometric-glow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

