/*
 * Componentes Reutilizables
 */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--neon-cyan);
  color: var(--bg-primary);
}

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

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-secondary:hover {
  background-color: rgba(0, 240, 255, 0.1);
  box-shadow: var(--glow-cyan);
}

.btn-magenta {
  background-color: var(--neon-magenta);
  color: var(--text-primary);
}

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

.btn-danger {
  background-color: #ff3333;
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 0 12px rgba(255, 51, 51, 0.8);
}

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 16px 32px; font-size: 1.125rem; }

/* Tarjetas (Cards) */
.card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 1.5rem;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: var(--glow-cyan);
}

.card-header { margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.75rem; }
.card-body { margin-bottom: 1rem; }
.card-footer { margin-top: 1rem; }

/* Formularios */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: transparent;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-family: var(--font-primary);
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(200, 210, 230, 0.5);
}

.form-input-error {
  border-color: #ff3333;
  box-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

.form-error-text {
  color: #ff3333;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

/* Badges / Insignias */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 9999px;
  background-color: rgba(0, 240, 255, 0.2);
  color: var(--neon-cyan);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-magenta {
  background-color: rgba(180, 0, 255, 0.2);
  color: var(--neon-magenta);
}

/* Alertas */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid;
  margin-bottom: 1rem;
}

.alert-info { background-color: rgba(0, 240, 255, 0.1); border-color: var(--neon-cyan); color: var(--text-primary); }
.alert-success { background-color: rgba(0, 255, 100, 0.1); border-color: #00ff64; color: var(--text-primary); }
.alert-warning { background-color: rgba(255, 200, 0, 0.1); border-color: #ffc800; color: var(--text-primary); }
.alert-error { background-color: rgba(255, 50, 50, 0.1); border-color: #ff3232; color: var(--text-primary); }

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal {
  background-color: var(--bg-card-solid);
  border-radius: var(--border-radius);
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  position: relative;
}

.modal-header { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; color: var(--neon-cyan); }
.modal-body { margin-bottom: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; }

/* Barra de progreso */
.progress-bar {
  height: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  transition: width var(--transition-normal);
  box-shadow: 0 0 8px var(--neon-cyan);
}

/* Avatar */
.avatar {
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  object-fit: cover;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 64px; height: 64px; }
.avatar-lg { width: 100px; height: 100px; }

/* Caja de búsqueda */
.search-box {
  position: relative;
}
.search-box input {
  padding-left: 2.5rem;
}
.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Divisor */
.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  margin: 2rem 0;
  opacity: 0.5;
}

/* Esqueleto de carga (Skeleton) */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Contenedor de Toasts */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--bg-card-solid);
  border-left: 4px solid var(--neon-cyan);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: slideInRight 0.3s ease forwards;
  min-width: 250px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Switch (Interruptor) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 24px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
}

input:checked + .slider:before {
  transform: translateX(26px);
  background-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

/* Accesibilidad */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* ==========================================
   PANEL LATERAL DESLIZABLE (SIDEBAR GEMINI)
   ========================================== */

/* Botón Abrir Menú (Hamburguesa) */
.sidebar-toggle-btn {
  background: transparent;
  color: #00F0FF;
  border: 1px solid #00F0FF;
  padding: 8px 14px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
  margin: 10px;
  transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.8);
}

/* Fondo oscuro semi-transparente cuando el menú está abierto */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Contenedor del Panel Lateral */
.sidebar-container {
  position: fixed;
  top: 0;
  left: -280px; /* Oculto fuera de pantalla hacia la izquierda */
  width: 280px;
  height: 100vh;
  background-color: #1C0B36;
  border-right: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clase activa para mostrar el menú */
.sidebar-container.open {
  left: 0;
}

/* Encabezado del Panel */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  font-weight: bold;
  font-size: 1.2rem;
}

.sidebar-logo {
  width: 30px;
  height: 30px;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: #C8D2E6;
  font-size: 24px;
  cursor: pointer;
}

.sidebar-close-btn:hover {
  color: #00F0FF;
}

/* Lista de navegación */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 15px 10px;
  flex-grow: 1;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #C8D2E6;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(35, 18, 65, 0.85);
  color: #00F0FF;
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.2);
  border-left: 3px solid #00F0FF;
}

/* Pie del Panel (Perfil y Logout) */
.sidebar-footer {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #231241;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.avatar {
  width: 36px;
  height: 36px;
  background: #B400FF;
  color: #FFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  color: #C8D2E6;
  font-size: 0.75rem;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ff5555;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 85, 85, 0.1);
}
