/* ── Variables ───────────────────────────────────────────────── */
:root {
  --azul:        #1C233D;
  --azul-med:    #242E52;
  --azul-claro:  #2E3A63;
  --dorado:      #FACD2C;
  --dorado-claro:#FFDE5C;
  --dorado-dark: #D9A800;
  --gris-bg:     #f1f5f9;
  --gris-card:   #ffffff;
  --texto:       #2a2f37;
  --texto-muted: #64748b;
  --borde:       #e2e8f0;
}

/* ── Reset / Base ────────────────────────────────────────────── */
body {
  background: var(--gris-bg);
  color: var(--texto);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.container { flex: 1; }

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar-liguzba {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-med) 100%);
  border-bottom: 3px solid var(--dorado);
  padding: 0.5rem 0;
}
.navbar-liguzba .navbar-brand { color: #fff !important; }
.navbar-liguzba .nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; }
.navbar-liguzba .nav-link:hover { color: var(--dorado) !important; }
.navbar-liguzba .nav-link.nav-admin { color: var(--dorado) !important; }
.navbar-liguzba .dropdown-toggle::after { border-top-color: rgba(255,255,255,.6); }
.navbar-liguzba .navbar-toggler { border-color: rgba(255,255,255,.3); }
.navbar-liguzba .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Brand text */
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-main  { font-size: 1.4rem; font-weight: 800; color: var(--dorado); letter-spacing: 2px; }
.brand-sub   { font-size: .65rem; color: rgba(255,255,255,.7); letter-spacing: .5px; }

/* Logo placeholder */
.logo-placeholder { width: 48px; height: 48px; }
.logo-fallback {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--dorado); color: var(--azul);
  font-weight: 900; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── Hero Banner ─────────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-med) 60%, var(--azul-claro) 100%);
  border-radius: 16px;
  padding: 3rem 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '🏀';
  position: absolute; right: -20px; bottom: -30px;
  font-size: 10rem; opacity: .07;
}
.hero-title  { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; }
.hero-subtitle { color: var(--dorado); font-size: 1.1rem; }

