/* shared.css - Sistema de diseño unificado Twitch & Spotify Streaming Suite */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta Base Oscura */
  --bg-primary: #0a0a12;
  --bg-secondary: #121224;
  --bg-tertiary: #181830;
  --bg-card: rgba(23, 23, 46, 0.78);
  --bg-card-hover: rgba(32, 32, 64, 0.90);
  --bg-glass: rgba(18, 18, 36, 0.65);
  --bg-glass-strong: rgba(12, 12, 24, 0.85);
  --bg-input: rgba(10, 10, 20, 0.85);
  
  /* Bordes */
  --border-subtle: rgba(145, 70, 255, 0.2);
  --border-glow: rgba(145, 70, 255, 0.45);
  --border-active: #a970ff;
  --border-spotify: rgba(29, 185, 84, 0.35);
  
  /* Twitch & Cyber-Neon */
  --twitch-purple: #9146ff;
  --twitch-purple-light: #bf94ff;
  --twitch-purple-glow: rgba(145, 70, 255, 0.5);
  
  /* Spotify Brand */
  --spotify-green: #1db954;
  --spotify-green-light: #1ed760;
  --spotify-green-glow: rgba(29, 185, 84, 0.45);
  --spotify-dark: #121212;
  --spotify-card: rgba(18, 18, 18, 0.82);
  
  /* Acentos y Neones */
  --accent-cyan: #00f5d4;
  --accent-cyan-glow: rgba(0, 245, 212, 0.4);
  --accent-pink: #ff007f;
  --accent-pink-glow: rgba(255, 0, 127, 0.4);
  --accent-gold: #ffbe0b;
  --accent-gold-glow: rgba(255, 190, 11, 0.4);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.4);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.4);
  --accent-blue: #3b82f6;

  /* Texto */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0a0a12;

  /* Multiplicadores */
  --mult-1: #9146ff;
  --mult-2: #00f5d4;
  --mult-3: #ffbe0b;
  --mult-4: #ff5400;
  --mult-5: #ff007f;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.65);
  --shadow-neon-purple: 0 0 20px rgba(145, 70, 255, 0.45), 0 0 40px rgba(145, 70, 255, 0.2);
  --shadow-neon-cyan: 0 0 20px rgba(0, 245, 212, 0.45), 0 0 40px rgba(0, 245, 212, 0.2);
  --shadow-neon-spotify: 0 0 20px rgba(29, 185, 84, 0.45), 0 0 40px rgba(29, 185, 84, 0.2);
  --shadow-neon-pink: 0 0 20px rgba(255, 0, 127, 0.45), 0 0 40px rgba(255, 0, 127, 0.2);
  --shadow-neon-gold: 0 0 20px rgba(255, 190, 11, 0.45), 0 0 40px rgba(255, 190, 11, 0.2);

  /* Tipografías */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transiciones */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radio de borde */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Monospace Utility */
.font-mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' on, 'zero' on;
}

/* =======================================================
   SISTEMA DE BOTONES GLOBALES
   ======================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  user-select: none;
  text-align: center;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--twitch-purple) 0%, #772ce8 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(145, 70, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #a05eff 0%, var(--twitch-purple) 100%);
  box-shadow: var(--shadow-neon-purple);
  transform: translateY(-2px);
}

.btn-spotify {
  background: linear-gradient(135deg, var(--spotify-green) 0%, #15883e 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
}

.btn-spotify:hover {
  background: linear-gradient(135deg, var(--spotify-green-light) 0%, var(--spotify-green) 100%);
  box-shadow: var(--shadow-neon-spotify);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-obs {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-obs:hover {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
  color: #ffffff;
  border-color: #818cf8;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* =======================================================
   BADGES & STATUS
   ======================================================= */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(18, 18, 36, 0.75);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-dim);
}

.status-badge.live {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}
.status-badge.live .status-dot {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseGlow 1.5s infinite ease-in-out;
}

