/* ==================== AGENDA CSS - VERSIÓN OPTIMIZADA ==================== */
/* Sistema de diseño con variables CSS */
:root {
  /* Variables de optimización */
  --agenda-transition: 0.2s ease;
  
  /* Variables de espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.2rem;
  --spacing-lg: 0.2rem;
  --spacing-xl: 2rem;
  
  /* Variables de colores semánticos */
  --color-primary: rgba(114, 214, 255, 1);
  --color-primary-rgb: 114, 214, 255;
  --color-secondary: rgba(255, 127, 255, 1);
  --color-secondary-rgb: 255, 127, 255;
  --color-danger: #ff4757;
  --color-success: #2ed573;
  
  /* Variables de transparencia */
  --alpha-10: 0.1;
  --alpha-20: 0.2;
  --alpha-30: 0.3;
  --alpha-50: 0.5;
  --alpha-70: 0.7;
  
  /* Variables de elevación simplificadas */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
  
  /* Variables tipográficas */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  
  /* Variables de borde */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-full: 9999px;
  
  --text-primary: #ffffff;
  --text-secondary: #72d6ff;
  --accent: #72d6ff;
  --accent-purple: #ff7fff;
  --radius: 12px;
}

/* Adaptación para dispositivos móviles */
@media (hover: none) and (pointer: coarse) {
  :root {
    --agenda-transition: 0.2s ease;
  }
}

/* ==================== RESET Y ESTILOS BASE ==================== */
.container-agenda *,
.container-agenda *::before,
.container-agenda *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.container-agenda {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.container-agenda {
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

/* ==================== BANNER DEL DÍA ==================== */
.day-banner {
  background: linear-gradient(
    135deg,
    rgba(var(--color-primary-rgb), var(--alpha-20)) 0%,
    rgba(var(--color-secondary-rgb), var(--alpha-20)) 100%
  );
  padding: 1.2rem clamp(1rem, 3vw, 1.5rem);
  text-align: center;
  font-size: clamp(var(--font-size-md), 2vw, var(--font-size-xl));
  font-weight: 700;
  color: var(--text-primary);
}

/* Línea decorativa inferior */
.day-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(60%, 200px);
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary),
    transparent
  );
  border-radius: 1px;
}

/* ==================== Contenedor de Agenda ==================== */
.agenda {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.agenda.compact {
  gap: var(--spacing-xs);
}

.matches {
  display: flex;
  flex-direction: column;
}

/* ==================== Estilos para el Acordeón ==================== */
.match-card {
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
    border: 1px solid #1550b63d !important;
-webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--agenda-transition);
}

/* Reorganizar el header para espacio del logo */
.match-header {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  transition: background-color var(--agenda-transition);
  position: relative;
  z-index: 1;
}

/* Icono de expansión */
.expand-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--agenda-transition);
  opacity: 0.6;
  color: var(--text-secondary);
  border-radius: var(--border-radius-full);
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

/* Dropdown del acordeón */
.dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--agenda-transition) ease;
  background: rgba(10, 12, 25, 0.5);
}

.dropdown:not(.hidden) {
  max-height: 400px;
}

.hidden {
  display: none;
}

/* Badge de opciones disponibles */
.sources-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 8px;
}

/* Menu de canales en acordeón */
.channel-menu {
  list-style: none;
  margin: 0;
}

.channel-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--agenda-transition) ease;
  border-left: 3px solid transparent;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.channel-item .left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Icono de play */
.play-icon {
  width: 20px;
  height: 20px;
  background: #667eea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  transition: all var(--agenda-transition) ease;
}

.play-icon::before {
  content: '▶';
}

/* ==================== Estados Móviles ==================== */
@media (hover: none) and (pointer: coarse) {
  .match-card:active {
    transform: scale(0.98);
  }

  .match-header:active {
    background: rgba(20, 20, 40, 0.9);
  }

  .channel-item:active {
    background: rgba(114, 214, 255, 0.2);
    transform: scale(0.98);
    border-left-color: #667eea;
  }
}

/* ==================== Estados Hover (Solo PC) ==================== */
@media (hover: hover) and (pointer: fine) {
  .match-header:hover {
        background: rgb(20 102 195 / 8%);
  }

  .match-card:hover .teams {
    color: var(--accent);
  }

  .channel-item:hover {
    background: rgba(58, 20, 195, 0.06);
    border-left-color: #667eea;
  }

  .channel-item:hover .play-icon {
    background: rgba(114, 214, 255, 0.06);
  }

  .channel-item:hover .play-icon::before {
    color: var(--accent-purple);
  }
}

/* ==================== Columna de Tiempo ==================== */
.time-col {
  flex-shrink: 0;
}

.time-badge {
  color: var(--accent);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  transition: all var(--agenda-transition) ease;
}

