/* ==================== HEADER DEL TORNEO ==================== */
.tournament-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
  border-radius: 16px;
  padding: 0;
  margin-bottom: 32px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(2, 86, 122, 0.3);
  position: relative;
}

.tournament-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.03)"/></svg>');
  opacity: 0.5;
}

.tournament-header-content {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  position: relative;
  z-index: 1;
}

.tournament-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.tournament-details h1 {
  color: white;
  font-size: 2.2rem;
  margin: 0 0 12px 0;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tournament-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  font-weight: 500;
}

.meta-item i {
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== ESTADÍSTICAS DESTACADAS ==================== */
.stats-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-box {
  background: linear-gradient(145deg, var(--card-bg), var(--card-secondary));
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.stat-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(2, 86, 122, 0.15);
  border-color: var(--primary-blue);
}

.stat-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  color: var(--text-gray);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: var(--text-light);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

/* ==================== TABS DE NAVEGACIÓN ==================== */
.tabs-container {
  margin-bottom: 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-dark);
  padding: 16px 0;
}

.tabs {
  display: flex;
  gap: 12px;
  background: var(--card-bg);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
  height: 6px;
}

.tabs::-webkit-scrollbar-thumb {
  background: var(--primary-blue);
  border-radius: 3px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-gray);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab i {
  font-size: 1.1rem;
}

.tab:hover:not(.active) {
  background: var(--card-secondary);
  color: var(--text-light);
}

.tab.active {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: white;
  box-shadow: 0 4px 12px rgba(2, 86, 122, 0.3);
}

/* ==================== CONTENIDO DE TABS ==================== */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-card {
  background: linear-gradient(145deg, var(--card-bg), var(--card-secondary));
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(2, 86, 122, 0.03);
}

.card-header h2,
.card-header h3 {
  color: var(--text-light);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header i {
  color: var(--primary-blue);
}

/* ==================== TABLA DE POSICIONES ==================== */
.table-responsive {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table thead {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
}

.standings-table th {
  color: white;
  padding: 16px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.standings-table td {
  padding: 16px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-light);
  font-weight: 500;
}

.standings-table tbody tr {
  transition: all 0.2s ease;
}

.standings-table tbody tr:hover {
  background: rgba(2, 86, 122, 0.08);
}

.pos-col {
  width: 60px;
  font-weight: 700;
}

.team-col {
  text-align: left !important;
  min-width: 200px;
}

.pts-col {
  font-size: 1.1rem;
  color: var(--primary-blue);
}

.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--card-secondary);
  border-radius: 8px;
  font-weight: 700;
}

.pos-champion .position-badge {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
}

.pos-qualify .position-badge {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: white;
}

.team-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-name {
  font-weight: 600;
  font-size: 1rem;
}

.wins {
  color: #10b981;
  font-weight: 600;
}

.draws {
  color: #f59e0b;
  font-weight: 600;
}

.losses {
  color: #ef4444;
  font-weight: 600;
}

.positive {
  color: #10b981;
  font-weight: 700;
}

.negative {
  color: #ef4444;
  font-weight: 700;
}

/* ==================== LISTA DE PARTIDOS ==================== */
.matches-list {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.match-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.match-card:hover {
  transform: translateX(4px);
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(2, 86, 122, 0.1);
}

.match-card.upcoming {
  border-left: 4px solid var(--primary-blue);
}

.match-card.finished {
  border-left: 4px solid #10b981;
}

.match-date {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.match-time {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 86, 122, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
}

.match-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}

.team {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team.home-team {
  justify-content: flex-start;
}

.team.away-team {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.team-name {
  color: var(--text-light);
  font-weight: 600;
  font-size: 1.1rem;
}

.team-score {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  background: rgba(2, 86, 122, 0.1);
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
}

.team-score.winner {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.match-vs {
  color: var(--text-gray);
  font-weight: 700;
  font-size: 0.9rem;
}

.match-separator {
  color: var(--text-gray);
  font-size: 1.2rem;
  font-weight: 700;
}

.match-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  transform: translateY(-2px);
}

.btn-action.primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: white;
  border: none;
}

.btn-action.primary:hover {
  box-shadow: 0 4px 12px rgba(2, 86, 122, 0.3);
}

.btn-action.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-action.warning:hover {
  background: #f59e0b;
  color: white;
}

.btn-action.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-action.danger:hover {
  background: #ef4444;
  color: white;
}

/* ==================== ESTADO VACÍO ==================== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-gray);
}

.empty-state i {
  font-size: 4rem;
  color: var(--primary-blue);
  opacity: 0.5;
  margin-bottom: 24px;
}

.empty-state h3 {
  color: var(--text-light);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.empty-state p {
  margin-bottom: 24px;
  font-size: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 86, 122, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--card-secondary);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--card-bg);
  border-color: var(--primary-blue);
}

/* ==================== ESTADÍSTICAS ==================== */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.stats-list {
  padding: 24px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row .stat-label {
  color: var(--text-light);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-row .stat-number {
  color: var(--primary-blue);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: white;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ==================== MODALES ==================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  color: var(--text-light);
  font-size: 1.3rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-gray);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.modal-body {
  padding: 24px;
}

.result-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.team-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-result label {
  color: var(--text-gray);
  font-size: 0.9rem;
  font-weight: 600;
}

.team-result input[type="number"] {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-secondary);
  color: var(--text-light);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s ease;
}

.team-result input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(2, 86, 122, 0.1);
}

.result-separator {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-gray);
  padding-bottom: 12px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--text-gray);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group input[type="date"],
.form-group input[type="time"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-secondary);
  color: var(--text-light);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(2, 86, 122, 0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ==================== NOTIFICACIONES ==================== */
.notification {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  color: var(--text-light);
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: all 0.4s ease;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.notification.show {
  top: 24px;
}

.notification.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-color: #10b981;
}

.notification.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-color: #ef4444;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .tournament-header-content {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .tournament-details h1 {
    font-size: 1.8rem;
  }

  .tournament-meta {
    justify-content: center;
    gap: 16px;
  }

  .stats-highlight {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-box {
    flex-direction: column;
    text-align: center;
  }

  .tabs {
    padding: 6px;
  }

  .tab {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .tab span {
    display: none;
  }

  .tab i {
    font-size: 1.2rem;
  }

  .standings-table {
    font-size: 0.85rem;
  }

  .standings-table th,
  .standings-table td {
    padding: 12px 8px;
  }

  .match-content {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .team {
    justify-content: center !important;
    flex-direction: row !important;
  }

  .match-vs,
  .match-separator {
    display: none;
  }

  .match-actions {
    justify-content: center;
  }

  .result-inputs {
    grid-template-columns: 1fr;
  }

  .result-separator {
    display: none;
  }

  .modal-content {
    width: 95%;
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .stats-highlight {
    grid-template-columns: 1fr;
  }

  .tournament-details h1 {
    font-size: 1.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .match-card {
    padding: 16px;
  }

  .team-name {
    font-size: 1rem;
  }

  .team-score {
    min-width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .btn-action {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}