/* =========================================================
   Transfer window ticker — slim live-sports strip
   ========================================================= */

/* ── Design tokens ──────────────────────────────────────── */
:root {
  --ticker-bg:        #0d0d1a;
  --ticker-bg-closed: #0d0a0a;
  --ticker-border:    rgba(124, 58, 237, 0.25);
  --ticker-accent:    #7c3aed;
  --ticker-accent-cl: #dc2626;   /* closed state accent — red */
  --ticker-text:      rgba(255, 255, 255, 0.9);
  --ticker-muted:     rgba(255, 255, 255, 0.48);
  --ticker-divider:   rgba(255, 255, 255, 0.14);
  --ticker-live-bg:   rgba(151, 196, 89, 0.16);
  --ticker-live-dot:  #97c459;
  --ticker-live-text: #c8f09e;
  --ticker-number:    #fbbf24;
  /* Closed pill */
  --ticker-cl-pill-bg:   rgba(220, 38, 38, 0.12);
  --ticker-cl-pill-dot:  #ef4444;
  --ticker-cl-pill-text: #fca5a5;
}

/* ── Shell ──────────────────────────────────────────────── */

.transfer-window-ticker {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--ticker-bg);
  border: 1px solid var(--ticker-border);
  border-left: 3px solid var(--ticker-accent);
  border-radius: 8px;
  margin: 0 16px 16px;
  color: #fff;
  text-decoration: none;
  position: relative;
  /* Prevent ever escaping viewport */
  max-width: calc(100vw - 32px);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(124, 58, 237, 0.06);
  transition: box-shadow 0.2s;
}

a.transfer-window-ticker:hover {
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(124, 58, 237, 0.18);
}

/* Closed state */
.transfer-window-ticker.is-closed {
  background: var(--ticker-bg-closed);
  border-color: rgba(220, 38, 38, 0.18);
  border-left-color: var(--ticker-accent-cl);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(220, 38, 38, 0.06);
}

/* ── Strip main: live pill + status + countdown ─────────── */

.ticker-strip-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 42px;
}

/* ── Live pill ──────────────────────────────────────────── */

.ticker-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  background: var(--ticker-live-bg);
  color: var(--ticker-live-text);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.ticker-live::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ticker-live-dot);
  animation: liveGlow 1.8s ease-in-out infinite;
}

.ticker-live.is-closed {
  background: var(--ticker-cl-pill-bg);
  color: var(--ticker-cl-pill-text);
}

.ticker-live.is-closed::before {
  background: var(--ticker-cl-pill-dot);
  animation: closedGlow 2.4s ease-in-out infinite;
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(151, 196, 89, 0.12); }
  50%       { box-shadow: 0 0 0 5px rgba(151, 196, 89, 0.28); }
}

@keyframes closedGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.10); }
  50%       { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.22); }
}

/* ── Status label ───────────────────────────────────────── */

.ticker-status-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--ticker-text);
  white-space: nowrap;
  line-height: 1;
}

.transfer-window-ticker.is-closed .ticker-status-label {
  color: rgba(255, 255, 255, 0.72);
}

/* ── Divider ────────────────────────────────────────────── */

.ticker-divider {
  color: var(--ticker-divider);
  font-weight: 300;
  font-size: 14px;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

/* ── Countdown ──────────────────────────────────────────── */

.ticker-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ticker-muted);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  /* Reset any inherited block styles */
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

.ticker-countdown strong {
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: 12px;
  color: var(--ticker-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.ticker-countdown.is-finished {
  color: rgba(255, 255, 255, 0.55);
  gap: 5px;
}

.ticker-countdown.is-finished i {
  font-size: 12px;
  color: var(--ticker-cl-pill-dot);
}

/* ── Tape track (scrolling text) ────────────────────────── */

.ticker-tape-track {
  flex: 1;
  overflow: hidden;
  min-width: 0;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.ticker-tape-text {
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ticker-muted);
  will-change: transform;
  animation: tickerScroll 34s linear infinite;
  /* Small delay so it feels live when the page loads */
  animation-delay: 0.5s;
}

.transfer-window-ticker.is-closed .ticker-tape-text {
  /* Tape keeps scrolling in closed state — only brightness reduced */
  color: rgba(255, 255, 255, 0.42);
}

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-33.33%); }
}