/* ==================== Contenido Principal del Partido ==================== */
.match-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.teams {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.meta span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==================== Competencia ==================== */
.competition {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(114, 214, 255, 0.08);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(114, 214, 255, 0.15);
  transition: all var(--agenda-transition);
}

.competition img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

/* ==================== Estados de Mensajes ==================== */
.no-events {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  background: rgba(114, 214, 255, 0.05);
}

.loading {
  background: rgba(20, 20, 40, 0.6);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
  .day-banner {
    font-size: 1.15rem;
    padding: 1rem 1.2rem;
  }

  .match-header {
    padding: 0.875rem 1rem;
    gap: 0.875rem;
  }

  .teams {
    font-size: 1rem;
  }

  .meta {
    gap: 0.6rem;
  }

  .channel-item {
    padding: 10px 16px;
  }
}

@media (max-width: 640px) {
  .match-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .time-col {
    width: 100%;
  }

  .match-main {
    width: 100%;
  }

  .expand-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
  }
}

@media (max-width: 480px) {
  .container-agenda {
    padding: 0px;
  }

  .day-banner {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .match-header {
    padding: 0.75rem 0.875rem;
  }

  .teams {
    font-size: 0.95rem;
  }

  .meta {
    gap: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .meta span {
    font-size: 0.8rem;
  }

  .competition {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
  }

  .channel-item {
    padding: 8px 14px;
  }

  .no-events {
    padding: 2rem 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  .container-agenda {
  }

  .day-banner {
    font-size: 0.9rem;
    padding: 0.75rem 0.875rem;
  }

  .match-header {
    padding: 0.625rem 0.75rem;
  }

  .channel-item {
    padding: 6px 12px;
  }
}

/* ==================== Accesibilidad ==================== */
.match-header:focus-visible,
.channel-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==================== Preferencias de Movimiento Reducido ==================== */
@media (prefers-reduced-motion: reduce) {
  .match-card,
  .dropdown,
  .play-icon,
  .competition,
  .channel-item,
  .expand-icon {
    transition: none !important;
  }

  .dropdown:not(.hidden) {
    max-height: none;
  }
}

/* ==================== Alto Contraste ==================== */
@media (prefers-contrast: high) {
  .match-card {
    border: 2px solid var(--accent);
  }

  .channel-item {
    border-left: 3px solid var(--accent);
  }

  .sources-badge {
    background: var(--accent);
    color: var(--bg-dark);
  }
}

/* ==================== Optimización Android Específica ==================== */
@media (hover: none) and (pointer: coarse) {
  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .match-card,
  .teams,
  .competition,
  .channel-item,
  .play-icon,
  .dropdown {
    transition: transform var(--agenda-transition) ease;
  }

  @supports not (backdrop-filter: blur(4px)) {
    .day-banner,
    .match-card,
    .no-events {
      background: rgba(20, 20, 40, 0.95);
    }
  }
}

/* ==================== Filtros y Búsqueda ==================== */
.agenda-controls {
  display: flex;
  flex-wrap: wrap;
}

.search-container {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-container input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: rgba(243, 243, 243, 0);
  border: 0px solid #1550b63d;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--agenda-transition);
}

.search-container input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-container::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='9' r='5.5'/%3E%3Cline x1='13.5' y1='13.5' x2='18' y2='18'/%3E%3C/svg%3E");
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  width: 16px;
  height: 16px;
  display: block;
  line-height: 0;
}

.agenda-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: rgba(20, 20, 40, 0);
  border: 1px solid rgba(114, 214, 255, 0.2);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn:hover {
  background: rgba(114, 214, 255, 0.1);
  color: var(--text-primary);
}

.filter-btn.active {
  background: linear-gradient(135deg, #4A148C, #311B92, #1A237E);
  color: #D1C4E9;
  border-color: transparent;
}

.filter-btn::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  flex-shrink: 0;
}

.filter-btn[data-filter="all"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='7' height='7'/%3E%3Crect x='11' y='2' width='7' height='7'/%3E%3Crect x='2' y='11' width='7' height='7'/%3E%3Crect x='11' y='11' width='7' height='7'/%3E%3C/svg%3E");
}

.filter-btn[data-filter="live"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 10 Q5 4 10 4 Q15 4 18 10'/%3E%3Cpath d='M5 13 Q7 9 10 9 Q13 9 15 13'/%3E%3Ccircle cx='10' cy='16' r='1.5' fill='%23ffffff'/%3E%3C/svg%3E");
}

.filter-btn[data-filter="football"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='8'/%3E%3Cpolygon points='10,6 12.5,8.5 11.5,11.5 8.5,11.5 7.5,8.5' fill='%23ffffff' stroke='%23ffffff' stroke-width='0.5'/%3E%3Cline x1='10' y1='6' x2='10' y2='2'/%3E%3Cline x1='12.5' y1='8.5' x2='16' y2='7'/%3E%3Cline x1='11.5' y1='11.5' x2='14.5' y2='14'/%3E%3Cline x1='8.5' y1='11.5' x2='5.5' y2='14'/%3E%3Cline x1='7.5' y1='8.5' x2='4' y2='7'/%3E%3C/svg%3E");
}

.filter-btn[data-filter="f1"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='2' x2='4' y2='18'/%3E%3Crect x='4' y='2' width='3' height='3' fill='%23ffffff'/%3E%3Crect x='7' y='2' width='3' height='3' fill='none'/%3E%3Crect x='10' y='2' width='3' height='3' fill='%23ffffff'/%3E%3Crect x='4' y='5' width='3' height='3' fill='none'/%3E%3Crect x='7' y='5' width='3' height='3' fill='%23ffffff'/%3E%3Crect x='10' y='5' width='3' height='3' fill='none'/%3E%3Crect x='4' y='8' width='3' height='3' fill='%23ffffff'/%3E%3Crect x='7' y='8' width='3' height='3' fill='none'/%3E%3Crect x='10' y='8' width='3' height='3' fill='%23ffffff'/%3E%3C/svg%3E");
}

/* ==================== Indicadores de Estado ==================== */
.match-card.live {
  border-left: 4px solid #ff4757;
}

.match-card.upcoming {
  border-left: 4px solid var(--accent);
}

.live-indicator {
  display: inline-block;
  background: #ff4757;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 8px;
}

/* ==================== Estados de Carga/Error ==================== */
.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(114, 214, 255, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  text-align: center;
  padding: 3rem 1rem;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  border-radius: var(--radius);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.retry-btn {
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  border: none;
  border-radius: var(--radius);
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

/* ==================== Estados Vacíos ==================== */
.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ==================== Contador ==================== */
.events-counter {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* ==================== LOGOS DE COMPETICIÓN ==================== */
.time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.competition-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 26px;
  transition: all 0.3s ease;
}

.competition-name {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.25rem;
  opacity: 0.9;
}

/* Responsive logos */
@media (max-width: 768px) {
  .competition-logo {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 640px) {
  .time-col {
    flex-direction: row;
    gap: 8px;
  }
  
  .competition-logo {
    width: 55px;
    height: 55px;
  }
}

/* ==================== OPTIMIZACIONES MÓVIL ==================== */
@media (max-width: 768px) {
  .day-banner {
    font-size: 18px !important;
    padding: 16px 12px !important;
    text-align: center;
  }

  .match-header {
    padding: 14px 12px !important;
    flex-direction: column !important;
  }

  .time-col {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .match-main {
    width: 100% !important;
    gap: 8px !important;
  }

  .teams {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
  }

  .meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .meta span {
    font-size: 14px !important;
    padding: 4px 8px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 6px !important;
  }

  .competition {
    padding: 6px 10px !important;
    border-radius: 18px !important;
    font-size: 14px !important;
    background: rgba(114, 214, 255, 0.1) !important;
  }

  .expand-icon {
    position: absolute !important;
    right: 12px !important;
    top: 22px !important;
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .dropdown {
    border-top: 1px solid rgba(114, 214, 255, 0.1) !important;
  }

  .channel-item {
    padding: 14px 16px !important;
    min-height: 48px !important;
    border-left: 3px solid transparent !important;
    font-size: 14px !important;
  }

  .play-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
  }

  .agenda-controls {
    flex-direction: column;
  }
  
  .search-container {
    min-width: 100%;
  }
  
  .agenda-filters {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ==================== VISTA MUY PEQUEÑA ==================== */
@media (max-width: 375px) {
  .container-agenda {
  }

  .day-banner {
    font-size: 16px !important;
    padding: 14px 10px !important;
  }

  .match-header {
    padding: 12px 10px !important;
  }

  .teams {
    font-size: 15px !important;
  }

  .expand-icon {
    width: 28px !important;
    height: 28px !important;
    right: 10px !important;
    top: 19px !important;
  }

  .channel-item {
    padding: 12px 14px !important;
  }
}

/* ==================== MEJORAS DE LEGIBILIDAD MÓVIL ==================== */
@media (hover: none) and (pointer: coarse) {
  .teams {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
  }

  .match-header:active {
    background: rgba(114, 214, 255, 0.08) !important;
  }

  .channel-item:active {
    background: rgba(114, 214, 255, 0.15) !important;
    border-left-color: rgba(114, 214, 255, 0.5) !important;
  }
}

/* ==================== SIMPLIFICAR EFECTOS EN MÓVIL ==================== */
@media (max-width: 768px) {
  .match-card:hover .time-badge,
  .match-card:hover .teams,
  .channel-item:hover {
    transform: none !important;
  }

  .match-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }
}

/* ==================== AJUSTES HORIZONTALES (Tablets) ==================== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .match-header {
    flex-direction: row !important;
    align-items: center !important;
  }

  .time-col {
    width: auto !important;
    margin-bottom: 0 !important;
  }

  .match-main {
    flex: 1 !important;
  }
}

/* ==================== Variables base ==================== */
:root {
  --header-bg: transparent;
}

/* ==================== Fondo personalizado ==================== */
body {
  background-image: url("fondos/fondo1.png") !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
}