/* PADEUM Players — Nueva dirección visual Fase Visual 1
 * Design tokens + muestra representativa para Home, Perfil y Cartelera.
 * Aplica únicamente cuando body tiene .theme-light.
 */

body.theme-light {
  /* === SURFACES === */
  --bg-main: #FAFAF8;
  --bg-card: #FFFFFF;
  --bg-input: #F5F5F4;
  --bg-hover: #F2F2F0;

  /* === BORDES === */
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --border-focus: #FF6B00;

  /* === TEXTO === */
  --text-main: #0E0E0E;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;

  /* === ACENTOS === */
  --orange: #FF6B00;
  --orange-hover: #E05E00;
  --orange-light: rgba(255, 107, 0, 0.10);
  --green: #10B981;
  --green-light: rgba(16, 185, 129, 0.10);
  --red: #EF4444;
  --red-light: rgba(239, 68, 68, 0.10);

  /* === SOMBRAS === */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* =========================================================
   NAVEGACIÓN OSCURA (desktop sidebar / mobile header / bottom nav)
   Se preserva como ancla visual. Se restauran tokens oscuros.
   ========================================================= */
.theme-light .social-sidebar,
.theme-light .social-mobile-header,
.theme-light .social-bottom-nav {
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --bg-card: #141A24;
  --bg-input: #1C2433;
  --border: rgba(148, 163, 184, 0.15);
  --orange: #FF6B00;
  color: var(--text-muted);
}

.theme-light .social-sidebar {
  background: rgba(14, 14, 14, 0.98);
  border-right-color: rgba(255, 255, 255, 0.08);
}

.theme-light .social-mobile-header,
.theme-light .social-bottom-nav {
  background: rgba(14, 14, 14, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   CARDS BLANCAS
   ========================================================= */
.theme-light .card,
.theme-light .post-card,
.theme-light .profile-card,
.theme-light .status-card,
.theme-light .home-user-badge,
.theme-light .match-card,
.theme-light .match-detail,
.theme-light .plan-card,
.theme-light .challenge-card,
.theme-light .participant-list > div,
.theme-light .context-empty {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

.theme-light .post-card:hover,
.theme-light .status-card:hover,
.theme-light .home-user-badge:hover,
.theme-light .match-card:hover,
.theme-light .plan-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

/* =========================================================
   HOME / FEED
   ========================================================= */
.theme-light .home-feed-heading h1 {
  color: var(--text-main);
}

.theme-light .section-eyebrow {
  color: var(--orange);
}

.theme-light .section-kicker,
.theme-light .feed-section-heading,
.theme-light .context-block-heading {
  color: var(--text-main);
}

.theme-light .feed-section-heading span,
.theme-light .context-block p,
.theme-light .moment-owner {
  color: var(--text-muted);
}

.theme-light .home-moments {
  border-bottom-color: var(--border);
}

.theme-light .moments-reel {
  scrollbar-color: var(--border) transparent;
}

/* =========================================================
   PERFIL
   ========================================================= */
.theme-light .profile-name {
  color: var(--text-main);
}

.theme-light .profile-nickname {
  color: var(--orange);
}

.theme-light .profile-meta-row {
  color: var(--text-muted);
}

.theme-light .profile-status-bubble {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-main);
}

.theme-light .social-stats-bar {
  border-color: var(--border);
}

.theme-light .social-stat-num {
  color: var(--text-main);
}

.theme-light .social-stat-lbl {
  color: var(--text-muted);
}

/* =========================================================
   CARTELERA / PARTIDOS
   ========================================================= */
.theme-light .match-board-hero h1,
.theme-light .match-board-hero p {
  color: var(--text-main);
}

.theme-light .match-board-hero p {
  color: var(--text-muted);
}

.theme-light .match-card {
  color: var(--text-main);
}

.theme-light .match-card-meta,
.theme-light .match-card-club,
.theme-light .match-card-privacy {
  color: var(--text-muted);
}

.theme-light .match-detail-type {
  color: var(--text-muted);
}

.theme-light .match-detail-hero {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

.theme-light .match-detail-team {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

.theme-light .match-detail-team h2 {
  color: var(--text-muted);
}

.theme-light .match-player-name {
  color: var(--text-main);
}

.theme-light .match-player-meta {
  color: var(--text-muted);
}

.theme-light .match-detail-player.anonymous .match-player-name,
.theme-light .match-detail-player.anonymous .match-player-meta {
  color: var(--text-dim);
}

.theme-light .match-detail-score {
  color: var(--text-main);
}

.theme-light .match-detail-audience {
  color: var(--text-muted);
}

/* =========================================================
   TABS
   ========================================================= */
.theme-light .social-tabs {
  border-bottom-color: var(--border);
}

.theme-light .social-tab {
  color: var(--text-muted);
}

.theme-light .social-tab.active {
  border-bottom-color: var(--orange);
  color: var(--text-main);
}

/* =========================================================
   BOTONES
   ========================================================= */
.theme-light .btn-primary {
  background: var(--orange);
  color: #FFFFFF;
}

.theme-light .btn-primary:hover:not(:disabled) {
  background: var(--orange-hover);
}

.theme-light .btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-main);
}

.theme-light .btn-secondary:hover,
.theme-light .btn-secondary:active {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-light);
}

.theme-light .btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.theme-light .btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.theme-light .home-create-button {
  background: var(--orange);
}

.theme-light .home-create-button:hover {
  background: var(--orange-hover);
}

.theme-light .match-intent-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #FFFFFF;
}

/* =========================================================
   BADGES / CHIPS
   ========================================================= */
.theme-light .badge-reg {
  background: var(--orange-light);
  border-color: rgba(255, 107, 0, 0.22);
  color: var(--orange);
}

.theme-light .badge-guest {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-muted);
}

