/* ============================================================
   CLUB TENIS LEBRIJA — Estilos principales
   Paleta: Verde pista + blanco + tierra batida
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --verde:        #2D6A4F;
  --verde-claro:  #52B788;
  --verde-hover:  #1B4332;
  --tierra:       #C9A96E;
  --tierra-claro: #F0E0C0;
  --blanco:       #FAFAF8;
  --gris-claro:   #F2F4F3;
  --gris-medio:   #C8D0CB;
  --gris-texto:   #5A6360;
  --negro:        #1A1F1D;
  --rojo:         #D62828;
  --amarillo:     #F4A832;

  --radio:        10px;
  --radio-lg:     18px;
  --sombra:       0 2px 12px rgba(0,0,0,0.08);
  --sombra-lg:    0 6px 28px rgba(0,0,0,0.13);
  --transicion:   0.2s ease;

  --fuente-display: 'Bebas Neue', sans-serif;
  --fuente-body:    'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--fuente-body);
  background: var(--gris-claro);
  color: var(--negro);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── TIPOGRAFÍA ─────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--fuente-display); letter-spacing: 0.04em; line-height: 1.1; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p  { line-height: 1.7; }

a { color: var(--verde); text-decoration: none; transition: color var(--transicion); }
a:hover { color: var(--verde-hover); }

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  background: var(--verde);
  color: white;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.navbar-brand {
  font-family: var(--fuente-display);
  font-size: 1.5rem;
  color: white;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand span { color: var(--tierra); }
.navbar-brand .brand-short { display: none; }
.navbar-brand .brand-short span { color: var(--tierra); }

.navbar-menu { display: flex; gap: 0.25rem; align-items: center; }

.navbar-menu a {
  color: rgba(255,255,255,0.85);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radio);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transicion), color var(--transicion);
}

.navbar-menu a:hover,
.navbar-menu a.activo {
  background: rgba(255,255,255,0.15);
  color: white;
}

.navbar-usuario {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}

.navbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--tierra);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fuente-display);
  font-size: 1rem;
  color: white;
  cursor: pointer;
}

/* ── HAMBURGER MOBILE ───────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: white; border-radius: 2px;
  transition: var(--transicion);
}

/* ── LAYOUT PRINCIPAL ───────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.page-header {
  background: var(--verde);
  color: white;
  padding: 2rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
}

.page-header h1 { color: white; }
.page-header p  { color: rgba(255,255,255,0.75); margin-top: 0.3rem; }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  overflow: hidden;
}

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

.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* ── BOTONES ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radio);
  font-family: var(--fuente-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transicion);
  text-decoration: none;
}

.btn-primary   { background: var(--verde); color: white; }
.btn-primary:hover { background: var(--verde-hover); color: white; }

.btn-secondary { background: var(--gris-claro); color: var(--negro); border: 1px solid var(--gris-medio); }
.btn-secondary:hover { background: var(--gris-medio); }

.btn-tierra    { background: var(--tierra); color: white; }
.btn-tierra:hover { background: #b8914f; color: white; }

.btn-danger    { background: var(--rojo); color: white; }
.btn-danger:hover { background: #a81e1e; color: white; }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── FORMULARIOS ────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gris-texto);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--gris-medio);
  border-radius: var(--radio);
  font-family: var(--fuente-body);
  font-size: 0.95rem;
  background: white;
  color: var(--negro);
  transition: border-color var(--transicion), box-shadow var(--transicion);
}

.form-control:focus {
  outline: none;
  border-color: var(--verde-claro);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
}

.form-control.error { border-color: var(--rojo); }
.form-error { color: var(--rojo); font-size: 0.8rem; margin-top: 0.3rem; }

/* ── TABLAS DE CLASIFICACIÓN ────────────────────────────── */
.tabla-clasificacion {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.tabla-clasificacion th {
  background: var(--verde);
  color: white;
  padding: 0.65rem 0.8rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tabla-clasificacion td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--gris-claro);
  vertical-align: middle;
}

.tabla-clasificacion tr:last-child td { border-bottom: none; }

.tabla-clasificacion tr:hover td { background: var(--gris-claro); }

.pos-numero {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.pos-1 { background: #FFD700; color: #7a5c00; }
.pos-2 { background: #C0C0C0; color: #444; }
.pos-3 { background: #CD7F32; color: white; }
.pos-n { background: var(--gris-claro); color: var(--gris-texto); }

.puntos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--verde);
  color: white;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 34px;
}

/* ── RESULTADO PARTIDO ──────────────────────────────────── */
.resultado-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radio);
  border: 1.5px solid var(--gris-claro);
  margin-bottom: 0.6rem;
  gap: 0.5rem;
  transition: border-color var(--transicion);
}

.resultado-card:hover { border-color: var(--verde-claro); }

.resultado-jugador {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
}

.resultado-jugador.ganador { font-weight: 700; color: var(--verde); }

.resultado-marcador {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.set-box {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--gris-claro);
  color: var(--negro);
}

.set-box.ganado { background: var(--verde); color: white; }

