﻿/* ImportaciÃ³n de tipografÃ­as modernas */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Variables globales del sistema de diseÃ±o */
:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-code: 'Fira Code', monospace;

  /* Paleta de colores - EstÃ©tica GenAI oscura y neÃ³n */
  --bg-app: #070a13;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #070a13 70%);
  --bg-card: rgba(17, 24, 39, 0.6);
  --bg-modal: rgba(11, 15, 26, 0.95);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.5);
  
  --color-primary: #8b5cf6; /* Violeta */
  --color-primary-glow: rgba(139, 92, 246, 0.15);
  --color-secondary: #06b6d4; /* Cian */
  --color-secondary-glow: rgba(6, 182, 212, 0.15);
  --color-accent: #10b981; /* Verde esmeralda */
  --color-warning: #f59e0b; /* Ãmbar */
  --color-danger: #ef4444; /* Rojo */
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.35);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estilos de reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 15, 26, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Contenedor principal de la aplicaciÃ³n */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header de la AplicaciÃ³n */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon-wrapper {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: var(--transition-fast);
}

.brand-icon-wrapper:hover {
  transform: rotate(5deg) scale(1.05);
}

.brand-title h1 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #a78bfa, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Estilos de botones premium */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.btn-accent {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--color-secondary);
}

.btn-accent:hover {
  background: rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}

.btn-danger-outline:hover {
  background: var(--color-danger);
  color: white;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* Tarjetas estadÃ­sticas del Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.stat-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-primary);
}

.stat-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-secondary);
}

.stat-icon.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-accent);
}

.stat-info .stat-value {
  font-size: 1.5rem;
  font-family: var(--font-title);
  font-weight: 700;
}

.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Panel de Filtros y BÃºsqueda */
.search-filter-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--color-primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.filter-select {
  padding: 0.55rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--color-primary);
}

.filter-select option {
  background: #0f172a;
  color: var(--text-main);
}

/* PestaÃ±as de filtros rÃ¡pidos */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.tab-btn.active {
  background: var(--color-primary-glow);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c084fc;
}

/* Grid de Tips */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Tarjeta de Tip Individual */
.tip-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tip-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 15px rgba(139, 92, 246, 0.1);
}

/* Decoraciones de tarjeta */
.tip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.tip-card:hover::before {
  opacity: 1;
}

/* Encabezado tarjeta */
.tip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.subject-badge {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.5px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-fast);
  padding: 2px;
}

.favorite-btn:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

.favorite-btn.active {
  color: #f59e0b;
}

/* Cuerpo tarjeta */
.tip-card-body {
  flex-grow: 1;
  margin-bottom: 1rem;
}

.tip-category {
  font-size: 0.75rem;
  color: var(--color-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tip-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff;
  line-height: 1.3;
}

.tip-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.trigger-badge {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: #c084fc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 12px;
}

/* Pie tarjeta */
.tip-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
  margin-top: auto;
}

.student-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.student-indicator.active {
  color: var(--color-accent);
}

.card-actions {
  display: flex;
  gap: 0.35rem;
}

/* Estado sin resultados */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

/* Modales Base (Glassmorphism overlay) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-modal);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-modal);
  z-index: 10;
}

.modal-header h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: #fff;
  transform: scale(1.1);
}

.modal-body {
  padding: 1.75rem;
  flex-grow: 1;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-modal);
}

/* Formularios en Modales */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-primary);
}

.form-control-code {
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.4);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
}

.checkbox-label input {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
}

/* Editor de tags interactivo */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  min-height: 42px;
  align-items: center;
}

.tags-input-container:focus-within {
  border-color: var(--color-primary);
}

.tag-editor-badge {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-editor-badge-remove {
  cursor: pointer;
  font-weight: bold;
}

.tag-editor-badge-remove:hover {
  color: var(--color-danger);
}

.tags-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  min-width: 100px;
}

/* Modificador de lista de items dinÃ¡micos (Pasos y Enlaces) */
.dynamic-list-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Estilos de Vista Detalle de Tip */
.detail-header {
  margin-bottom: 1.25rem;
}

.detail-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.detail-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.detail-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--color-secondary);
  padding-left: 0.75rem;
}

.detail-section-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prompt-box {
  position: relative;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.prompt-box-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prompt-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  transition: var(--transition-fast);
}

.prompt-copy-btn:hover {
  color: #fff;
}