.theme-light .badge-success {
  background: var(--green-light);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--green);
}

.theme-light .badge-danger {
  background: var(--red-light);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--red);
}

/* =========================================================
   FORMULARIOS
   ========================================================= */
.theme-light .form-input,
.theme-light .form-select,
.theme-light .form-textarea {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-main);
}

.theme-light .form-input:focus,
.theme-light .form-select:focus {
  border-color: var(--orange);
}

.theme-light .form-label {
  color: var(--text-muted);
}

/* =========================================================
   EMPTY STATES / ALERTAS
   ========================================================= */
.theme-light .discovery-state,
.theme-light .feed-state,
.theme-light .match-board-empty {
  color: var(--text-muted);
}

.theme-light .discovery-state h3,
.theme-light .feed-state h3,
.theme-light .match-board-empty strong {
  color: var(--text-main);
}

/* =========================================================
   PUBLICACIONES / POSTS
   ========================================================= */
.theme-light .post-body {
  color: var(--text-main);
}

.theme-light .post-author-name {
  color: var(--text-main);
}

.theme-light .post-author-meta {
  color: var(--text-muted);
}

.theme-light .post-actions-bar {
  border-top-color: var(--border);
}

.theme-light .reaction-btn {
  color: var(--text-muted);
}

.theme-light .reaction-btn:hover {
  background: var(--bg-input);
  color: var(--text-main);
}

.theme-light .comment-input {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-main);
}

/* =========================================================
   AVATARES
   ========================================================= */
.theme-light .avatar {
  background: var(--bg-input);
  color: var(--text-main);
}

/* =========================================================
   LINKS / TEXTOS
   ========================================================= */
.theme-light .text-action {
  color: var(--orange);
}

.theme-light .rail-link-label {
  color: var(--text-dim);
}

/* =========================================================
   SKELETONS
   ========================================================= */
.theme-light .feed-skeleton span {
  background: var(--bg-input);
}

/* =========================================================
   SCROLLBAR SOBRE FONDO CLARO
   ========================================================= */
.theme-light ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}

.theme-light ::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* =========================================================
   FASE VISUAL 1.1 — REFINAMIENTO
   ========================================================= */

/* --- Bottom nav: indicador activo sutil --- */
.theme-light .social-bottom-nav .shell-nav-item {
  color: var(--text-dim);
  position: relative;
}

.theme-light .social-bottom-nav .shell-nav-item.active {
  background: transparent;
  color: var(--orange);
  box-shadow: none;
}

.theme-light .social-bottom-nav .shell-nav-item.active .padeum-icon {
  color: var(--orange);
}

.theme-light .social-bottom-nav .shell-nav-item.active::after {
  background: var(--orange);
  border-radius: 2px;
  bottom: 6px;
  content: '';
  height: 3px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 18px;
}

