/**
 * style.css
 * Estilos globales, variables de color, layout de la aplicación y componentes de control
 * ACTIVÁ IA - UPATECO
 */

:root {
  --bg-dark: #070c18;
  --bg-surface: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #27354a;
  --bg-card-active: #334155;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;

  --color-cyan: #38bdf8;
  --color-indigo: #818cf8;
  --color-purple: #a855f7;
  --color-green: #34d399;
  --color-amber: #fbbf24;
  --color-red: #f87171;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Modo puntero láser activo */
body.laser-mode {
  cursor: none !important;
}

.laser-dot {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow: 0 0 12px 4px rgba(255, 42, 42, 0.9), 0 0 24px 8px rgba(255, 0, 0, 0.5);
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  display: none;
  transition: transform 0.04s ease-out;
}

/* APP SHELL CONTAINER */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* TOP NAVBAR */
.top-navbar {
  height: 56px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-brand-logo {
  height: 32px;
  max-width: 110px;
  object-fit: contain;
  transition: opacity 0.2s;
}

.nav-brand-logo.activa-logo {
  height: 30px;
  border-radius: 5px;
}


.docente-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 1.5px solid var(--color-cyan);
}

.brand-badge {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-indigo));
  color: #070c18;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 6px;
}


.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.clase-select {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.clase-select:hover, .clase-select:focus {
  border-color: var(--color-cyan);
}

/* CRONÓMETRO DE CLASE EN NAVBAR */
.nav-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.timer-clock {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-cyan);
}

.timer-bar-wrap {
  width: 50px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.timer-bar-inner {
  height: 100%;
  width: 0%;
  background: var(--color-cyan);
  transition: width 0.3s;
}

.btn-timer-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-timer-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* BOTONES GLOBALES */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--color-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-export {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
}

.btn-export:hover {
  background: linear-gradient(135deg, #6d28d9, #4338ca);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

/* ÁREA PRINCIPAL DE PRESENTACIÓN */
.main-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #0f172a 0%, #070c18 100%);
}

.presentation-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}

/* BARRA DE PROGRESO INFERIOR */
.slide-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  z-index: 50;
}

.slide-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-indigo));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* BARRA DE HERRAMIENTAS FLOTANTE */
.floating-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 40px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-toolbar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.toolbar-counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-right: 1px solid var(--border-subtle);
}

.tb-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.tb-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.tb-btn.active {
  color: var(--color-cyan);
  background: rgba(56, 189, 248, 0.15);
}

.tb-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-subtle);
  margin: 0 4px;
}

/* PANEL LATERAL DE NOTAS DOCENTE */
.notes-sidebar {
  position: fixed;
  top: 56px;
  right: -420px;
  width: 400px;
  height: calc(100vh - 56px);
  background-color: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-subtle);
  z-index: 300;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notes-sidebar.active {
  right: 0;
}

.notes-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notes-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-title-wrap h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.notes-slide-title {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-bottom: 1px solid var(--border-subtle);
}

.notes-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.notes-block-tag {
  background: var(--bg-card);
  border-left: 3px solid var(--color-cyan);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}

.notes-speech-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 14px;
  color: var(--text-main);
}

.notes-speech-box h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-amber);
  margin-bottom: 10px;
}

.notes-checklist {
  background: var(--bg-card);
  padding: 14px;
  border-radius: 8px;
  font-size: 13px;
}

.notes-checklist h5 {
  color: var(--color-green);
  margin-bottom: 8px;
}

.notes-checklist ul {
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* MODAL DE VISTA EN CUADRÍCULA (GRID OVERVIEW) */
.grid-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7, 12, 24, 0.94);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: none;
  flex-direction: column;
  padding: 30px 40px;
}

.grid-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.grid-modal-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.grid-slides-wrapper {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  overflow-y: auto;
  padding-right: 10px;
}

.grid-slide-thumb {
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.grid-slide-thumb:hover {
  transform: translateY(-3px);
  border-color: var(--color-cyan);
  box-shadow: var(--shadow-glow);
}

.grid-slide-thumb.active {
  border-color: var(--color-cyan);
  outline: 2px solid var(--color-cyan);
  background-color: var(--bg-card-hover);
}

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

.thumb-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-cyan);
}

.thumb-type {
  font-size: 9px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.thumb-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.thumb-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* OVERLAYS DE BLACKOUT / WHITEOUT */
.blackout-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: none;
}

/* ANIMACIONES */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
