/* Top Cards Page – stat.css v7 */

/* ─── Page Shell ───────────────────────────────────────── */
.tc-page {
    background: #f7f8fb;
    min-height: 100vh;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
}

/* ─── Hero ─────────────────────────────────────────────── */
.tc-hero {
    background: #f7f8fb;
    padding: 10px 20px 9px;
}
.tc-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}
.tc-title-wrap {
    padding: 0 24px 6px !important;
}
.tc-hero-sub {
    color: #444;
    font-size: 17px;
    margin: 0;
    font-style: italic;
}

/* ─── Range Filter Bar ──────────────────────────────────── */
.tc-range-outer {
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.tc-range-outer::-webkit-scrollbar { display: none; }
.tc-range-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    align-items: center;
}
.tc-range-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid #484848;
    color: #aaa;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}
.tc-range-btn:hover,
.tc-range-btn:focus {
    background: #3a3a3a;
    color: #fff;
    border-color: #666;
    text-decoration: none;
    outline: none;
}
.tc-range-btn.active {
    background: #c88a31;
    color: #fff;
    border-color: #c88a31;
    font-weight: 700;
}

/* Fallback message */
.tc-fallback-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
    font-size: 17px;
    font-style: italic;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .tc-range-bar { gap: 5px; padding: 8px 12px; }
    .tc-range-btn { font-size: 12px; padding: 5px 12px; }
}