/* --- Home mobile: estado vacío más social --- */
.theme-light .feed-state {
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 12px;
  text-align: center;
}

.theme-light .feed-state h3 {
  color: var(--text-main);
  font-size: 17px;
  font-weight: 700;
}

.theme-light .feed-state p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 320px;
}

.theme-light .feed-state-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
  width: 100%;
}

.theme-light .feed-state-actions .btn-primary,
.theme-light .feed-state-actions .btn-secondary {
  border-radius: 999px;
  flex: 0 1 auto;
  font-size: 13px;
  min-height: 40px;
  padding: 0 18px;
  width: auto;
}

/* --- Perfil mobile: jerarquía refinada --- */
.theme-light .profile-card {
  border-radius: 20px;
  gap: 10px;
  padding: 28px 18px 22px;
}

.theme-light .profile-avatar-wrap {
  margin-bottom: 14px;
}

.theme-light .profile-avatar-wrap .avatar-xl {
  height: 96px;
  width: 96px;
}

.theme-light .profile-name {
  font-size: 22px;
  font-weight: 800;
}

.theme-light .profile-nickname {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.theme-light .profile-meta-row {
  gap: 10px;
  margin-bottom: 4px;
}

.theme-light .profile-meta-row .badge-success {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-muted);
}

.theme-light .profile-card .btn-primary {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin: 14px auto 0;
  max-width: 220px;
  min-height: 42px;
  width: 100%;
}

.theme-light .social-stats-bar {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 16px;
  padding: 10px 12px;
}

.theme-light .social-stat-num {
  font-size: 18px;
  font-weight: 800;
}

.theme-light .social-stat-lbl {
  font-size: 12px;
  font-weight: 600;
}

.theme-light .profile-status-bubble {
  border-radius: 999px;
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 16px;
}

/* --- Home desktop: layout más intencional --- */
@media (min-width: 1200px) {
  body.social-authenticated .app-container.social-home-active {
    margin-left: 244px;
    max-width: 1180px;
    padding-left: 32px;
    padding-right: 32px;
  }

  .theme-light .social-sidebar {
    align-items: stretch;
    background: rgba(14, 14, 14, 0.98);
    border-right-color: rgba(255, 255, 255, 0.08);
    padding: 28px 20px 22px;
    width: 244px;
  }

  .theme-light .social-sidebar .shell-brand-copy,
  .theme-light .social-sidebar .shell-nav-item span,
  .theme-light .social-sidebar .shell-logout {
    display: initial;
  }

  .theme-light .social-sidebar .shell-nav-item {
    justify-content: flex-start;
    padding: 0 14px;
    width: 100%;
  }

  .theme-light .social-sidebar .shell-account {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-start;
    width: 100%;
  }

  .theme-light .social-sidebar .shell-account > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .theme-light .social-home {
    gap: 32px;
    grid-template-columns: minmax(0, 680px) minmax(280px, 320px);
  }
}

/* --- Rail derecho desktop: claro, sin gradiente oscuro --- */
.theme-light .social-context-rail {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: 16px;
  padding: 0;
}

.theme-light .home-user-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  min-height: 64px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-light .home-user-badge:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.theme-light .home-user-copy strong {
  color: var(--text-main);
}

.theme-light .context-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  margin-top: 0;
  padding: 16px;
}

.theme-light .context-block-heading h2 {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 800;
}

.theme-light .context-block-heading button {
  color: var(--orange);
  font-size: 12px;
}

.theme-light .context-empty {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-muted);
}

.theme-light .context-links button {
  background: transparent;
  border-radius: 12px;
  color: var(--text-main);
  padding: 10px 8px;
  transition: background 0.15s ease;
}

.theme-light .context-links button:hover {
  background: var(--bg-hover);
}

.theme-light .context-link-copy strong {
  color: var(--text-main);
}

.theme-light .context-link-copy small {
  color: var(--text-muted);
}

.theme-light .rail-link-label {
  color: var(--orange);
}

