/* ═══════════════════════════════════════════════
   SportBase v2 — "STEEL" Design System
   Regular CSS — animations, utilities, custom classes
   (Theme tokens are defined inline in HTML for Tailwind Browser CDN)
   ═══════════════════════════════════════════════ */

/* ── Animations ────────────────────────────────── */
@keyframes reveal-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-left {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes counter-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
@keyframes live-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes stripe-move {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}

.anim-up { animation: reveal-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.anim-left { animation: reveal-left 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.live-dot { animation: live-dot 1.4s ease-in-out infinite; }

/* Stagger */
.d1 { animation-delay: 80ms; }
.d2 { animation-delay: 160ms; }
.d3 { animation-delay: 240ms; }
.d4 { animation-delay: 320ms; }
.d5 { animation-delay: 400ms; }
.d6 { animation-delay: 480ms; }

/* ── Accent stripe ─────────────────────────────── */
.accent-stripe {
    height: 3px;
    background: linear-gradient(90deg, #E11D39 0%, #E11D39 40%, #FFD700 100%);
}

/* ── Diagonal texture ──────────────────────────── */
.texture-diagonal {
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.02) 10px,
        rgba(255,255,255,0.02) 11px
    );
}

/* ── Noise grain overlay ───────────────────────── */
.grain::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* ── Select arrow ──────────────────────────────── */
.select-dark {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239C9CA6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-size: 18px;
    background-position: right 8px center;
    background-repeat: no-repeat;
    padding-right: 2rem;
}
.select-light {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2371717A' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-size: 18px;
    background-position: right 8px center;
    background-repeat: no-repeat;
    padding-right: 2rem;
}

/* ── Flag box ──────────────────────────────────── */
.flag-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 16px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Left-accent card ──────────────────────────── */
.card-accent {
    border-left: 3px solid var(--accent-color, #E11D39);
}

/* ── Focus a11y ────────────────────────────────── */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
tr[tabindex]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-dark), 0 0 0 4px var(--color-accent);
    border-radius: 4px;
}

/* ── Scrollbar ─────────────────────────────────── */
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { -ms-overflow-style: none; scrollbar-width: none; }

.scroll-thin::-webkit-scrollbar { height: 3px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 99px; }

/* ── Sport overlay on cards ────────────────────── */
.sport-overlay {
    background: linear-gradient(to top, rgba(9,9,11,0.85) 0%, rgba(9,9,11,0.3) 50%, rgba(9,9,11,0.05) 100%);
}

/* ── Ad placeholders ───────────────────────────── */
.ad-block {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8E8EC;
    border: 1px dashed #C4C4CA;
    position: relative;
    overflow: hidden;
}
.ad-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(0,0,0,0.02) 8px,
        rgba(0,0,0,0.02) 9px
    );
}
.ad-block-dark {
    background: #1C1C21;
    border-color: #2A2A30;
}
.ad-block-dark::before {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,0.02) 8px,
        rgba(255,255,255,0.02) 9px
    );
}

.sportbase-ad-slot {
    min-height: 90px;
}

.sportbase-ad-slot svg {
    display: block;
}

/* Competition event slider */
.events-slider {
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.events-slider::-webkit-scrollbar {
    display: none;
}

.chip-rich {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #dcdce0;
    padding: 0.875rem;
    min-width: 168px;
    max-width: 168px;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.chip-rich:hover {
    transform: translateY(-2px);
    border-color: #18181b;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
}

.event-popover-fixed {
    position: fixed;
    z-index: 100;
    width: 320px;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 16px));
    transition: opacity 0.15s ease-out;
    will-change: opacity;
}

.event-popover-fixed.is-visible {
    opacity: 1;
}

.event-popover-card {
    background: #ffffff;
    color: #18181b;
    border: 1px solid #dcdce0;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.18), 0 8px 20px -5px rgba(0, 0, 0, 0.08);
    font-family: "Barlow", sans-serif;
    position: relative;
}

.event-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f7f7f8;
    border-bottom: 1px solid #dcdce0;
}

.event-popover-date {
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #18181b;
}

.event-popover-count {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ffffff;
    background: #e11d39;
    padding: 3px 8px;
}

.event-popover-list {
    padding: 4px 0;
}

.event-popover-item {
    padding: 12px 14px;
    border-bottom: 1px solid #ededf0;
}

.event-popover-item:last-child {
    border-bottom: none;
}

.event-popover-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.event-popover-fed {
    display: inline-flex;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.event-popover-level {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71717a;
}

.event-popover-qual {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    color: #e11d39;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.event-popover-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #18181b;
    margin: 0 0 4px;
}

.event-popover-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #71717a;
}

