/* ===========================
   Copa de la Liga – Styles
   =========================== */

.copa-liga-hero {
  background:
    linear-gradient(135deg, rgba(5,5,20,0.85) 0%, rgba(79,195,247,0.5) 100%),
    url('../assets/images/icons/Copa%20de%20la%20Liga%20fondo.jpg') center/cover no-repeat;
  color: white;
  text-align: center;
  padding: 60px 20px;
  margin-top: 60px; /* offset navbar */
  border-bottom: 4px solid var(--border);
}

.copa-liga-hero h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.copa-liga-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.copa-liga-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.loading-state {
  text-align: center;
  padding: 40px;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.update-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
  font-weight: 500;
}

@media (max-width: 600px) {
  .update-note {
    font-size: 0.65rem;
    width: 100%;
    margin-top: -15px;
    margin-left: 28px;
  }
}

/* Grupos Grid (Lado Izquierdo) */
.grupos-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.fixture-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.fixture-controls {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  gap: 12px;
}

.fixture-group-selector .group-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

[data-theme="light"] .fixture-group-selector .group-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.fixture-group-selector .group-select:focus {
  border-color: var(--celeste);
}

.fixture-round-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 6px;
  border: 1px solid var(--border);
}

.round-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.round-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .round-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.round-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fixture-content {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Match Card */
.match-card {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}

[data-theme="light"] .match-card {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.match-card:last-child {
  border-bottom: none;
}

.match-card:hover {
  background: rgba(91, 156, 246, 0.05);
}

.match-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
  font-weight: 500;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr 65px 1fr;
  align-items: center;
  gap: 12px;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-team.home {
  justify-content: flex-end;
  text-align: right;
}

.match-team.away {
  justify-content: flex-start;
  text-align: left;
}

.match-team-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 400px) {
  .match-team-name {
    display: none; /* Hide names on very small screens, keep logos */
  }
}

.match-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
}

.match-score {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 12px;
  border-radius: 6px;
  min-width: 60px;
  text-align: center;
  white-space: nowrap;
}

[data-theme="light"] .match-score {
  background: rgba(0, 0, 0, 0.05);
}

.match-score.vs {
  font-size: 1rem;
  color: var(--text-muted);
  background: transparent;
}

/* Grupo Card */
.grupo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.grupo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.grupo-header {
  background: linear-gradient(135deg, rgba(79, 195, 247, 0.15) 0%, rgba(232, 64, 64, 0.05) 100%);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grupo-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Standings Table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.liga-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.liga-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.liga-table th:nth-child(1),
.liga-table th:nth-child(2) {
  text-align: left;
}

[data-theme="light"] .liga-table th {
  background: rgba(0, 0, 0, 0.03);
}

.liga-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  text-align: center;
  white-space: nowrap;
}

[data-theme="light"] .liga-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.liga-table td:nth-child(1),
.liga-table td:nth-child(2) {
  text-align: left;
}

.liga-table tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
  position: relative;
}

.liga-table tbody tr:hover {
  background: rgba(91, 156, 246, 0.08);
}

/* 1st Place Highlight */
.liga-table tbody tr.first-place {
  background: linear-gradient(90deg, rgba(79, 195, 247, 0.1) 0%, transparent 100%);
}

.liga-table tbody tr.first-place td:first-child {
  position: relative;
}

.liga-table tbody tr.first-place td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--celeste);
  box-shadow: 0 0 10px var(--celeste);
}

.liga-table tbody tr.first-place .team-name {
  color: var(--text-primary);
  font-weight: 700;
}

.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.first-place .pos-badge {
  background: var(--celeste);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 195, 247, 0.4);
}

.team-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.team-name {
  font-weight: 600;
  color: var(--text-primary);
}

.stat-pts {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1rem;
}

.stat-diff {
  font-weight: 600;
}

.diff-positive { color: #4ade80; }
.diff-negative { color: #f87171; }
.diff-zero { color: var(--text-muted); }

.grupo-body {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 0;
}

@media (max-width: 1024px) {
  .grupo-body {
    grid-template-columns: 1fr;
  }
  .fixture-widget {
    border-top: 1px solid var(--border);
    border-left: none;
  }
}

.fixture-widget {
  border-left: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.fixture-widget .widget-header {
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}



