/* Variables y configuración de tema */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #4cc9f0;
  --warning-color: #f72585;
  --danger-color: #dc2f02;
  --info-color: #4895ef;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --bg-light: #f8f9fa;
  --bg-dark: #121212;
  --text-light: #f8f9fa;
  --text-dark: #212529;
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition-speed: 0.3s;
}

/* Modos Claro/Oscuro */
body.light-mode {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

.dark-mode .card,
.dark-mode .accordion-item,
.dark-mode .modal-content {
  background-color: #1e1e1e;
  color: var(--text-light);
  border-color: #333;
}

.dark-mode .table {
  color: var(--text-light);
}

.dark-mode .table-light th {
  background-color: #333;
  color: var(--text-light);
}

.dark-mode .nav-tabs .nav-link.active {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.dark-mode .nav-tabs .nav-link {
  color: var(--primary-color);
}

.dark-mode .bg-light {
  background-color: #333 !important;
}

.dark-mode .text-muted {
  color: #adb5bd !important;
}

.dark-mode #appContainer {
  background-color: #121212 !important;
}

/* Estilos generales */
body {
  font-family: var(--font-family);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  min-height: 100vh;
}

.container, .container-fluid {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* Componentes */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: none;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-header {
  border-bottom: none;
  padding: 1rem 1.25rem;
}

.avatar, .avatar-xs {
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.avatar {
  width: 40px;
  height: 40px;
}

.avatar-xs {
  width: 30px;
  height: 30px;
}

.avatar-iniciales {
  font-weight: bold;
  font-size: 1.2rem;
}

/* Estadísticas y datos */
.stat-large {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
}

.curso-stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.display-1 {
  font-size: 3.5rem;
  font-weight: 600;
}

/* Navegación */
.nav-tabs {
  border-bottom: none;
  gap: 0.5rem;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.nav-tabs .nav-link.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.curso-tabs .nav-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Tablas */
.table {
  margin-bottom: 0;
}

.table th {
  font-weight: 600;
  border-top: none;
}

.table-responsive {
  border-radius: var(--radius);
  overflow: hidden;
}

/* Acordeón */
.accordion-item {
  border-radius: var(--radius) !important;
  overflow: hidden;
  border: none;
}

.accordion-header {
  border-radius: var(--radius) !important;
}

.accordion-button {
  padding: 1rem;
  background-color: #f8f9fa;
  font-weight: 500;
}

.accordion-button:not(.collapsed) {
  background-color: var(--primary-color);
  color: white;
}

.accordion-button:focus {
  box-shadow: none;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.rounded-pill {
  padding-left: 0.8em;
  padding-right: 0.8em;
}

/* Botones */
.btn {
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

/* Header */
.header-banner {
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
}

#loader .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.25rem;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* Estado de usuario */
.estado-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 0.75em;
  border-radius: 50px;
}

/* Progress bars */
.progress {
  background-color: #e9ecef;
  border-radius: 50px;
  height: 0.5rem;
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .stat-large {
    font-size: 1.75rem;
  }
  
  .display-1 {
    font-size: 2.5rem;
  }
  
  .usuario-col {
    min-width: 200px;
  }
  
  .badges .badge {
    display: none;
  }
  
  .badges .badge:first-child {
    display: inline-block;
  }
}

/* Estilos para las notificaciones */
.notificacion {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.3s ease-in-out;
  max-width: 350px;
}

.notificacion.mostrar {
  transform: translateX(0);
}

.notificacion-contenido {
  display: flex;
  align-items: center;
}

.notificacion-contenido i {
  font-size: 1.25rem;
  margin-right: 10px;
}

.notificacion-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.notificacion-warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffc107;
}

.notificacion-error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.notificacion-info {
  background-color: #cce5ff;
  color: #004085;
  border-left: 4px solid #0d6efd;
}