/* ============================================================
   TST Calendario v6.5 — Inspiración ATP, estética Todo Sobre Tenis
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
.tst-cal {
  --bg        : #f5f5f0;
  --white     : #ffffff;
  --navy      : #0d1b2e;
  --navy-mid  : #1e3a5f;
  --accent    : #1565c0;
  --border    : #e2e6ec;
  --border-dark: #c8cdd7;
  --text      : #1a2332;
  --muted     : #64748b;
  --dim       : #94a3b8;
  --radius    : 8px;
  --sh        : 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh-hover  : 0 8px 24px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);

  font-family : inherit;
  color       : var(--text);
  max-width   : 100%;
}

/* ── Encabezado ─────────────────────────────────────────────── */
.tst-cal__head { margin-bottom: 28px; }

.tst-cal__circ {
  font-size: .7rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 2px;
}

.tst-cal__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900;
  color: var(--navy); margin: 0 0 4px; line-height: 1.05;
  letter-spacing: -.02em;
}

.tst-cal__sub { font-size: .85rem; color: var(--muted); margin: 0; }

/* ── Barra de filtros ───────────────────────────────────────── */
.tst-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 32px; flex-wrap: wrap;
}

/* ── Dropdowns ──────────────────────────────────────────────── */
.tst-dd { position: relative; }

