/* Vista Calendario (HOME). Solo estilos propios de esta vista; los componentes
   compartidos viven en components.css. Mobile-first. */

.calendar-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== Encabezado ===== */
.calendar-view__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calendar-view__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.calendar-view__subtitle {
  font-size: 0.85rem;
  color: var(--ink-3);
  margin: 0;
}

/* ===== Controles ===== */
.calendar-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 6px 0 10px;
}

/* Chips de fecha (scroll horizontal en móvil) */
.date-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}
.date-chips::-webkit-scrollbar { display: none; }
.date-chip {
  flex: none;
  scroll-snap-align: start;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
@media (hover: hover) {
  .date-chip:hover { color: var(--ink); border-color: var(--brand-1); }
}
.date-chip:active { transform: scale(0.97); }
.date-chip.is-active {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* Filtros (estado / grupo / selección) */
.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 130px;
}
.filter-field--team { flex: 1 1 100%; }
.filter-field__label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding-left: 2px;
}
.filter-field__select,
.filter-field__input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.filter-field__select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) center,
    calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  cursor: pointer;
}
.filter-field__select:focus-visible,
.filter-field__input:focus-visible {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.filter-field__input::placeholder { color: var(--ink-3); }

/* ===== Cuerpo: grupos por día ===== */
.calendar-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.calendar-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calendar-group__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.calendar-group__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.calendar-group__date {
  font-size: 0.78rem;
  color: var(--ink-3);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-group__count {
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--surface-sunk);
  border-radius: var(--r-pill);
  padding: 2px 9px;
  margin-left: auto;
  flex: none;
}

/* Grid de partidos: 1 col móvil, más columnas en pantallas grandes */
.calendar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ===== Sección EN VIVO (fijada arriba, resaltada) ===== */
.calendar-group--live .calendar-group__head--live {
  align-items: center;
}
.calendar-group__head--live .calendar-group__title { color: var(--live); }
.calendar-group__live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
  animation: live-pulse 1.4s var(--ease) infinite;
}
.calendar-group--live .calendar-group__count {
  background: var(--live-soft);
  color: var(--live);
}

/* Tarjeta de partido en vivo: borde y halo de acento */
.calendar-grid .match-card.is-live {
  border-color: var(--live);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--live) inset;
}

/* ===== Animación de entrada de la vista ===== */
.view-enter {
  animation: cal-fade-in var(--t) var(--ease) both;
}
@keyframes cal-fade-in {
  from { opacity: 0; transform: translateY(6px) scale(0.995); }
  to   { opacity: 1; transform: none; }
}

/* ===== Responsive: más columnas en tablet/escritorio ===== */
@media (min-width: 680px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1040px) {
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filter-field--team { flex: 1 1 200px; }
}

/* ===== prefers-reduced-motion: apaga movimiento ===== */
@media (prefers-reduced-motion: reduce) {
  .view-enter { animation: none; }
  .calendar-group__live-dot { animation: none; }
  .date-chip,
  .filter-field__select,
  .filter-field__input { transition: none; }
  .date-chip:active { transform: none; }
}
