/* ============================================================
   NOVALJA CUP 2026 — DIJELJENI STILOVI
   ============================================================ */

html { scroll-behavior: smooth; }

/* Defenzivno: [hidden] mora pobijediti class-level display rules */
[hidden] { display: none !important; }

/* -- TIPOGRAFIJA ----------------------------------------- */
body { font-family: 'Inter', system-ui, sans-serif; }
.font-display {
    font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-variation-settings: 'wdth' 95;
    letter-spacing: -0.01em;
}

/* -- SCROLLBAR (tablice + filter trake) ------------------ */
.overflow-x-auto::-webkit-scrollbar,
.ml-chip-row::-webkit-scrollbar { height: 6px; }
.overflow-x-auto::-webkit-scrollbar-thumb,
.ml-chip-row::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* -- HERO BACKGROUNDS ------------------------------------ */
.home-hero {
    background-image:
        linear-gradient(135deg, rgba(12, 74, 110, 0.85) 0%, rgba(3, 105, 161, 0.78) 100%),
        url('pag.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
@media (max-width: 768px) {
    .home-hero { background-attachment: scroll; }
}
.category-hero {
    background-image:
        linear-gradient(135deg, rgba(12, 74, 110, 0.92), rgba(3, 105, 161, 0.96)),
        url('pag.webp');
    background-size: cover;
    background-position: center;
}
.category-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.18), transparent 40%);
    pointer-events: none;
}

/* -- ALL-RESULTS HERO ---------------------------------- */
.all-results-hero {
    background-image:
        linear-gradient(135deg, rgba(6, 78, 59, 0.95), rgba(12, 74, 110, 0.96)),
        url('pag.webp');
    background-size: cover;
    background-position: center;
}
.all-results-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.22), transparent 45%);
    pointer-events: none;
}

/* Hero stats kartice */
.ar-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 760px;
    margin: 32px auto 0;
}
.ar-stat {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 16px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 200ms ease;
}
.ar-stat:hover { background: rgba(255, 255, 255, 0.12); }
.ar-stat-num {
    font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
    font-size: 1.875rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ar-stat-lbl {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}
@media (max-width: 480px) {
    .ar-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ar-stat-num { font-size: 1.5rem; }
}

/* -- TABLICE: pozicijski broj --------------------------- */
.pos-num {
    display: inline-block;
    min-width: 22px;
    font-weight: 700;
    font-size: 0.875rem;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}
.pos-num-leader {
    color: #0c4a6e;
    font-weight: 800;
}
.standings-row-leader {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.06) 0%, transparent 60%);
    box-shadow: inset 3px 0 0 #0ea5e9;
}

/* -- HOST DOT (oznaka domaćina u tablici) ---------------- */
.host-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #0ea5e9;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(14,165,233,0.18);
}

/* ============================================================
   MATCH LIST — filter, search, kronološka lista (mobile-first)
   ============================================================ */

.match-list-wrapper {
    max-width: 880px;
    margin: 0 auto;
}

/* ---- FILTER PANEL ---- */
.ml-filter-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
    margin-bottom: 18px;
}
@media (min-width: 768px) {
    .ml-filter-panel { padding: 20px 22px; }
}

/* Search */
.ml-search {
    position: relative;
    margin-bottom: 14px;
}
.ml-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}
.ml-search-input {
    width: 100%;
    padding: 13px 44px 13px 44px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0f172a;
    transition: all 180ms ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.ml-search-input::placeholder { color: #94a3b8; }
.ml-search-input:hover { background: #f1f5f9; }
.ml-search-input:focus {
    background: #fff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}
.ml-search-input::-webkit-search-cancel-button { display: none; }

.ml-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #475569;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
}
.ml-search-clear:hover { background: #cbd5e1; color: #1e293b; }
.ml-search-clear.is-visible { display: inline-flex; }

/* Filter rows */
.ml-filter-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ml-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.ml-filter-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    width: 64px;
}
.ml-chip-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex: 1 1 0;
    min-width: 0;
}
@media (min-width: 768px) {
    .ml-chip-row { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; }
}

/* Chips */
.ml-chip {
    flex: 0 0 auto;
    padding: 6px 13px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    user-select: none;
    line-height: 1.3;
}
.ml-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.ml-chip.is-active {
    background: #0c4a6e;
    color: #fff;
    border-color: #0c4a6e;
    box-shadow: 0 4px 12px -2px rgba(12, 74, 110, 0.35);
}
.ml-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
}

/* ---- RESULT META ---- */
.ml-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 10px;
    min-height: 32px;
}
.ml-result-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.ml-reset-btn {
    border: none;
    background: transparent;
    color: #0284c7;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 150ms ease;
}
.ml-reset-btn:hover { background: #e0f2fe; }

/* ---- LIST ---- */
.ml-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Day divider (newspaper-section style) */
.ml-day-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 4px 6px 4px;
}
.ml-day-divider:first-child { padding-top: 4px; }
.ml-day-label {
    font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #0c4a6e;
    flex: 0 0 auto;
}
.ml-day-rule {
    flex: 1 1 0;
    height: 1px;
    background: linear-gradient(90deg, #cbd5e1 0%, transparent 100%);
}

/* Match row */
.match-row {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 14px;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 640px) {
    .match-row {
        padding: 14px 18px;
        flex-direction: row;
        align-items: center;
        gap: 18px;
    }
}
.match-row:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.08);
}

