/* =========================================================
   jugador_portal.css (global)
   Estética moderna, responsive, legible y reutilizable.
   ========================================================= */

/* -------- CSS Reset (suave) -------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.45;
  color: #0f172a; /* slate-900 */
  background: radial-gradient(1200px 800px at 10% 0%, #e0f2fe 0%, rgba(224,242,254,0) 55%),
              radial-gradient(1200px 800px at 90% 0%, #fee2e2 0%, rgba(254,226,226,0) 55%),
              #f8fafc; /* slate-50 */
}

/* -------- Variables (fácil de ajustar) -------- */
:root {
  --bg: #f8fafc;
  --card: rgba(255, 255, 255, 0.85);
  --card-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-sm: 0 6px 16px rgba(2, 6, 23, 0.08);

  --primary: #2563eb; /* blue-600 */
  --primary-700: #1d4ed8;
  --danger: #dc2626;  /* red-600 */
  --danger-700: #b91c1c;
  --warning: #f59e0b; /* amber-500 */
  --success: #16a34a; /* green-600 */
  --neutral: #334155; /* slate-700 */

  --radius: 18px;
  --radius-sm: 12px;

  --container: 1100px;
  --pad: 18px;
}

/* -------- Tipografía -------- */
h1,h2,h3,h4,h5,h6 { margin: 0 0 10px; letter-spacing: -0.02em; }
.h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* -------- Layout base -------- */
.container {
  width: min(var(--container), calc(100% - 28px));
  margin: 24px auto 40px;
}

.app--player .container {
  padding-bottom: 20px;
}

/* -------- Topbar / Header -------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(248, 250, 252, 0.75);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  width: min(var(--container), calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.brand__text { min-width: 0; }
.brand__title {
  font-weight: 800;
  font-size: 1rem;
}
.brand__subtitle {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* -------- Card -------- */
.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__header {
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(255,255,255,0.60));
}

.card__body { padding: 18px; }

.hint {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  transition: transform .04s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  text-decoration: none !important;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}
.btn--primary:hover { filter: brightness(1.02); }

.btn--danger {
  background: linear-gradient(180deg, var(--danger), var(--danger-700));
  color: #fff;
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.22);
}
.btn--danger:hover { filter: brightness(1.02); }

.btn--ghost {
  background: rgba(255,255,255,0.60);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow-sm);
}

/* -------- Alerts -------- */
.alert {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.80);
}

.alert strong { font-weight: 800; }

.alert--info {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(224, 242, 254, 0.55);
}

.alert--success {
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(220, 252, 231, 0.55);
}

.alert--warning {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(254, 243, 199, 0.55);
}

.alert--danger {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(254, 226, 226, 0.55);
}

/* -------- Badges / Pills -------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.75);
  color: var(--neutral);
  white-space: nowrap;
}

.badge--primary {
  border-color: rgba(37, 99, 235, 0.30);
  background: rgba(37, 99, 235, 0.10);
  color: #1e40af;
}
.badge--success {
  border-color: rgba(22, 163, 74, 0.30);
  background: rgba(22, 163, 74, 0.10);
  color: #166534;
}
.badge--warning {
  border-color: rgba(245, 158, 11, 0.30);
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}
.badge--danger {
  border-color: rgba(220, 38, 38, 0.30);
  background: rgba(220, 38, 38, 0.10);
  color: #7f1d1d;
}
.badge--neutral {
  border-color: rgba(51, 65, 85, 0.25);
  background: rgba(51, 65, 85, 0.08);
  color: #0f172a;
}

/* -------- Tables -------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.table thead th {
  text-align: left;
  font-size: 0.88rem;
  color: #0f172a;
  padding: 12px 14px;
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(2, 6, 23, 0.03);
}

.cell-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.col-state { width: 220px; }

/* -------- Forms (global, para futuro) -------- */
.form { display: grid; gap: 14px; }

.input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  color: var(--text);
  outline: none;
}

.input:focus, select:focus, textarea:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.label {
  font-weight: 800;
  font-size: 0.92rem;
}

.help {
  font-size: 0.88rem;
  color: var(--muted);
}

/* -------- Footer -------- */
.footer {
  padding: 16px 2px 0;
  display: flex;
  justify-content: center;
}

/* -------- Utilities -------- */
.row { display: flex; gap: 14px; }
.stack { display: grid; gap: 12px; }
.spacer { height: 14px; }
.hidden { display: none !important; }

/* -------- Responsive: mejoras mobile -------- */
@media (max-width: 720px) {
  .container { margin: 18px auto 30px; }
  .topbar__inner { padding: 12px 0; }
  .brand__logo { width: 40px; height: 40px; border-radius: 14px; }

  .topbar__actions { gap: 8px; }
  .btn { padding: 10px 12px; border-radius: 14px; }

  .card__header { padding: 16px 16px 10px; }
  .card__body { padding: 16px; }

  .table { min-width: 0; }

  /* Tabla a modo “cards” en mobile usando data-label */
  .table-wrap { border: 0; background: transparent; }
  .table { border-collapse: separate; border-spacing: 0 12px; }
  .table thead { display: none; }
  .table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,0.82);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  }
  .table tbody td:last-child { border-bottom: 0; }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: 800;
    color: var(--muted);
  }

  .col-state { width: auto; }
}

/* -------- Dark mode (si el sistema lo pide) -------- */
@media (prefers-color-scheme: dark) {
  body {
    color: #e5e7eb;
    background: radial-gradient(1200px 800px at 10% 0%, rgba(37,99,235,0.22) 0%, rgba(0,0,0,0) 55%),
                radial-gradient(1200px 800px at 90% 0%, rgba(220,38,38,0.18) 0%, rgba(0,0,0,0) 55%),
                #0b1220;
  }

  :root {
    --card: rgba(15, 23, 42, 0.62);
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 12px 32px rgba(0,0,0,0.35);
    --shadow-sm: 0 10px 22px rgba(0,0,0,0.30);
    --text: #e5e7eb;
    --muted: #94a3b8;
  }

  .topbar {
    background: rgba(2, 6, 23, 0.55);
    border-bottom-color: rgba(148, 163, 184, 0.14);
  }

  .btn--ghost { background: rgba(2,6,23,0.30); }
  .table-wrap, .alert { background: rgba(2,6,23,0.28); }
  .table thead th { background: rgba(2,6,23,0.35); }
}