/* ─── Sticky Tab Bar ────────────────────────────────────── */
.tc-tabs-outer {
    background: #1e1e1e;
    border-bottom: 2px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    justify-content: center;
}
.tc-tabs-outer::-webkit-scrollbar { display: none; }
.tc-tabs {
    display: flex;
    padding: 0 16px;
}
.tc-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #888;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 15px 20px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    line-height: 1;
    outline: none;
}
.tc-tab-btn:hover { color: #fff; }
.tc-tab-btn.active {
    color: #fff;
    border-bottom-color: #c88a31;
}

/* ─── Body / Content Panel ──────────────────────────────── */
.tc-body {
    max-width: 1440px;
    margin: 20px auto;
    padding: 24px 20px 50px;
    background: #414040;
    border-radius: 10px;
}

/* ─── Card Grid ─────────────────────────────────────────── */
.tc-section {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

/* ─── Individual Card ───────────────────────────────────── */
.tc-card {
    background: #575656;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.tc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

/* Rank badge */
.tc-rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #c88a31;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 9px 2px;
    border-radius: 6px;
    z-index: 2;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* Card image */
.tc-img-wrap {
    width: 100%;
    aspect-ratio: 5 / 7;
    overflow: hidden;
    background: #2a2a2a;
    flex-shrink: 0;
    cursor: pointer;
}
.tc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.tc-img-wrap:hover .tc-img {
    transform: scale(1.05);
}

/* Card body */
.tc-card-body {
    padding: 10px 11px 12px;
    background: #656464;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tc-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffeadb;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.tc-card-set {
    font-size: 11px;
    color: #aaa;
    margin: -4px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Stats row */
.tc-pct-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.tc-pct-label {
    font-size: 13px;
    color: #c88a31;
    font-weight: 700;
    white-space: nowrap;
}
.tc-qty-label {
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
    white-space: nowrap;
}

/* Add to order button */
.tc-add-btn {
    display: block;
    width: 100%;
    background: #c88a31;
    color: #fff;
    text-align: center;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 7px 8px 5px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
    letter-spacing: 0.5px;
    margin-top: auto;
}
.tc-add-btn:hover,
.tc-add-btn:focus {
    background: #e39a32;
    color: #fff;
    text-decoration: none;
}

/* ─── Lightbox ───────────────────────────────────────────── */
.tc-lb-overlay {
    position: fixed;
    inset: 0;
    /* Must sit above the admin search modal (.tc-asm-overlay = 199999),
       since the lightbox is opened from inside that modal. */
    z-index: 299999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}
.tc-lb-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#tc-lb-img {
    max-width: min(480px, 90vw);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
    display: block;
    pointer-events: none;
    animation: tc-lb-in 0.18s ease;
}
@keyframes tc-lb-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.tc-lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: #c88a31;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    font-family: sans-serif;
}
.tc-lb-close:hover {
    background: #e39a32;
    transform: scale(1.1);
}

/* ─── Admin Search Trigger ──────────────────────────────── */
.tc-admin-search-trigger {
    display: inline-block;
    margin-top: 12px;
    background: #2a2a2a;
    color: #c88a31;
    border: 1px solid #c88a31;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 7px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tc-admin-search-trigger:hover {
    background: #c88a31;
    color: #fff;
}

/* ─── Admin Search Modal ────────────────────────────────── */
.tc-asm-overlay {
    position: fixed;
    inset: 0;
    z-index: 199999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tc-asm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    cursor: pointer;
}
.tc-asm-box {
    position: relative;
    z-index: 1;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 14px;
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    animation: tc-asm-in 0.18s ease;
}
@keyframes tc-asm-in {
    from { opacity: 0; transform: translateY(-14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tc-asm-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 2;
    font-family: sans-serif;
}
.tc-asm-close:hover { background: #c88a31; }
.tc-asm-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffeadb;
    margin: 0;
    padding: 20px 24px 14px;
    border-bottom: 1px solid #2e2e2e;
    flex-shrink: 0;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
}
.tc-asm-range-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 24px;
    border-bottom: 1px solid #2e2e2e;
    flex-shrink: 0;
}
.tc-asm-range-btn {
    background: transparent;
    border: 1px solid #484848;
    color: #aaa;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.tc-asm-range-btn:hover { background: #333; color: #fff; border-color: #666; }
.tc-asm-range-btn.active { background: #c88a31; color: #fff; border-color: #c88a31; font-weight: 700; }
.tc-asm-search-row {
    display: flex;
    gap: 10px;
    padding: 14px 24px;
    border-bottom: 1px solid #2e2e2e;
    flex-shrink: 0;
}
.tc-asm-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 14px;
    padding: 9px 14px;
    outline: none;
    transition: border-color 0.15s;
}
.tc-asm-input:focus { border-color: #c88a31; }
.tc-asm-input::placeholder { color: #666; }
.tc-asm-btn {
    background: #c88a31;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Myriad Pro', 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 22px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.tc-asm-btn:hover { background: #e39a32; }
.tc-asm-btn:disabled { background: #555; cursor: default; }
.tc-asm-results {
    overflow-y: auto;
    flex: 1;
    padding: 18px 24px 24px;
}
.tc-asm-results::-webkit-scrollbar { width: 6px; }
.tc-asm-results::-webkit-scrollbar-track { background: #1a1a1a; }
.tc-asm-results::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* Results states */
.tc-asm-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 30px 0;
    font-size: 14px;
}
.tc-asm-loading {
    color: #c88a31;
    text-align: center;
    padding: 30px 0;
    font-size: 14px;
}

/* Summary header */
.tc-asm-summary {
    margin-bottom: 16px;
}
.tc-asm-summary-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffeadb;
    margin: 0 0 4px;
}
.tc-asm-summary-total {
    font-size: 14px;
    color: #aaa;
}
.tc-asm-summary-total strong {
    color: #c88a31;
    font-size: 18px;
}

/* Print rows */
.tc-asm-print-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.tc-asm-print-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #2a2a2a;
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid #333;
}
.tc-asm-print-rank {
    background: #c88a31;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}
.tc-asm-print-img {
    width: 42px;
    height: 58px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #1a1a1a;
    cursor: pointer;
    transition: transform 0.15s;
}
.tc-asm-print-img:hover { transform: scale(1.08); }
.tc-asm-print-info {
    flex: 1;
    min-width: 0;
}
.tc-asm-print-set {
    font-size: 13px;
    font-weight: 600;
    color: #ffeadb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-asm-print-id {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    font-family: monospace;
}
.tc-asm-print-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}
.tc-asm-print-total {
    font-size: 16px;
    font-weight: 700;
    color: #c88a31;
}
.tc-asm-print-breakdown {
    font-size: 11px;
    color: #888;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1300px) {
    .tc-section { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1000px) {
    .tc-section { grid-template-columns: repeat(3, 1fr); }
    .tc-hero-title { font-size: 30px; }
    .tc-tab-btn { font-size: 14px; padding: 13px 16px; }
}
@media (max-width: 640px) {
    .tc-section { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .tc-hero-title { font-size: 22px; }
    .tc-hero-sub { font-size: 15px; }
    .tc-hero { padding: 36px 16px 30px; }
    .tc-body { margin: 12px; padding: 14px 12px 36px; }
    .tc-tab-btn { font-size: 13px; padding: 12px 14px; }
}
@media (max-width: 380px) {
    .tc-section { grid-template-columns: 1fr; }
}