.prompt-code {
  padding: 1.25rem;
  font-family: var(--font-code);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  max-height: 250px;
  overflow-y: auto;
}

.steps-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.steps-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.steps-list li::before {
  content: counter(step-counter);
  counter-increment: step-counter;
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  background: var(--color-primary-glow);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  color: #c084fc;
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps-list {
  counter-reset: step-counter;
}

.use-cases-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.use-cases-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.use-cases-list li::before {
  content: 'âœ¦';
  position: absolute;
  left: 0;
  color: var(--color-secondary);
}

.links-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.external-link {
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.external-link:hover {
  text-decoration: underline;
  color: #22d3ee;
}

/* Toast de Notificaciones */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 200;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.info {
  border-color: var(--color-primary);
}

.toast.danger {
  border-color: var(--color-danger);
}

/* Modal de AdministraciÃ³n de Materias */
.subject-manager-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 1rem;
}

.subject-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
}

.subject-item:last-child {
  border-bottom: none;
}

.subject-item-actions {
  display: flex;
  gap: 0.35rem;
}

/* responsive queries */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .header-actions .btn {
    flex-grow: 1;
    justify-content: center;
  }
  
  .search-row {
    flex-direction: column;
  }
  
  .search-row .btn {
    width: 100%;
    justify-content: center;
  }
  
  .form-group.row {
    grid-template-columns: 1fr;
  }
}

/* ==================== FOOTER ==================== */

.app-footer {
  margin-top: 4rem;
  position: relative;
}

/* Línea divisora con gradiente */
.app-footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-primary) 30%,
    var(--color-secondary) 70%,
    transparent 100%);
  opacity: 0.35;
  margin-bottom: 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem 2rem 1.5rem;
  background: rgba(7, 10, 19, 0.5);
  backdrop-filter: blur(12px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
}

.footer-logo {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #e2e8f0, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-contact {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-email:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

.footer-bottom {
  padding: 0.9rem 2rem;
  background: rgba(4, 6, 14, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-copyright {
  font-size: 0.73rem;
  color: var(--text-muted);
  opacity: 0.6;
  text-align: center;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem 1.25rem;
  }

  .footer-brand {
    align-items: center;
    max-width: 100%;
  }

  .footer-contact {
    align-items: center;
    text-align: center;
  }
}

/* ==================== MÓDULO DE LOGIN ==================== */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.login-overlay.active {
  display: flex;
}

.login-container {
  max-width: 680px;
  width: 92%;
  text-align: center;
  padding: 1rem;
}

.login-brand {
  margin-bottom: 2.5rem;
}

.login-logo {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.4));
}

.login-brand h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
}

.login-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.login-subtitle {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
}

.login-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 520px) {
  .login-cards {
    grid-template-columns: 1fr;
  }
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

button.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.login-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.student-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
}

.login-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.login-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.login-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.login-enter-btn {
  margin-top: 0.5rem;
  pointer-events: none;
}

.pin-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
}

.pin-group .form-control {
  flex: 1;
}

.pin-error {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-align: center;
}

.pin-error.hidden {
  display: none;
}

.login-footer-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.login-footer-text a {
  color: var(--color-secondary);
  text-decoration: none;
}

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

/* ==================== BADGE DE ROL ==================== */

.role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.role-badge.admin {
  background: rgba(99, 102, 241, 0.18);
  color: var(--color-primary);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.role-badge.student {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==================== TARJETA MODO ALUMNO ==================== */

.student-card-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.student-card-actions .btn {
  font-size: 0.78rem;
}

/* ==================== PÁGINA ADMIN LOGIN ==================== */

body.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 25% 40%, rgba(99, 102, 241, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 70%, rgba(6, 182, 212, 0.07) 0%, transparent 55%);
}

.admin-login-wrap {
  width: 92%;
  max-width: 440px;
  text-align: center;
  padding: 2rem 0;
}

.admin-pin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  margin: 2rem 0 1.25rem;
}

.admin-pin-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.5rem 0 0.4rem;
}

.admin-pin-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.back-to-site {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-to-site:hover {
  color: var(--color-primary);
}

/* ==================== CONTROL DE ROLES ====================  */

/* Ocultar elementos admin cuando el body NO tiene .admin-mode
   (evita parpadeo y no interfiere con los display values existentes) */
body:not(.admin-mode) .admin-only {
  display: none !important;
}
