/**
 * spotlight.css — "Match Spotlight" vote carousel component styles.
 *
 * Containment boundary: EVERY selector is prefixed .spotlight- so nothing
 * leaks to other pages (this file is linked only from home.php and
 * league.php) and nothing collides with match-detail.css, which
 * inline-match.js injects into the host document mid-session.
 *
 * Theming: only existing CSS custom-property tokens from variables.css are
 * used — no new variables — so dark/light themes work by construction.
 * RTL: logical flips live in the [dir="rtl"] block below.
 */

/* Page wrapper (home.php / league.php). :empty kills the phantom 12px flex
   gap of .news-column-inner when the endpoint returns nothing or fails. */
.spotlight-root:empty {
    display: none;    
}

/* ── Skeleton loader ────────────────────────────────────────────────────
   Server-rendered inside .spotlight-root (see home.php). spotlight-carousel.js
   wipes root.innerHTML on the first render() or when the endpoint returns 0
   cards, so the skeleton never needs a manual teardown. Mirrors the real
   card's box (padding / radius / border) so the swap is layout-stable.
   Shimmer uses --bg-secondary → --bg-card-hover for contrast against
   --bg-card in both themes. */
.spotlight-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    padding: 12px;
    margin-bottom: 1rem;
    pointer-events: none;
}

.spotlight-skeleton-league {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spotlight-skeleton-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.spotlight-skeleton-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.spotlight-skeleton-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
}

.spotlight-skeleton-vote {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0 0;
}

.spotlight-skeleton-opts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.spotlight-skeleton-bar {
    display: block;
    background: linear-gradient(90deg,
        var(--bg-secondary) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: spotlight-shimmer 1.5s infinite;
    border-radius: 4px;
}

.spotlight-skeleton-line { height: 12px; min-width: 24px; }
.spotlight-skeleton-line-sm { height: 8px; min-width: 20px; }
.spotlight-skeleton-logo-lg {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.spotlight-skeleton-logo-xl {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.spotlight-skeleton-pill {
    height: 38px;
    border-radius: var(--border-radius-pill);
}

@keyframes spotlight-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .spotlight-skeleton-bar {
        animation: none;
    }
}

.spotlight {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    padding: 12px;
    margin-bottom: 1rem;
}

/* ── Viewport / track (native scroll-snap swipe, hidden scrollbar) ─────── */

.spotlight-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.spotlight-viewport::-webkit-scrollbar {
    display: none;
}

.spotlight-track {
    display: flex;
}

.spotlight-card {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 2px;
}

/* ── League header ─────────────────────────────────────────────────────── */

.spotlight-league {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    text-decoration: none;
    color: var(--text-primary);
}

.spotlight-league:hover .spotlight-league-name {
    color: var(--accent-primary);
}

.spotlight-league-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.spotlight-league-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

/* ── Match row ─────────────────────────────────────────────────────────── */

.spotlight-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 4px 0;
}

.spotlight-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.spotlight-team-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.spotlight-team-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 8px;
}

.spotlight-time {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--text-primary);
}

.spotlight-daylabel {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.spotlight-countdown {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.spotlight-badge {
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--border-radius-pill);
    background: var(--bg-pill);
    color: var(--text-secondary);
}

.spotlight-badge-live {
    background: rgba(229, 57, 53, 0.15);
    color: #e53935;
}

/* ── Vote block ────────────────────────────────────────────────────────── */

.spotlight-vote {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-pill);
    border-radius: var(--border-radius-btn);
    padding: 12px;
}

.spotlight-vote-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spotlight-vote-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.spotlight-vote-caption {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.spotlight-vote-opts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.spotlight-vote-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast);
}

.spotlight-vote-opt:hover {
    background: var(--accent-primary-subtle);
}

.spotlight-vote-opt:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.spotlight-vote-opt img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.spotlight-vote-error {
    font-size: var(--font-size-xs);
    color: #e53935;
}

/* Result state — pill width ∝ --spot-fill (same technique as .poll-*). */
.spotlight-results {
    display: flex;
    gap: 6px;
}

.spotlight-result-pill {
    flex: 1 1 var(--spot-fill, 33%);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    background: var(--poll-fill-bg);
    overflow: hidden;
    transition: flex-basis var(--transition-normal);
}

.spotlight-result-pill.is-voted {
    border-color: var(--accent-primary);
    background: var(--accent-primary-bg);
}

.spotlight-result-pill img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
}

.spotlight-result-x {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.spotlight-result-pct {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ── Navigation row (arrows + dots) ────────────────────────────────────── */

.spotlight-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.spotlight-arrow {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: var(--font-size-lg);
    line-height: 1;
    cursor: pointer;
    padding: 2px 10px;
    border-radius: var(--border-radius-btn);
    transition: background var(--transition-fast);
}

.spotlight-arrow:hover {
    background: var(--accent-primary-subtle);
}

.spotlight-arrow:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.spotlight-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.spotlight-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.spotlight-dot.is-active {
    background: var(--accent-primary);
    transform: scale(1.25);
}

.spotlight-dot:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}



/* ── Responsive (self-contained ladder; responsive.css stays untouched) ── */

@media (max-width: 991.98px) {
    /* .news-column-inner becomes flex-wrap:wrap here — keep the rail
       full-width instead of sitting beside the news blocks. */
    .spotlight-root {
        flex: 0 0 100%;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .spotlight {
        padding: 10px;
    }

    .spotlight-team-logo {
        width: 36px;
        height: 36px;
    }

    .spotlight-time {
        font-size: var(--font-size-base);
    }

    .spotlight-vote {
        padding: 10px;
    }

    .spotlight-skeleton {
        padding: 10px;
    }

    .spotlight-skeleton-logo-xl {
        width: 36px;
        height: 36px;
    }
}
