/* ============================================================
   components.css — Componentes reutilizables
   Botones, cards, badges, nav, modales, etc.
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   BOTONES
   ══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-base);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }

/* Variantes */
.btn--primary {
  background: var(--color-green);
  color: #000;
  font-weight: var(--weight-bold);
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-green-dim);
  box-shadow: var(--shadow-green);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
}
.btn--secondary:hover:not(:disabled) {
  border-color: var(--color-green);
  color: var(--color-green);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.btn--danger {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn--danger:hover:not(:disabled) {
  border-color: var(--color-red);
  color: var(--color-red);
}

.btn--google {
  background: #fff;
  color: #111;
  box-shadow: var(--shadow-sm);
  font-weight: var(--weight-semibold);
}
.btn--google:hover:not(:disabled) {
  background: #f5f5f5;
  box-shadow: var(--shadow-md);
}

/* Tamaños */
.btn--sm {
  padding: 7px var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}
.btn--lg {
  padding: 15px var(--space-7);
  font-size: var(--text-md);
  border-radius: var(--radius-xl);
}
.btn--full { width: 100%; }

/* Loading state */
.btn--loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn--loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-8);
}

.card--sm { padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); }
.card--lg { padding: var(--space-10) var(--space-12); }

.card--interactive {
  cursor: pointer;
  transition: all var(--transition-slow);
  text-decoration: none;
  color: inherit;
  display: block;
}
.card--interactive:hover {
  border-color: var(--color-green);
  background: var(--color-surface-alt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card--green {
  background: linear-gradient(135deg, #0d1f12 0%, #0a1a1f 100%);
  border-color: rgba(34, 197, 94, 0.2);
}

.card--accent {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
}

/* Card con icono grande */
.card-icon { font-size: 28px; margin-bottom: var(--space-3); }
.card-title { font-size: var(--text-base); font-weight: var(--weight-bold); margin-bottom: var(--space-1); color: var(--color-text); }
.card-desc  { font-size: var(--text-sm);   color: var(--color-text-muted); line-height: var(--leading-snug); }


/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}

.badge--green  { background: rgba(34,197,94,0.12);  color: var(--color-green);  border: 1px solid rgba(34,197,94,0.25); }
.badge--blue   { background: rgba(59,130,246,0.12); color: var(--color-blue);   border: 1px solid rgba(59,130,246,0.25); }
.badge--red    { background: rgba(239,68,68,0.12);  color: var(--color-red);    border: 1px solid rgba(239,68,68,0.25); }
.badge--amber  { background: rgba(245,158,11,0.12); color: var(--color-amber);  border: 1px solid rgba(245,158,11,0.25); }
.badge--muted  { background: rgba(74,85,104,0.15);  color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* Rank badges */
/* user — gris neutro, el nivel base */
.badge--user {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* youtuber — rojo YouTube */
.badge--youtuber {
  background: rgba(255, 0, 0, 0.12);
  color: #ff4444;
  border: 1px solid rgba(255, 0, 0, 0.25);
}

/* streamer — morado Twitch */
.badge--streamer {
  background: rgba(145, 70, 255, 0.12);
  color: #9146ff;
  border: 1px solid rgba(145, 70, 255, 0.25);
}

/* legend — dorado premium */
.badge--legend {
  background: rgba(255, 200, 0, 0.12);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.25);
}

/* mod — verde */
.badge--mod {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* admin — rojo intenso, máxima jerarquía */
.badge--admin {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}


/* Badge pulsante (live / online) */
.badge--live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}


/* ══════════════════════════════════════════════════════════════
   NAVEGACIÓN
   ══════════════════════════════════════════════════════════════ */

.nav {
  background: rgba(8, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
  padding: 0 var(--content-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-md);
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-icon {
  width: 30px;
  height: 30px;
  background: var(--color-green);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--transition-base);
}
.nav-link:hover, .nav-link.active {
  color: var(--color-text);
  background: var(--color-surface);
}
.nav-link.active { color: var(--color-green); }

/* Avatar */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar--sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar--lg { width: 56px; height: 56px; font-size: var(--text-xl); border-width: 3px; }

/* Nombre en nav */
.nav-username {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  font-weight: var(--weight-medium);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Menú hamburguesa (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-username { display: none; }
  .nav-toggle { display: flex; }
}


/* ══════════════════════════════════════════════════════════════
   STAT CHIPS
   ══════════════════════════════════════════════════════════════ */

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  white-space: nowrap;
}
.stat-chip strong {
  color: var(--color-text);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

/* Row de stats */
.stats-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}


/* ══════════════════════════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════════════════════════ */

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}


/* ══════════════════════════════════════════════════════════════
   ALERTS / MENSAJES
   ══════════════════════════════════════════════════════════════ */

.alert {
  padding: 11px var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  display: none;
}
.alert.is-visible { display: block; }

.alert--error   { background: #1a0a0a; border: 1px solid #4a1515; color: #f87171; }
.alert--success { background: #0a140a; border: 1px solid #1a3a1a; color: #86efac; }
.alert--info    { background: #0d1a2e; border: 1px solid #1e3a5f; color: #93c5fd; }
.alert--warning { background: #1a1200; border: 1px solid #3a2a00; color: #fbbf24; }


/* ══════════════════════════════════════════════════════════════
   BANNER DE INVITADO
   ══════════════════════════════════════════════════════════════ */

.guest-banner {
  display: none;
  padding: 13px var(--space-5);
  border-radius: var(--radius-lg);
  background: #0d1a2e;
  border: 1px solid #1e3a5f;
  font-size: var(--text-sm);
  color: #93c5fd;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-7);
}
.guest-banner.is-visible { display: flex; }
.guest-banner a { color: var(--color-green); font-weight: var(--weight-semibold); }


/* ══════════════════════════════════════════════════════════════
   SECCIÓN: TÍTULO
   ══════════════════════════════════════════════════════════════ */

.section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}


/* ══════════════════════════════════════════════════════════════
   LOADING SCREEN
   ══════════════════════════════════════════════════════════════ */

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
  transition: opacity var(--transition-slow);
}
.loading-screen.is-hidden { opacity: 0; pointer-events: none; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-green);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}


/* ══════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER
   ══════════════════════════════════════════════════════════════ */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.lang-btn {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lang-btn:hover { color: var(--color-text); }
.lang-btn.active {
  background: var(--color-green);
  color: #000;
  border-radius: var(--radius-sm);
}


/* ══════════════════════════════════════════════════════════════
   GRID DE NAVEGACIÓN (home cards)
   ══════════════════════════════════════════════════════════════ */

.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

@media (max-width: 480px) {
  .nav-cards-grid { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
}


/* ══════════════════════════════════════════════════════════════
   DECORACIONES DE FONDO (campo de fútbol)
   ══════════════════════════════════════════════════════════════ */

.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-deco::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(34,197,94,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 20%, rgba(59,130,246,0.04) 0%, transparent 60%);
}

.bg-deco-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 0;
  overflow: hidden;
}
.bg-deco-lines::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  border: 2px solid #22c55e;
  border-radius: 50%;
}
.bg-deco-lines::after {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: #22c55e;
}
