/* ============================================================
   TSI Leaderboard Frontend Styles
   ============================================================ */

.tsi-lb-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #1a1a2e;
}

/* Day navigation */
.tsi-lb-days-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tsi-lb-days-nav::-webkit-scrollbar { display: none; }

.tsi-lb-day-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    line-height: 1.3;
}
.tsi-lb-day-btn:hover { color: #1a1a2e; }
.tsi-lb-day-btn.active {
    color: #1a56db;
    border-bottom-color: #1a56db;
}
.tsi-lb-day-btn-date {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    margin-top: 2px;
}
.tsi-lb-day-btn.active .tsi-lb-day-btn-date { color: #6b9ef5; }

/* Day panel */
.tsi-lb-day-panel { display: none; padding-top: 24px; }
.tsi-lb-day-panel.active { display: block; }

.tsi-lb-day-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}
.tsi-lb-day-heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}
.tsi-lb-day-heading-date {
    font-size: 13px;
    color: #9ca3af;
}

/* Type tabs */
.tsi-lb-type-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}
.tsi-lb-type-btn {
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.tsi-lb-type-btn:hover { border-color: #1a56db; color: #1a56db; }
.tsi-lb-type-btn.active {
    background: #1a56db;
    border-color: #1a56db;
    color: #fff;
}

/* Type panels */
.tsi-lb-type-panel { display: none; }
.tsi-lb-type-panel.active { display: block; }

/* Leaderboard table */
.tsi-lb-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.tsi-lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tsi-lb-table thead tr {
    background: #f8faff;
    border-bottom: 1px solid #e5e7eb;
}
.tsi-lb-table thead th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    text-align: left;
    white-space: nowrap;
}

.tsi-lb-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}
.tsi-lb-table tbody tr:last-child { border-bottom: none; }
.tsi-lb-table tbody tr:hover { background: #f9fafb; }
.tsi-lb-table tbody tr.tsi-lb-first { background: #fffbeb; }
.tsi-lb-table tbody tr.tsi-lb-first:hover { background: #fef3c7; }

.tsi-lb-table td {
    padding: 13px 16px;
    vertical-align: middle;
}

/* Column widths */
.tsi-lb-col-pos  { width: 56px; }
.tsi-lb-col-num  { width: 56px; color: #9ca3af; font-size: 13px; }
.tsi-lb-col-name { font-weight: 600; }
.tsi-lb-col-rel  { width: 90px; text-align: center; }
.tsi-lb-col-lh   { width: 90px; color: #6b7280; font-size: 13px; white-space: nowrap; }
.tsi-lb-table th.tsi-lb-col-rel,
.tsi-lb-table th.tsi-lb-col-lh { text-align: center; }
.tsi-lb-table td.tsi-lb-col-lh { text-align: center; }

/* Position badges */
.tsi-lb-pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    background: #f3f4f6;
    color: #6b7280;
}
.tsi-lb-pos-1 { background: #fef3c7; color: #92400e; }
.tsi-lb-pos-2 { background: #f1f5f9; color: #475569; }
.tsi-lb-pos-3 { background: #fff7ed; color: #9a3412; }

/* Releases pill */
.tsi-lb-releases {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

/* Total row */
.tsi-lb-total-row td {
    padding: 12px 16px;
    background: #f8faff;
    border-top: 2px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: left;
}
.tsi-lb-total-row .tsi-lb-col-rel {
    text-align: center;
}
.tsi-lb-total-row strong {
    font-size: 16px;
    color: #1a56db;
}

/* Empty states */
.tsi-lb-empty,
.tsi-lb-no-data {
    text-align: center;
    color: #9ca3af;
    padding: 32px 16px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .tsi-lb-day-btn { padding: 10px 14px; font-size: 13px; }
    .tsi-lb-table td, .tsi-lb-table th { padding: 10px 12px; }
    .tsi-lb-col-lh { display: none; }
    .tsi-lb-table th.tsi-lb-col-lh { display: none; }
}
