/* ============================================================
   listing.css  (shared)
   Matches / Tournaments / My Matches browse pages.
   Card visuals come from card.css (match) and home/results.css
   (.hp-tcard tournament). This file owns the page chrome + grid.
   ============================================================ */
/* reserve the scrollbar gutter so switching filters (content height changes →
   scrollbar appears/disappears) never shifts the page left/right */
html { scrollbar-gutter: stable; }

.lp-page {
    width: 100%;
    max-width: 1750px;
    margin: 0 auto;
    padding: 28px 24px 56px;
}

.lp-head { margin-bottom: 22px; }
.lp-head .page-title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--color-text, #0f172a);
}
.lp-sub {
    margin: 8px 0 0;
    font-size: 15px;
    color: var(--color-text-muted, #64748b);
}

/* filter bar */
.lp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.lp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-chip {
    height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1.5px solid var(--color-border, #e2e8f0);
    background: var(--color-surface, #ffffff);
    color: var(--color-text-muted, #64748b);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lp-chip:hover { border-color: var(--color-primary, #0088ea); color: var(--color-primary, #0088ea); }
.lp-chip.is-active {
    background: var(--color-primary, #0088ea);
    border-color: var(--color-primary, #0088ea);
    color: #ffffff;
}
.lp-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
}

/* grid (self-contained layout so it works outside the home results wrapper) */
.lp-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.lp-grid[data-cat="tournament"] {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* loading skeleton tiles */
.lp-grid .skeleton-card {
    min-height: 210px;
    border-radius: 18px;
    background: linear-gradient(90deg, var(--color-surface-hover, #eef2f7) 25%, var(--color-surface, #f8fafc) 37%, var(--color-surface-hover, #eef2f7) 63%);
    background-size: 400% 100%;
    animation: lpShimmer 1.3s ease-in-out infinite;
}
@keyframes lpShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* empty state */
.lp-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    gap: 6px;
}
.lp-empty .empty-state__title { font-size: 18px; font-weight: 700; color: var(--color-text, #0f172a); }
.lp-empty .empty-state__text { font-size: 14px; color: var(--color-text-muted, #64748b); }

/* pagination — floating sticky pill (same as the home page) */
.lp-pag {
    position: sticky;
    bottom: 14px;
    z-index: 6;
    width: fit-content;
    max-width: 100%;
    margin: 28px auto 2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    box-shadow: 0 16px 40px -16px rgba(2, 6, 23, 0.42);
}
.lp-pag:empty { display: none !important; }
.lp-pag .pagination__btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 11px;
    border: 1.5px solid var(--color-border, #e2e8f0);
    background: var(--color-surface, #ffffff);
    color: var(--color-text, #0f172a);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lp-pag .pagination__btn:hover:not(:disabled) { border-color: var(--color-primary, #0088ea); color: var(--color-primary, #0088ea); }
.lp-pag .pagination__btn.is-active {
    background: var(--color-primary, #0088ea);
    border-color: var(--color-primary, #0088ea);
    color: #ffffff;
}
.lp-pag .pagination__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lp-pag .pagination__ellipsis { min-width: 24px; text-align: center; color: var(--color-text-muted, #64748b); align-self: center; }

@media (max-width: 640px) {
    .lp-page { padding: 20px 16px 44px; }
    .lp-head .page-title { font-size: 24px; }
    .lp-grid { grid-template-columns: 1fr; }

    /* status chips: single swipeable row (no cramped wrapping) */
    .lp-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .lp-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .lp-chips::-webkit-scrollbar { display: none; }
    .lp-chip { flex: 0 0 auto; }

    /* pagination: float in, revealed after scrolling (JS toggles .is-revealed) */
    .lp-pag {
        transition: opacity 0.28s cubic-bezier(.16, 1, .3, 1), transform 0.28s cubic-bezier(.16, 1, .3, 1);
        bottom: 10px;
        gap: 6px;
        padding: 9px 10px;
        width: calc(100vw - 24px);
        max-width: 380px;
    }
    .lp-pag:not(.is-revealed) {
        opacity: 0;
        transform: translateY(18px);
        pointer-events: none;
    }
}

/* ---- jump-to-page control inside the pagination pill (same as home) ---- */
.lp-pag .hp-jump {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 4px; padding-left: 10px;
    border-left: 1px solid var(--color-border, #e2e8f0);
}
.lp-pag .hp-jump__lbl, .lp-pag .hp-jump__tot { font-size: 0.76rem; font-weight: 700; color: var(--color-text-muted, #64748b); white-space: nowrap; }
.lp-pag .hp-jump__in {
    width: 54px; height: 34px; text-align: center;
    border: 1.5px solid var(--color-border, #e2e8f0); border-radius: 9px;
    background: var(--color-surface, #fff); color: var(--color-text, #0f172a);
    font-weight: 800; font-size: 0.85rem; outline: none;
    -moz-appearance: textfield;
}
.lp-pag .hp-jump__in:focus { border-color: var(--color-primary, #0088ea); box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(0,136,234,.15)); }
.lp-pag .hp-jump__in::-webkit-outer-spin-button, .lp-pag .hp-jump__in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lp-pag .hp-jump__go {
    height: 34px; padding: 0 14px; border: none; border-radius: 9px; cursor: pointer;
    background: var(--color-primary, #0088ea); color: #fff; font-weight: 800; font-size: 0.82rem;
    transition: filter 0.12s, transform 0.08s;
}
.lp-pag .hp-jump__go:hover { filter: brightness(1.05); }
.lp-pag .hp-jump__go:active { transform: scale(0.96); }
@media (max-width: 560px) {
    .lp-pag .hp-jump { flex-basis: 100%; justify-content: center; margin: 2px 0 0; padding: 9px 0 1px; border-left: none; border-top: 1px solid var(--color-border, #e2e8f0); }
    .lp-pag .hp-jump__in { height: 36px; width: 58px; }
    .lp-pag .hp-jump__go { height: 36px; }
}
@media (max-width: 360px) {
    .lp-pag .hp-jump__lbl { display: none; }
}
