/* TGMHub reusable listview styles.
   Source of truth: Components/Pages/GwRewards.razor.css, with reusable class names.
*/

.tgm-listview-page {
    --bg: #0f172a;
    --panel: #111827;
    --panel-2: #1f2937;
    --panel-3: #0b1220;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #263244;
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.15);
    --accent-border: rgba(34, 197, 94, 0.55);
    --input-bg: #0b1220;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    min-height: 100vh;
    background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

    .tgm-listview-page *,
    .tgm-listview-page *::before,
    .tgm-listview-page *::after {
        box-sizing: border-box;
    }

    .tgm-listview-page button,
    .tgm-listview-page input,
    .tgm-listview-page select {
        font: inherit;
    }

.tgm-listview-shell {
    max-width: 720px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom));
}

.tgm-listview-toolbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 82px;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.97) 0%, rgba(15, 23, 42, 0.92) 100%);
    backdrop-filter: blur(10px);
}

.tgm-listview-search-wrap {
    position: relative;
}

.tgm-listview-search {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(17, 24, 39, 0.96);
    color: var(--text);
    outline: none;
}

    .tgm-listview-search::placeholder {
        color: var(--muted);
    }

    .tgm-listview-search:focus {
        border-color: var(--accent-border);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
    }

.tgm-listview-select-wrap {
    position: relative;
    width: 96px;
}

.tgm-listview-select {
    width: 96px;
    min-width: 96px;
    height: 46px;
    padding: 0 34px 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background-color: rgba(17, 24, 39, 0.96);
    color: var(--text);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23cbd5e1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}

.tgm-listview-select::-ms-expand {
    display: none;
}

.tgm-listview-select:hover {
    border-color: rgba(148, 163, 184, 0.45);
}

.tgm-listview-select:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.tgm-listview-button {
    height: 46px;
    min-width: 82px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(17, 24, 39, 0.96);
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

    .tgm-listview-button:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.tgm-listview-content {
    padding-top: 6px;
}

.tgm-listview-tip-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.92) 0%, rgba(17, 24, 39, 0.96) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 4px solid var(--accent);
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.tgm-listview-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    grid-column: 1 / -1;
}

.tgm-listview-filter-chip {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(17, 24, 39, 0.96);
    color: var(--muted);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 120ms ease;
}

    .tgm-listview-filter-chip:hover {
        border-color: rgba(148, 163, 184, 0.45);
        color: var(--text);
    }

    .tgm-listview-filter-chip.active {
        background: var(--accent-soft);
        border-color: var(--accent-border);
        color: var(--text);
    }

    .tgm-listview-filter-chip:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
    }

.tgm-listview-card {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(38, 50, 68, 0.85);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tgm-listview-header,
.tgm-listview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px 88px;
    gap: 10px;
    align-items: center;
}

.tgm-listview-header {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.96);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tgm-listview-col-qty,
.tgm-listview-qty-col {
    justify-self: center;
}

.tgm-listview-col-total,
.tgm-listview-total-col {
    justify-self: end;
}

.tgm-listview-items {
    display: flex;
    flex-direction: column;
}

.tgm-listview-row {
    min-height: 56px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(38, 50, 68, 0.72);
    background: transparent;
    transition: background-color 220ms ease, border-color 220ms ease, transform 140ms ease, box-shadow 220ms ease;
    outline: none;
    will-change: background-color, transform;
    cursor: pointer;
}

    .tgm-listview-row:last-child {
        border-bottom: none;
    }

    .tgm-listview-row:hover {
        background: rgba(255, 255, 255, 0.02);
    }

    .tgm-listview-row.selected {
        background: var(--accent-soft);
        border-color: var(--accent-border);
        box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.18);
        animation: tgm-listview-row-select-pop 180ms ease;
    }

    .tgm-listview-row:focus-visible {
        box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
    }

.tgm-listview-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tgm-listview-row-title {
    font-size: 15px;
    line-height: 1.3;
    word-break: break-word;
}

.tgm-listview-row-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 40px;
    border-radius: 6px;
}

.tgm-listview-qty-input {
    width: 72px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--input-bg);
    color: var(--text);
    text-align: center;
    padding: 0 10px;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

    .tgm-listview-qty-input:focus {
        border-color: var(--accent-border);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
    }

.tgm-listview-row.selected .tgm-listview-qty-input {
    border-color: var(--accent-border);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.tgm-listview-qty-wrap {
    position: relative;
    width: 72px;
}

    .tgm-listview-qty-wrap .tgm-listview-qty-input {
        width: 100%;
    }

.tgm-listview-qty-input.max-hit {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
    animation: tgm-listview-qty-max-flash 0.45s ease;
}

.tgm-listview-row.selected .tgm-listview-qty-input.max-hit {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.tgm-listview-qty-max-hint {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    line-height: 1;
    color: #fca5a5;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

    .tgm-listview-qty-max-hint.visible {
        opacity: 1;
    }

.tgm-listview-row-value {
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.tgm-listview-empty {
    padding: 22px 16px;
    color: var(--muted);
    text-align: center;
}

.tgm-listview-hidden {
    display: none !important;
}

.tgm-listview-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(38, 50, 68, 0.95);
    background: rgba(11, 18, 32, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.24);
}

.tgm-listview-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tgm-listview-selected-count {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
}

.tgm-listview-footer-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
    font-weight: 700;
}

.tgm-listview-footer-value {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.01em;
}

@keyframes tgm-listview-qty-max-flash {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes tgm-listview-row-select-pop {
    0% {
        transform: scale(0.992);
    }

    55% {
        transform: scale(1.008);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 420px) {
    .tgm-listview-toolbar {
        grid-template-columns: minmax(0, 1fr) 82px 72px;
        gap: 6px;
    }

    .tgm-listview-select-wrap {
        width: 82px;
    }

    .tgm-listview-select {
        width: 82px;
        min-width: 82px;
        padding: 0 26px 0 9px;
        background-position: right 9px center;
    }

    .tgm-listview-button {
        min-width: 72px;
        padding: 0 8px;
    }

    .tgm-listview-header,
    .tgm-listview-row {
        grid-template-columns: minmax(0, 1fr) 74px 78px;
        gap: 8px;
    }

    .tgm-listview-header {
        padding: 12px 12px 10px;
        font-size: 12px;
    }

    .tgm-listview-row {
        padding: 12px;
    }

    .tgm-listview-qty-wrap {
        width: 64px;
    }

    .tgm-listview-qty-input {
        width: 100%;
    }

    .tgm-listview-row-main {
        font-size: 14px;
    }

    .tgm-listview-row-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }

    .tgm-listview-row-title {
        font-size: 14px;
    }

    .tgm-listview-footer-value {
        font-size: 22px;
    }

    .tgm-listview-filter-chip {
        min-height: 36px;
        padding: 0 12px;
    }
}