/* Status-based variants */
.match-row-live {
    border-color: #a7f3d0;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08), 0 4px 14px -2px rgba(16, 185, 129, 0.12);
}
.match-row-live::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #10b981;
    border-radius: 14px 0 0 14px;
}
.match-row-finished {
    background: #fafafa;
}
.match-row-scheduled {
    background: #fff;
}

/* Meta row (top on mobile, left column on desktop) */
.ml-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
    min-width: 0;
}
@media (min-width: 640px) {
    .ml-meta {
        flex: 0 0 auto;
        gap: 10px;
    }
}
@media (min-width: 768px) {
    .ml-meta { flex: 0 0 auto; min-width: 280px; }
}

.ml-time {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex: 0 0 auto;
}
.ml-day {
    font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 4px;
}
.ml-time-val {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.ml-meta-sep {
    color: #cbd5e1;
    font-weight: 700;
    flex: 0 0 auto;
}
.ml-meta-spacer { flex: 1 1 0; }

.ml-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    flex: 0 0 auto;
    line-height: 1.2;
}
.ml-tag-group {
    color: #0369a1;
    background: rgba(14, 165, 233, 0.08);
}
.ml-tag-loc {
    color: #64748b;
    background: #f1f5f9;
}
.ml-tag-loc i { font-size: 0.625rem; opacity: 0.7; }
.ml-tag-cat {
    color: #065f46;
    background: rgba(16, 185, 129, 0.12);
    text-decoration: none;
    transition: all 150ms ease;
    border: 1px solid transparent;
}
.ml-tag-cat:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Status pills */
.ml-pill {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    line-height: 1.2;
}
.ml-pill-live {
    color: #047857;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}
.ml-pill-done {
    color: #94a3b8;
    background: transparent;
}
.ml-pill-scheduled {
    color: #0ea5e9;
    background: transparent;
}

/* Live pulse dot */
.ml-live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: ml-pulse 1.6s ease-in-out infinite;
}
.ml-live-dot-sm {
    width: 6px; height: 6px;
}
@keyframes ml-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Match block (teams + score) */
.ml-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
@media (min-width: 640px) {
    .ml-match { gap: 14px; }
}

.ml-team {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.ml-team-home { text-align: right; }
.ml-team-away { text-align: left; }

.ml-team-winner {
    color: #047857;
    font-weight: 800;
}
.ml-team-loser {
    color: #94a3b8;
    font-weight: 500;
}

/* Score */
.ml-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 64px;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    flex: 0 0 auto;
}
.ml-score-sep {
    opacity: 0.5;
    font-weight: 600;
    margin: 0 2px;
}
.ml-score-done {
    background: #f1f5f9;
    color: #0f172a;
}
.ml-score-live {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.4);
}
.ml-score-vs {
    background: transparent;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

/* ---- EMPTY STATE ---- */
.ml-empty {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}
.ml-empty-icon {
    font-size: 2.25rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}
.ml-empty h4 {
    font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}
.ml-empty p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0 0 18px 0;
}
.ml-empty-btn {
    background: #0c4a6e;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 160ms ease;
}
.ml-empty-btn:hover {
    background: #075985;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -4px rgba(12, 74, 110, 0.3);
}

/* -- GENTLE FADE-IN (renderirani sadržaj) ---------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#tables-grid > *,
#categories-grid > *,
#match-center-grid > *,
#locations-grid > *,
#finals-container > * {
    animation: fadeUp 400ms ease-out both;
}
.match-list-wrapper > * {
    animation: fadeUp 400ms ease-out both;
}

/* Suptilna sequencijalna animacija na chip-ovima */
.ml-chip { animation: fadeUp 350ms ease-out both; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