.status-badge.paused {
  border-color: rgba(255, 190, 11, 0.4);
  color: var(--accent-gold);
}
.status-badge.paused .status-dot {
  background-color: var(--accent-gold);
}

.status-badge.spotify {
  border-color: var(--border-spotify);
  color: var(--spotify-green-light);
}
.status-badge.spotify .status-dot {
  background-color: var(--spotify-green);
  box-shadow: 0 0 8px var(--spotify-green);
  animation: pulseGlow 1.8s infinite ease-in-out;
}

/* Badges e Insignias */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.badge-twitch {
  background: rgba(145, 71, 255, 0.15);
  border: 1px solid var(--twitch-purple);
  color: var(--twitch-purple-light);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #10b981;
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Selector de Temas Universal */
.chat-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.chat-theme-btn {
  background: rgba(20, 20, 35, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.chat-theme-btn:hover {
  border-color: var(--twitch-purple-light);
  background: rgba(145, 71, 255, 0.18);
  transform: translateY(-1px);
  color: #fff;
}

.chat-theme-btn.active {
  border-color: var(--twitch-purple);
  background: rgba(145, 71, 255, 0.35);
  box-shadow: 0 0 15px rgba(145, 71, 255, 0.4);
  color: #fff;
}

/* =======================================================
   FORM CONTROLS
   ======================================================= */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  outline: none;
}

.form-control:focus {
  border-color: var(--twitch-purple-light);
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.25);
  background: rgba(15, 15, 28, 0.95);
}

.form-control.spotify-focus:focus {
  border-color: var(--spotify-green);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.25);
}

/* =======================================================
   TOAST NOTIFICATION
   ======================================================= */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(18, 18, 36, 0.95);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--shadow-neon-purple);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 99999;
  backdrop-filter: blur(12px);
  transform: translateY(120%);
  opacity: 0;
  transition: all var(--transition-bounce);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* =======================================================
   ANIMACIONES GLOBALES
   ======================================================= */
@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px currentColor);
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 16px currentColor);
  }
}

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

@keyframes eqBounce {
  0%, 100% { height: 4px; }
  50% { height: 22px; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatElement {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =======================================================
   SISTEMA UNIVERSAL DE MODALES Y FORMULARIOS
   ======================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
  padding: 0.2rem 0.5rem;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Formularios Universales */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--spotify-green);
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.25);
}

.form-control.font-mono {
  font-family: var(--font-mono);
}

/* User Pill Global SSO */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(145, 71, 255, 0.12);
  border: 1px solid rgba(145, 71, 255, 0.35);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  transition: all var(--transition-fast);
}

.user-pill:hover {
  background: rgba(145, 71, 255, 0.2);
  border-color: var(--twitch-purple-light);
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--twitch-purple);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.user-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.btn-logout-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  font-size: 0.8rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.btn-logout-mini:hover {
  color: #ef4444;
}

/* =======================================================
   ESTILOS DE PANEL ADMIN, ROLES Y MUTEO DE FUNCIONES
   ======================================================= */
.admin-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.btn-admin-header {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-admin-header:hover {
  background: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.twitch-warning-banner {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.3s ease-out;
}

.twitch-warning-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.twitch-warning-icon {
  font-size: 1.4rem;
  animation: pulse 2s infinite;
}

.twitch-warning-text h4 {
  margin: 0;
  font-size: 0.92rem;
  color: #fef08a;
  font-weight: 800;
}

.twitch-warning-text p {
  margin: 0.2rem 0 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Muteo y atenuación de controles sin Twitch conectado */
body.twitch-unlinked [data-requires-twitch] {
  opacity: 0.45 !important;
  filter: grayscale(60%);
  pointer-events: none !important;
  cursor: not-allowed !important;
  position: relative;
}

body.twitch-unlinked [data-requires-twitch-wrap] {
  cursor: not-allowed;
  position: relative;
}

/* Tabla de Administración */
.admin-table-container {
  max-height: 380px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.admin-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.7rem;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: rgba(145, 71, 255, 0.08);
}