/* ── Cards ───────────────────────────────────────────────────── */
.card-liguzba {
  background: var(--gris-card);
  border: 1px solid var(--borde);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(10,36,99,.07);
  overflow: hidden;
}
.card-liguzba .card-footer {
  background: var(--gris-bg);
  border-top: 1px solid var(--borde);
  padding: .5rem 1rem;
}
.card-header-gold {
  background: linear-gradient(90deg, var(--azul) 0%, var(--azul-med) 100%);
  color: #fff;
  font-weight: 600;
  padding: .75rem 1rem;
  border-bottom: 2px solid var(--dorado);
}
.card-hover { transition: transform .15s, box-shadow .15s; cursor: pointer; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(10,36,99,.12); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-liguzba { font-size: .92rem; }
.table-liguzba thead tr {
  background: linear-gradient(90deg, var(--azul) 0%, var(--azul-med) 100%);
  color: #fff;
}
.table-liguzba thead th {
  font-weight: 600; border: none; padding: .75rem .6rem;
  white-space: nowrap;
}
.table-liguzba tbody tr:hover { background: rgba(245,158,11,.08); }
.table-liguzba tbody td { vertical-align: middle; padding: .6rem .6rem; border-color: var(--borde); }

/* Posiciones destacadas */
.fila-primero td:first-child { border-left: 4px solid var(--dorado); }
.fila-segundo td:first-child { border-left: 4px solid #94a3b8; }
.fila-tercero td:first-child { border-left: 4px solid #cd7f32; }

/* ── Badges ──────────────────────────────────────────────────── */
.bg-gold { background-color: var(--dorado) !important; }
.badge-bronze { background-color: #cd7f32 !important; color: #fff; }
.puntos-badge {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: #fff; font-size: .9rem; padding: .35em .7em;
}
.puntos-cel { font-size: 1.05rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-gold {
  background: linear-gradient(135deg, var(--dorado) 0%, var(--dorado-dark) 100%);
  color: var(--azul); font-weight: 700; border: none;
  transition: filter .15s, transform .1s;
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); color: var(--azul); }
.btn-outline-gold {
  border: 1.5px solid var(--dorado); color: var(--dorado);
  background: transparent; font-weight: 600;
}
.btn-outline-gold:hover { background: var(--dorado); color: var(--azul); }

/* ── Colors helpers ──────────────────────────────────────────── */
.text-gold   { color: var(--dorado) !important; }
.text-silver { color: #94a3b8 !important; }
.text-bronze { color: #cd7f32 !important; }

/* ── Category section ────────────────────────────────────────── */
.categoria-titulo {
  font-size: 1.3rem; font-weight: 700; color: var(--azul);
  display: flex; align-items: center; gap: .5rem;
}
.categoria-section { border-bottom: 1px solid var(--borde); padding-bottom: 1rem; }
.categoria-section:last-child { border-bottom: none; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header h1 { font-weight: 800; color: var(--azul); font-size: clamp(1.4rem, 3vw, 2rem); }

/* ── Jornadas list ───────────────────────────────────────────── */
.jornadas-list { max-height: 500px; overflow-y: auto; }
.jornada-item { border-color: var(--borde) !important; }
.jornada-item.active {
  background: linear-gradient(90deg, var(--azul), var(--azul-med)) !important;
  border-color: var(--azul) !important; color: #fff !important;
}
.jornada-titulo {
  color: var(--azul); font-weight: 700;
  padding: .4rem 0; border-bottom: 2px solid var(--dorado); margin-bottom: .75rem;
}

/* ── Partido card ────────────────────────────────────────────── */
.partido-card {
  border: 1px solid var(--borde); border-radius: 10px;
  transition: box-shadow .15s;
}
.partido-card:hover { box-shadow: 0 3px 12px rgba(10,36,99,.1); }

.partido-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: .5rem;
}
@media (max-width: 576px) {
  .partido-row { grid-template-columns: 1fr auto 1fr; }
  .admin-col { display: none; }
}

.equipo-col { min-width: 0; }
.equipo-nombre { font-weight: 600; font-size: .95rem; display: block; }
.equipo-nombre.ganador { color: var(--azul-claro); }

.marcador-col { white-space: nowrap; }
.marcador { font-size: 1.4rem; font-weight: 800; color: var(--texto); }
.pts-ganador { color: var(--azul-claro); }
.pts-sep { color: var(--texto-muted); margin: 0 .2rem; }

.vs-badge {
  display: inline-block; padding: .2rem .6rem;
  background: var(--azul); color: var(--dorado);
  border-radius: 6px; font-weight: 700; font-size: .85rem;
}

/* ── Equipo icon small ───────────────────────────────────────── */
.equipo-icon-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}

/* ── Marcador input (resultado form) ─────────────────────────── */
.marcador-input-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: end;
}
.marcador-input { font-size: 2rem !important; font-weight: 800 !important; height: auto !important; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer-liguzba {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-med) 100%);
  border-top: 3px solid var(--dorado);
  color: #fff;
}
.footer-logo { font-size: 1.4rem; font-weight: 800; color: var(--dorado); letter-spacing: 2px; }
.footer-link { color: var(--dorado); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-liguzba .text-muted { color: rgba(255,255,255,.55) !important; }

/* ── List group ──────────────────────────────────────────────── */
.list-group-item { border-color: var(--borde); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert-success { border-left: 4px solid #22c55e; }
.alert-warning { border-left: 4px solid var(--dorado); }
.alert-danger  { border-left: 4px solid #ef4444; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE GLOBAL
   ════════════════════════════════════════════════════════════ */

/* ── Navbar móvil ── */
@media (max-width: 991px) {
  .navbar-liguzba .navbar-collapse {
    background: var(--azul-med);
    border-top: 1px solid rgba(250,205,44,.15);
    padding: .5rem 0;
    border-radius: 0 0 8px 8px;
  }
  .navbar-liguzba .nav-link { padding: .55rem 1rem !important; }
  .navbar-liguzba .dropdown-menu {
    background: rgba(255,255,255,.05) !important;
    border: none;
    padding-left: 1rem;
  }
  .brand-main  { font-size: 1.15rem; }
  .brand-sub   { font-size: .58rem; }
  .logo-placeholder { width: 38px; height: 38px; }
}

/* ── Container padding móvil ── */
@media (max-width: 576px) {
  .container { padding-left: 14px; padding-right: 14px; }
  main.container { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}

/* ── Tablas con scroll horizontal ── */
.table-responsive-always {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .table-responsive-sm { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Cards en grilla ── */
@media (max-width: 576px) {
  .card-liguzba { border-radius: 8px; }
  .card-header-gold { padding: .6rem .85rem; font-size: .88rem; }
}

/* ── Botones en móvil ── */
@media (max-width: 400px) {
  .btn-lg { padding: .55rem 1.2rem; font-size: .9rem; }
}

/* ── Partido card ── */
@media (max-width: 576px) {
  .partido-row { grid-template-columns: 1fr auto 1fr; }
  .marcador-input-grid { grid-template-columns: 1fr auto 1fr; gap: .5rem; }
  .marcador-input { font-size: 1.5rem !important; }
}

/* ── Page header ── */
@media (max-width: 576px) {
  .page-header { flex-direction: column; align-items: flex-start !important; gap: .5rem; }
  .page-header h1 { font-size: 1.25rem; }
}

/* ── Footer ── */
@media (max-width: 576px) {
  .footer-liguzba { padding: 1.5rem 0; }
  .footer-logo { font-size: 1.1rem; }
}

/* ── Tabla posiciones pública ── */
@media (max-width: 576px) {
  .table-liguzba { font-size: .78rem; }
  .table-liguzba thead th,
  .table-liguzba tbody td { padding: .45rem .35rem; }
}

/* ═══════════════════════════════════════════════
   FIXES VISUALES NAVBAR
═══════════════════════════════════════════════ */

/* Logo circular en navbar */
.navbar-pub .navbar-brand img,
.navbar-admin-bar .admin-brand img {
  border-radius: 50% !important;
  object-fit: cover !important;
  width: 44px !important;
  height: 44px !important;
  display: block;
  background: transparent;
}

/* Ocultar iconos de género en el navbar público */
.navbar-pub .bi-gender-male,
.navbar-pub .bi-gender-female {
  display: none !important;
}

/* Mostrar balón de basquetbol en su lugar */
.navbar-pub .nav-cat-icon::before {
  content: "BB";
  font-style: normal;
  font-size: .75rem;
  font-weight: 900;
  font-family: 'Segoe UI', sans-serif;
  letter-spacing: -.5px;
}
.navbar-pub .nav-ball-icon::before {
  content: "" !important;
}
.navbar-pub .nav-ball-icon {
  font-size: .88rem;
  line-height: 1;
}

/* Ocultar iconos de género en chips de categoría y tabs */
.hero-cats .bi-gender-male,
.hero-cats .bi-gender-female,
.tablas-nav .bi-gender-male,
.tablas-nav .bi-gender-female,
.tabla-header .bi-gender-male,
.tabla-header .bi-gender-female {
  display: none !important;
}

/* Chips hero: quitar texto de nombre largo, mostrar solo abreviación */
/* Usamos ::after en el link para agregar la abreviación via CSS attr() */
.hero-cats .cat-chip {
  position: relative;
  overflow: hidden;
}

/* Reducir tamaño del texto en chips para que quede compacto */
.hero-cats .cat-chip {
  font-size: .72rem;
  padding: 4px 10px;
  gap: 4px;
}

/* Logo admin también circular */
.navbar-admin-bar .admin-brand img {
  border-radius: 50% !important;
  object-fit: cover !important;
  width: 38px !important;
  height: 38px !important;
}

/* Logo en login page también circular */
.login-logo {
  border-radius: 50% !important;
  object-fit: cover !important;
}