/* Badge walkover / sin jugar */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-walkover { background: #FFF3CD; color: #7a5c00; }
.badge-sin-jugar { background: var(--gris-claro); color: var(--gris-texto); }
.badge-pendiente { background: #E3F0FF; color: #1a4a8a; }
.badge-disputado { background: #FFE8E8; color: var(--rojo); }
.badge-validado  { background: #E8F8EF; color: var(--verde); }

/* ── ESTADO RESULTADO ───────────────────────────────────── */
.estado-resultado {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

/* ── TABS DIVISIONES ────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  white-space: nowrap;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--gris-medio);
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transicion);
  color: var(--gris-texto);
}

.tab-btn:hover { border-color: var(--verde-claro); color: var(--verde); }
.tab-btn.activo { background: var(--verde); color: white; border-color: var(--verde); }

/* ── GRID ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }

/* ── PERFIL / CONTACTO ──────────────────────────────────── */
.jugador-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gris-claro);
}
.jugador-item:last-child { border-bottom: none; }

.jugador-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--verde-claro);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fuente-display);
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.jugador-info { flex: 1; }
.jugador-nombre { font-weight: 600; font-size: 0.95rem; }
.jugador-grupo  { font-size: 0.8rem; color: var(--gris-texto); }

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #25D366;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transicion);
}
.whatsapp-btn:hover { background: #1da851; color: white; }

/* ── NOTIFICACIONES ─────────────────────────────────────── */
.notif-badge {
  background: var(--rojo);
  color: white;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: absolute;
  top: -4px; right: -4px;
}

.notif-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gris-claro);
  font-size: 0.88rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.no-leida { background: #F0F8F4; border-left: 3px solid var(--verde-claro); }

/* ── PATROCINADORES ─────────────────────────────────────── */
.patrocinadores {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: white;
  border-top: 1px solid var(--gris-claro);
}

.patrocinador-logo {
  height: 44px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity var(--transicion);
  filter: grayscale(30%);
}
.patrocinador-logo:hover { opacity: 1; filter: none; }

/* ── LOGIN / REGISTER ───────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--verde) 0%, var(--verde-hover) 100%);
}

.auth-card {
  background: white;
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo h1 {
  font-family: var(--fuente-display);
  color: var(--verde);
  font-size: 2rem;
  letter-spacing: 0.06em;
}

.auth-logo span { color: var(--tierra); }

.auth-logo p {
  color: var(--gris-texto);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ── ALERTAS ────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radio);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.alert-error   { background: #FFE8E8; color: #8b1a1a; border-left: 3px solid var(--rojo); }
.alert-success { background: #E8F8EF; color: #1a5c34; border-left: 3px solid var(--verde-claro); }
.alert-warning { background: #FFF8E8; color: #7a5000; border-left: 3px solid var(--amarillo); }
.alert-info    { background: #E8F0FF; color: #1a2e8a; border-left: 3px solid #4A7AFF; }

/* ── PISTAS LIBRES ──────────────────────────────────────── */
.pista-card {
  border-radius: var(--radio);
  border: 1.5px solid var(--gris-medio);
  padding: 1rem;
  background: white;
  transition: border-color var(--transicion), box-shadow var(--transicion);
}
.pista-card:hover { border-color: var(--verde-claro); box-shadow: var(--sombra); }

.pista-fecha {
  font-family: var(--fuente-display);
  font-size: 1.4rem;
  color: var(--verde);
  letter-spacing: 0.04em;
}

/* ── FOOTER ─────────────────────────────────────────────── */
footer {
  background: var(--verde-hover);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
  margin-top: 3rem;
}
footer a { color: var(--tierra-claro); }

/* ── RESPONSIVE ─────────────────────────────────────────── */
/* ── DRAWER LATERAL ─────────────────────────────────────── */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1040;
  background: rgba(0,0,0,0.45);
}
.drawer-overlay.open { display: block; }

.drawer {
  display: none;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1050;
  width: 270px;
  background: var(--verde-hover);
  flex-direction: column;
  overflow-y: auto;
}
.drawer.open {
  display: flex;
  animation: slideIn 0.28s cubic-bezier(.4,0,.2,1) both;
}
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--verde);
  color: white;
  font-family: var(--fuente-display);
  font-size: 1rem;
  flex-shrink: 0;
}
.drawer-close {
  background: none; border: none; color: white;
  font-size: 1.1rem; cursor: pointer; padding: 0.25rem 0.5rem;
  border-radius: 4px; line-height: 1;
}
.drawer-close:hover { background: rgba(255,255,255,0.15); }

.drawer-nav {
  display: flex; flex-direction: column;
  padding: 0.75rem 0;
}
.drawer-nav a {
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.drawer-nav a:hover { background: rgba(255,255,255,0.08); }
.drawer-nav a.activo {
  background: rgba(255,255,255,0.12);
  border-left-color: var(--tierra);
  color: white; font-weight: 700;
}
.drawer-separador {
  padding: 0.6rem 1.5rem 0.3rem;
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.4);
  margin-top: 0.5rem;
}

/* Hamburger animado a X */
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar-menu { display: none; }
  .navbar-brand .brand-full  { display: none; }
  .navbar-brand .brand-short { display: inline; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .auth-card { padding: 2rem 1.25rem; }

  .tabla-clasificacion { font-size: 0.82rem; }
  .tabla-clasificacion th,
  .tabla-clasificacion td { padding: 0.5rem 0.5rem; }

  .resultado-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 1rem 0.75rem; }
  .tabs { gap: 0.25rem; }
  .tab-btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
}


/* ── MARCADOR TENIS ─────────────────────────────────────── */
.marcador-tenis { display:flex; flex-direction:column; gap:2px; }
.marcador-sets-fila { display:flex; gap:3px; }
.set-box-tenis { width:22px; height:22px; border-radius:4px; background:var(--gris-claro); display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; color:var(--gris-texto); }
.set-box-tenis.ganado { background:var(--verde); color:white; }

/* ── PATROCINADOR PRINCIPAL ─────────────────────────────── */
.patrocinador-principal { height: 64px !important; }
