/****************************************
 * TEMA GLOBAL
 ****************************************/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
  --color-primary: #00a86b; /* Verde profesional */
  --color-primary-dark: #008f5c;
  --color-bg: #0f2f1f; /* Verde oscuro elegante */
  --color-card-bg: #ffffff;
  --color-border: #e3e8ef;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0,0,0,0.15);
  --font-main: 'Inter', sans-serif;

  /* Colores por liga */
  --ligaA: #007acc;
  --ligaB: #d35400;

  /* Badges */
  --badge-win: #27ae60;
  --badge-lose: #c0392b;
  --badge-nj: #7f8c8d;
}

/****************************************
 * BASE
 ****************************************/
body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: #f2f2f2;
}

html {
  scroll-padding-top: 80px;
}

/****************************************
 * HEADER CON DEGRADADO
 ****************************************/
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: linear-gradient(90deg, #00a86b, #008f5c);
  color: white;
  z-index: 1000;
  box-shadow: var(--shadow);
  animation: fadeDown 0.5s ease;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 12px;
  justify-content: center;
  overflow-x: auto;
  white-space: nowrap;
}

nav li {
  margin: 0 18px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05em;
  transition: 0.2s;
}

nav a:hover {
  opacity: 0.8;
}

/****************************************
 * PANEL DE PATROCINADORES
 ****************************************/
#sponsors-bar {
  margin-top: 60px;
  background: #ffffff;
  padding: 12px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 35px;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  animation: fadeIn 0.6s ease;
}

#sponsors-bar img {
  height: 45px;
  opacity: 0.85;
  transition: 0.2s;
}

#sponsors-bar img:hover {
  opacity: 1;
  transform: scale(1.05);
}

/****************************************
 * SECCIONES
 ****************************************/
section {
  padding: 100px 20px 50px;
}

section h1 {
  color: #ffffff;
  font-size: 1.8em;
  margin-bottom: 10px;
}

/****************************************
 * TARJETAS
 ****************************************/
.card {
  background: var(--color-card-bg);
  padding: 18px;
  margin: 12px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  transition: 0.25s ease;
  color: #333;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/****************************************
 * BOTONES
 ****************************************/
button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

button:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/****************************************
 * BADGES DE RESULTADOS
 ****************************************/
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8em;
  font-weight: 600;
  color: white;
}

.badge-win { background: var(--badge-win); }
.badge-lose { background: var(--badge-lose); }
.badge-nj { background: var(--badge-nj); }

/****************************************
 * COLORES POR LIGA
 ****************************************/
.ligaA {
  border-left: 6px solid var(--ligaA);
}

.ligaB {
  border-left: 6px solid var(--ligaB);
}

/****************************************
 * TABLAS
 ****************************************/
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 12px;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 600px;
  color: #333;
}

th {
  background: var(--color-primary);
  color: white;
  padding: 10px;
  font-weight: 600;
}

td {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
}

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

/****************************************
 * TABLAS MINI
 ****************************************/
.tabla-partidos-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.tabla-partidos-mini th {
  background: var(--color-primary);
  color: white;
  padding: 6px;
}

.tabla-partidos-mini td {
  border: 1px solid var(--color-border);
  padding: 6px;
  background: #fafafa;
}

/****************************************
 * MODAL
 ****************************************/
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 5vh auto;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
}

/****************************************
 * SETS Y RESULTADOS
 ****************************************/
.set-row input[type="number"] {
  width: 55px;
  font-size: 1em;
  padding: 6px;
  margin: 0 6px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.pareja-block {
  background: white;
  padding: 14px;
  margin-bottom: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: #333;
}

.set-win {
  background: #d4f8d4;
  border: 1px solid #4CAF50;
}

.set-lose {
  background: #f8d4d4;
  border: 1px solid #f44336;
}

/****************************************
 * DETALLES
 ****************************************/
.detalle-toggle {
  margin-top: 8px;
  font-size: 0.9em;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
}

.detalle-partidos {
  display: none;
  margin-top: 10px;
}

.detalle-partidos.open {
  display: block;
}

/****************************************
 * RESPONSIVE
 ****************************************/
@media (max-width: 480px) {
  .card { font-size: 0.9em; }
  #sponsors-bar img { height: 35px; }
}
/****************************************
 * REGLAS – VER MÁS / VER MENOS
 ****************************************/
#reglas-content {
  transition: max-height 0.4s ease;
  overflow: hidden;
}

#reglas-content.expandido {
  /* cuando está expandido, dejamos que crezca */
  max-height: 5000px;
}

.toggle-btn {
  margin-top: 15px;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.toggle-btn:hover {
  background: var(--color-primary-dark);
}
/****************************************
 * TABLAS POR LIGA – TOQUE DE COLOR SIMPLE
 ****************************************/

/* Encabezado Liga A */
table.tabla-ligaA tr:first-child th {
  background: rgba(0, 122, 204, 0.20);
  color: #004a80;
  border-bottom: 2px solid var(--ligaA);
}

/* Encabezado Liga B */
table.tabla-ligaB tr:first-child th {
  background: rgba(211, 84, 0, 0.20);
  color: #7a3a00;
  border-bottom: 2px solid var(--ligaB);
}

/* Borde lateral nombre equipo */
table.tabla-ligaA tr td:first-child {
  border-left: 5px solid var(--ligaA);
}

table.tabla-ligaB tr td:first-child {
  border-left: 5px solid var(--ligaB);
}

/* Hover */
table.tabla-ligaA tr:hover td {
  background: rgba(0, 122, 204, 0.08);
}

table.tabla-ligaB tr:hover td {
  background: rgba(211, 84, 0, 0.08);
}

/* Título */
#tabla-ligaA h2 {
  color: var(--ligaA);
  border-left: 6px solid var(--ligaA);
  padding-left: 10px;
}

#tabla-ligaB h2 {
  color: var(--ligaB);
  border-left: 6px solid var(--ligaB);
  padding-left: 10px;
}