/* --- Cards más livianas --- */
.theme-light .card,
.theme-light .post-card,
.theme-light .profile-card,
.theme-light .status-card,
.theme-light .home-user-badge,
.theme-light .match-card,
.theme-light .match-detail,
.theme-light .plan-card,
.theme-light .challenge-card,
.theme-light .context-block {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* --- Cartelera mobile: ajustes coherentes --- */
.theme-light .match-board-hero {
  margin-bottom: 6px;
}

.theme-light .match-board-hero p {
  font-size: 14px;
  line-height: 1.5;
  max-width: 560px;
}

.theme-light .match-board-empty {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text-muted);
  gap: 12px;
  padding: 40px 16px;
}

.theme-light .match-board-empty strong {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
}

.theme-light .match-board-empty p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  text-align: center;
}

.theme-light .discovery-search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.theme-light .discovery-search-panel:focus-within {
  border-color: var(--orange);
}

.theme-light .discovery-search-panel .form-input {
  background: transparent;
  border: 0;
  color: var(--text-main);
}

.theme-light .discovery-search-panel .form-input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}

.theme-light .discovery-search-icon {
  color: var(--text-muted);
}

.theme-light .discovery-search-hint {
  color: var(--text-dim);
}

.theme-light .discovery-results .discovery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* --- Naranja más controlado --- */
.theme-light .home-create-button {
  border-radius: 999px;
  min-height: 40px;
  padding: 0 16px;
}

.theme-light .home-create-button span {
  display: inline;
}

.theme-light .badge-reg {
  background: rgba(255, 107, 0, 0.08);
  border-color: rgba(255, 107, 0, 0.18);
}

/* =========================================================
   VISUAL 2 — MIGRACIÓN GLOBAL A DESIGN SYSTEM CLARO
   ========================================================= */

/* Screens genéricas: forzar fondo y texto claro */
.theme-light .plans-screen,
.theme-light .create-plan-screen,
.theme-light .plan-detail,
.theme-light .challenges-screen,
.theme-light .create-post-screen,
.theme-light .prepare-screen,
.theme-light .summary-screen,
.theme-light .trajectory-screen,
.theme-light .ranking-screen,
.theme-light .edit-profile-screen,
.theme-light .follow-list-screen,
.theme-light .settings-screen,
.theme-light .login-screen,
.theme-light .signup-screen,
.theme-light .form-screen {
  background: var(--bg-main);
  color: var(--text-main);
}

/* Auth: cards y header */
.theme-light .auth-card,
.theme-light .login-screen .card,
.theme-light .signup-screen .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* Formularios */
.theme-light .form-input,
.theme-light .form-select,
.theme-light .form-textarea {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-main);
}

.theme-light .form-input:focus,
.theme-light .form-select:focus,
.theme-light .form-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.theme-light .form-label {
  color: var(--text-main);
}

.theme-light .form-hint {
  color: var(--text-muted);
}

/* Botones */
.theme-light .btn-secondary {
  border-color: var(--border);
  color: var(--text-main);
}

.theme-light .btn-ghost {
  color: var(--text-muted);
}

.theme-light .btn-danger-soft {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--red);
}

/* Planes y desafíos */
.theme-light .plan-card {
  background: var(--bg-card);
}

.theme-light .plan-card-feed {
  background: var(--bg-card);
}

.theme-light .plan-detail-hero {
  background: var(--bg-card);
}

.theme-light .challenge-card {
  background: var(--bg-card);
}

.theme-light .plan-action.secondary {
  border-color: var(--border);
}

/* Estados vacíos y loading */
.theme-light .plans-empty,
.theme-light .empty-state,
.theme-light .context-empty {
  color: var(--text-muted);
}

.theme-light .skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-input) 50%, var(--bg-hover) 75%);
}

/* Modales */
.theme-light .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.theme-light .modal,
.theme-light .modal-content {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-main);
}

/* Ranking y trayectoria */
.theme-light .leaderboard-row,
.theme-light .trajectory-item,
.theme-light .match-history-item,
.theme-light .stat-card {
  background: var(--bg-card);
  border-color: var(--border);
}

.theme-light .leaderboard-pos.top-1 { color: var(--orange); }
.theme-light .leaderboard-pos.top-2 { color: var(--text-muted); }
.theme-light .leaderboard-pos.top-3 { color: var(--orange-hover); }

/* Inline styles reemplazados */
.theme-light #cat-promotion-panel {
  background: var(--bg-hover);
}

.theme-light #my-ranking-pts {
  color: var(--text-main);
}
