/* ============================================================
   BigSports Design System — Reusable Components
   ------------------------------------------------------------
   Эта таблица — карта переиспользуемых стилей.
   Когда нужно собрать новый экран, заглядывай сюда.
   Page-specific стили (Reports layout, scout cards, WP admin)
   живут в styles.css.
   ============================================================

   ── CSS-токены и переменные ───── styles.css :root
       --accent #1e3a5f         (основной navy)
       --accent-hover #2d5a8e   (hover)
       --accent-light #3a7bc8   (links, focus)
       --bg-page #f0f2f7        (фон страницы)
       --green / --red          (статусы)
       --radius / --radius-lg / --radius-sm

   ── Кнопки ───────────────────── styles.css .btn / .btn-primary / .btn-accent / .btn-ghost
       размеры: .btn-sm, .btn-lg, .btn-full

   ── Бейджи статусов ──────────── styles.css .status-pill +
       .status-finished, .status-live, .status-not-started, .status-canceled

   ── Переключатели ────────────── styles.css
       .switch (32×22) / .switch.switch-sm (32×19)
       .segmented (RU/EN, Нет/Да)  / .segmented.danger
       .pill-toggle (All/Live/...)
       .radio-option + .radio-dot (с белой точкой)

   ── Календарь ────────────────── styles.css
       .calendar-popover         (popover, выпадает из .date-pager-value)
       .calendar-inline          (встроенный вариант)
       поддерживает single-day и range через .range-start/.range-end/.in-range

   ── Кастомный скролл ─────────── this file (.custom-scroll)
   ── Brand-логотип ────────────── styles.css .brand-img / .brand-img-xs/sm/md/lg
   ── Аватары и SVG-иконки ──────── inline SVG в шаблонах

   ── Тултип системы ───────────── this file (.sys-tooltip)
       Подключается через tooltip.js (data-tip="...")
       Работает на уровне <body> — не обрезается родительским overflow.

   ── Модалка ──────────────────── this file (.modal-backdrop / .modal)
       Использование: добавить .modal-backdrop с .modal внутри;
       тогл visibility через class .open или [hidden].
   ============================================================ */


/* ====== SYSTEM TOOLTIP (JS-driven, never clipped) ====== */
.sys-tooltip {
  position: absolute;
  top: -9999px;
  left: 0;
  background: #0c1a2a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28), 0 1px 0 rgba(255,255,255,0.06) inset;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.sys-tooltip.visible { opacity: 1; transform: translateY(0); }
.sys-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
}
.sys-tooltip.above::before {
  bottom: -6px;
  border-top-color: #0c1a2a;
}
.sys-tooltip.below::before {
  top: -6px;
  border-bottom-color: #0c1a2a;
}


/* ====== MODAL ====== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 48px);
  box-shadow: 0 24px 60px -16px rgba(8,16,30,0.45), 0 4px 16px rgba(8,16,30,0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
  font-family: inherit;
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-head {
  padding: 18px 56px;             /* symmetric padding so close-btn doesn't shift title */
  background: linear-gradient(180deg, #1e3a5f 0%, #1a3253 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.modal-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
.modal-title span {
  color: #fff;
}
.modal-title-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.modal-head .modal-close {
  color: rgba(255,255,255,0.7);
}
.modal-head .modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--border-light); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body {
  padding: 0 26px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 16px;
}
.modal-filters .pager-arrow {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  border-radius: 50%;
  font-size: 16px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.modal-filters .pager-arrow:hover { background: var(--accent-muted); }
.modal-filters .pill-toggle {
  flex: 1;
  justify-content: center;
  padding: 6px;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.modal-filters .pill-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
}
.modal-filters .pill-toggle-btn.active {
  box-shadow: 0 2px 8px rgba(15,23,42,0.18);
}
.modal-filters .pill-toggle-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.modal-select-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
}
.modal-select-all-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-light);
  cursor: pointer;
}

.modal-tournaments {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px 6px;
  margin: 0 -6px;
}
.modal-tournament {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 8px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.modal-tournament:hover { background: var(--border-light); }
.modal-tournament-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: #fff;
}
.modal-tournament-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Custom checkbox (used in modal) */
.modal-checkbox {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-checkbox input { display: none; }
.modal-check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid #c5cad4;
  background: #fff;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-check svg {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.12s;
}
.modal-checkbox input:checked + .modal-check {
  background: var(--accent-light);
  border-color: var(--accent-light);
}
.modal-checkbox input:checked + .modal-check svg { opacity: 1; }

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 26px 24px;
}
.modal-footer .btn { min-width: 140px; padding: 12px 20px; font-size: 14px; border-radius: 999px; }
.modal-footer .btn-ghost {
  background: #d8dce3;
  border-color: transparent;
  color: #6b7280;
}
.modal-footer .btn-ghost:hover { background: #c5cad4; color: var(--text-primary); }

.modal-tournaments.custom-scroll::-webkit-scrollbar { width: 7px; }


/* Rounded transition handled directly on .topbar-app / .scout-header
   via border-radius: 0 0 22px 22px (см. styles.css). */