.event-popover-card::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%) rotate(45deg);
    width: 11px;
    height: 11px;
    background: #ffffff;
    border-right: 1px solid #dcdce0;
    border-bottom: 1px solid #dcdce0;
}

/* Override global focus ring for search inputs */
.search-input:focus-visible,
.search-input:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Custom filter dropdowns */
.filter-dropdown {
    position: relative;
}

.filter-dropdown:not([open]) .filter-dropdown-panel,
.filter-dropdown:not([open]) .calendar-popup {
    display: none;
}

.filter-dropdown[open] .filter-dropdown-btn > svg:last-child {
    transform: rotate(180deg);
}

.filter-dropdown-btn::-webkit-details-marker {
    display: none;
}

.filter-dropdown-btn::marker {
    content: "";
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #ffffff;
    border: 1px solid #dcdce0;
    font-family: "Barlow", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #18181b;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 140px;
    justify-content: space-between;
}

.filter-dropdown-btn:hover {
    border-color: #2a2a30;
}

.filter-dropdown-btn.active {
    border-color: #e11d39;
    color: #e11d39;
}

.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dcdce0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 40;
}

.filter-dropdown-panel a,
.filter-dropdown-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    font-size: 13px;
    color: #52525b;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    font-family: "Barlow", sans-serif;
}

.filter-dropdown-panel a:hover,
.filter-dropdown-panel button:hover {
    background: #f7f7f8;
    color: #18181b;
}

.filter-dropdown-panel .filter-active {
    background: #e11d39;
    color: #ffffff;
    font-weight: 600;
}

.filter-dropdown-panel .filter-active:hover {
    background: #c41830;
    color: #ffffff;
}

.calendar-popup {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #ffffff;
    border: 1px solid #dcdce0;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.12), 0 4px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 45;
    min-width: 320px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: #18181b;
    font-family: "Barlow", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.calendar-cell:hover:not(.cal-other-month) {
    background: #f7f7f8;
}

.calendar-cell.cal-other-month {
    color: #c4c4ca;
    cursor: default;
}

.calendar-cell.cal-today {
    border: 1px solid #dcdce0;
}

.calendar-cell.cal-selected,
.calendar-cell.cal-range-start,
.calendar-cell.cal-range-end {
    background: #e11d39;
    color: #ffffff;
    font-weight: 700;
}

.calendar-cell.cal-selected:hover,
.calendar-cell.cal-range-start:hover,
.calendar-cell.cal-range-end:hover {
    background: #c41830;
}

.calendar-cell.cal-in-range {
    background: rgba(225, 29, 57, 0.08);
    color: #e11d39;
    font-weight: 600;
}

.calendar-weekday {
    padding: 8px 0;
    color: #71717a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
}

[x-cloak] {
    display: none !important;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 100;
    transform: translateY(-150%);
    background: #ffffff;
    color: #18181b;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sportbase-copy h1,
.sportbase-copy h2,
.sportbase-copy h3 {
    color: #18181b;
    font-family: "Bebas Neue", Impact, sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sportbase-copy h2 {
    font-size: clamp(1.75rem, 2vw, 2.25rem);
    line-height: 1;
    margin-bottom: 0.75rem;
}

.sportbase-copy p,
.sportbase-copy li {
    color: #52525b;
    font-size: 0.9375rem;
    line-height: 1.75;
}

.sportbase-copy p + p,
.sportbase-copy ul,
.sportbase-copy ol {
    margin-top: 0.75rem;
}

.sportbase-copy a {
    color: #e11d39;
    font-weight: 700;
}

.sportbase-logo-mark {
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
}

.sportbase-rich-content {
    color: #52525b;
    font-size: 0.9375rem;
    line-height: 1.8;
}

.sportbase-rich-content > * + * {
    margin-top: 1.25rem;
}

.sportbase-rich-content h2,
.sportbase-rich-content h3,
.sportbase-rich-content h4 {
    color: #18181b;
    font-family: "Bebas Neue", Impact, sans-serif;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
}

.sportbase-rich-content h2 {
    font-size: 2rem;
}

.sportbase-rich-content h3 {
    font-size: 1.5rem;
}

.sportbase-rich-content a {
    color: #e11d39;
    font-weight: 700;
    text-decoration: none;
}

.sportbase-rich-content img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    object-fit: cover;
}

.sportbase-rich-content ul,
.sportbase-rich-content ol {
    padding-left: 1.25rem;
}

.sportbase-rich-content ul {
    list-style: disc;
}

.sportbase-rich-content ol {
    list-style: decimal;
}

.sportbase-rich-content blockquote {
    border-left: 3px solid #e11d39;
    color: #18181b;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0 0.25rem 1.25rem;
}