/* ── CTA arrow (when ticker is a link) ──────────────────── */

.ticker-cta-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.28);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.15s;
}

.ticker-cta-arrow i {
  font-size: 16px;
}

a.transfer-window-ticker:hover .ticker-cta-arrow {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Mobile: two-row layout (≤ 767px) ──────────────────── */

@media (max-width: 767px) {
  .transfer-window-ticker {
    flex-direction: column;
    align-items: stretch;
    /* Accent on top instead of left on mobile */
    border-left: 1px solid var(--ticker-border);
    border-top: 3px solid var(--ticker-accent);
  }

  .transfer-window-ticker.is-closed {
    border-top-color: var(--ticker-accent-cl);
    border-left-color: rgba(255, 255, 255, 0.07);
  }

  .ticker-strip-main {
    padding: 8px 14px;
    min-height: auto;
    gap: 8px;
    flex-wrap: wrap;
  }

  .ticker-tape-track {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    height: 28px;
    flex-shrink: 0;
  }

  .ticker-tape-text {
    font-size: 11px;
  }

  .ticker-cta-arrow {
    display: none; /* hide on mobile — the whole strip is tappable if linked */
  }
}

/* ── Desktop: single-line strip (≥ 768px) ──────────────── */

@media (min-width: 768px) {
  .transfer-window-ticker {
    margin: 0 auto 20px;
    max-width: 1200px;
    border-radius: 10px;
  }

  .ticker-strip-main {
    min-height: 46px;
    padding: 0 18px;
    gap: 12px;
  }

  .ticker-live {
    font-size: 9.5px;
    padding: 4px 9px 4px 8px;
  }

  .ticker-status-label {
    font-size: 11.5px;
  }

  .ticker-countdown {
    font-size: 11.5px;
  }

  .ticker-countdown strong {
    font-size: 12.5px;
  }

  .ticker-tape-text {
    font-size: 12px;
    padding: 0 18px;
  }

  .ticker-cta-arrow {
    width: 44px;
  }

  .ticker-cta-arrow i {
    font-size: 17px;
  }
}

/* ── Deal item links inside the ticker tape ─────────────── */

.ticker-deal-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
  /* Slightly larger tap area without affecting layout */
  padding: 4px 0;
}

.ticker-deal-link:hover,
.ticker-deal-link:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  outline: none;
}

.ticker-deal-link:focus-visible {
  /* Keyboard focus ring — visible against dark background */
  outline: 2px solid rgba(167, 139, 250, 0.8);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Separator star between deal items */
.ticker-sep-star {
  color: rgba(124, 58, 237, 0.7);
  font-size: 9px;
  vertical-align: middle;
  user-select: none;
  padding: 0 2px;
}

/* Closed state: deal links stay clickable, slightly dimmed */
.transfer-window-ticker.is-closed .ticker-deal-link {
  color: rgba(255, 255, 255, 0.58);
  pointer-events: auto;
}

.transfer-window-ticker.is-closed .ticker-deal-link:hover,
.transfer-window-ticker.is-closed .ticker-deal-link:focus-visible {
  color: rgba(255, 255, 255, 0.9);
}

/* Separator star: subtle red tint in closed state */
.transfer-window-ticker.is-closed .ticker-sep-star {
  color: rgba(220, 38, 38, 0.55);
}

/* ── Reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ticker-tape-text {
    animation: none !important;
  }

  .ticker-live::before,
  .ticker-live.is-closed::before {
    animation: none;
  }
}