.tst-dd__btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 6px; padding: 9px 14px;
  font-size: .84rem; font-weight: 600; color: var(--text);
  cursor: pointer; white-space: nowrap; font-family: inherit;
  box-shadow: var(--sh); transition: border-color .15s, box-shadow .15s, background .15s;
  line-height: 1;
}
.tst-dd__btn:hover {
  border-color: var(--border-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.tst-dd__btn.is-active {
  border-color: var(--navy); background: var(--navy); color: #fff;
}
.tst-dd__arr { transition: transform .2s; flex-shrink: 0; }
.tst-dd__btn[aria-expanded="true"] .tst-dd__arr { transform: rotate(180deg); }

.tst-dd__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 10px; box-shadow: var(--sh-hover);
  min-width: 220px; padding: 5px;
  animation: tst-pop .15s ease;
}

.tst-dd__opt {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 10px 12px; border: none;
  background: transparent; border-radius: 6px;
  font-size: .84rem; color: var(--text); cursor: pointer;
  font-family: inherit; text-align: left; transition: background .1s;
}
.tst-dd__opt:hover { background: #f1f5f9; }
.tst-dd__opt.is-sel { font-weight: 700; color: var(--navy); }

.tst-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.tst-check {
  margin-left: auto; flex-shrink: 0;
  opacity: 0; color: var(--accent); transition: opacity .1s;
}
.tst-dd__opt.is-sel .tst-check { opacity: 1; }

/* Filtros activos */
.tst-active-tag {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: #e8f0fe;
  border-radius: 6px; font-size: .8rem;
}
.tst-active-tag__text { color: var(--navy); font-weight: 600; }
.tst-active-tag__clear {
  background: none; border: none; color: var(--accent); font-weight: 700;
  cursor: pointer; font-size: .78rem; font-family: inherit; padding: 0;
}
.tst-active-tag__clear:hover { text-decoration: underline; }

/* ── Notice ─────────────────────────────────────────────────── */
.tst-notice {
  padding: 10px 14px; background: #e8f0fe; border-left: 3px solid var(--accent);
  border-radius: 6px; font-size: .83rem; color: var(--navy); margin-bottom: 16px;
}
.tst-notice[data-type="error"] { background: #fce8e6; border-color: #d32f2f; color: #b71c1c; }

/* ── Timeline ────────────────────────────────────────────────── */
.tst-timeline { display: flex; flex-direction: column; gap: 40px; }

/* ── Bloque mes ─────────────────────────────────────────────── */
.tst-month__hd {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}

.tst-month__name {
  font-size: .75rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0;
}

.tst-month__n {
  font-size: .72rem; color: var(--dim);
  background: #f1f5f9; padding: 2px 7px; border-radius: 999px;
}

/* ── Lista ───────────────────────────────────────────────────── */
.tst-list {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--white);
  box-shadow: var(--sh);
}

/* ── Fila torneo ─────────────────────────────────────────────── */
.tst-row {
  display: flex; align-items: center;
  background: var(--white); text-decoration: none; color: inherit;
  padding: 0; min-height: 72px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  position: relative;
  overflow: hidden;
}
.tst-row:last-child { border-bottom: none; }
.tst-row:hover { background: #f8fafd; }

/* Barra de color lateral */
.tst-row__bar {
  width: 4px; min-height: 72px; align-self: stretch;
  flex-shrink: 0; background: var(--bar, var(--dim));
}

/* Logo */
.tst-row__logo {
  flex-shrink: 0; width: 68px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.tst-row__img {
  width: 44px; height: 44px; object-fit: contain;
  border-radius: 6px;
}
.tst-row__logo-placeholder {
  width: 44px; height: 44px; display: flex;
  align-items: center; justify-content: center;
  font-size: 1.4rem; background: #f1f5f9; border-radius: 6px;
}

/* Body */
.tst-row__body { flex: 1; min-width: 0; padding: 14px 8px 14px 4px; }

.tst-row__top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}

.tst-row__name {
  font-size: .97rem; font-weight: 700; color: var(--navy);
  line-height: 1.2;
}

/* EN VIVO badge */
.tst-live {
  flex-shrink: 0; font-size: .58rem; font-weight: 800; letter-spacing: .12em;
  background: #ef4444; color: #fff; padding: 2px 6px; border-radius: 3px;
  animation: tst-blink 1.4s ease infinite;
}

/* Meta línea */
.tst-row__meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0 5px; font-size: .76rem; color: var(--muted);
  line-height: 1.4;
}
.tst-row__sep { color: var(--dim); }
.tst-row__city { display: inline-flex; align-items: center; gap: 3px; }
.tst-row__city svg { opacity: .6; flex-shrink: 0; }
.tst-row__dates { font-weight: 500; color: var(--text); }

/* Superficie */
.tst-row__surf { font-weight: 600; font-size: .73rem; }
.tst-row__surf--hard   { color: #1565c0; }
.tst-row__surf--clay   { color: #c2410c; }
.tst-row__surf--grass  { color: #16a34a; }
.tst-row__surf--indoor { color: #7c3aed; }

.tst-row__pts { font-size: .72rem; color: var(--muted); }

/* Campeón */
.tst-row__champ {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; font-size: .75rem; font-weight: 600; color: #92680a;
}

/* Lado derecho: nivel + flecha */
.tst-row__side {
  flex-shrink: 0; padding: 0 14px 0 8px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}

.tst-row__lvl {
  font-size: .6rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap;
  padding: 2px 6px; border-radius: 3px;
}
.tst-row__lvl--gs   { background: #dbeafe; color: #1e40af; }
.tst-row__lvl--ms   { background: #dcfce7; color: #14532d; }
.tst-row__lvl--500  { background: #f3e8ff; color: #5b21b6; }
.tst-row__lvl--spec { background: #ffedd5; color: #9a3412; }
.tst-row__lvl--chal { background: #f1f5f9; color: #475569; }
.tst-row__lvl--250  { background: #f1f5f9; color: #64748b; }
.tst-row__lvl--itf  { background: #f1f5f9; color: #94a3b8; }

.tst-row__arr {
  color: var(--dim); transition: transform .15s, color .15s;
}
.tst-row:hover .tst-row__arr { transform: translateX(3px); color: var(--accent); }

/* Torneo en curso: highlight sutil */
.tst-row--inprogress { background: #fafffe; }

/* ── Empty ──────────────────────────────────────────────────── */
.tst-empty {
  padding: 40px 20px; text-align: center; color: var(--muted);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem;
}

/* ── Animaciones ─────────────────────────────────────────────── */
@keyframes tst-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tst-blink { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ── Responsive Mobile ──────────────────────────────────────── */
@media (max-width: 560px) {
  .tst-row__logo  { width: 54px; }
  .tst-row__img, .tst-row__logo-placeholder { width: 36px; height: 36px; }
  .tst-row__name  { font-size: .9rem; }
  .tst-row__meta  { font-size: .71rem; }
  .tst-row__side  { padding: 0 10px; }
  .tst-row__lvl   { display: none; } /* ocultar en mobile para ahorrar espacio */
  .tst-cal__title { font-size: 1.8rem; }
  .tst-dd__btn    { padding: 8px 11px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tst-row,.tst-dd__btn,.tst-row__arr { transition: none; }
  .tst-live { animation: none; }
}
