/**
 * FC Partner - Activity Page Styling
 * Leaderboard table with dynamic columns and responsive layout
 *
 * @package FC_Partner
 * @since 0.9.84
 */

/* ========================================
   SCROLL CONTAINER
   (Enables page scrolling within FC's SPA)
   ======================================== */

.fc-activity-scroll-container {
    height: calc(100vh - 55px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
   LEADERBOARD TABLE
   ======================================== */

.fc-activity-table-wrap {
    background: var(--fcom-primary-bg, white);
    border-radius: 8px;
    margin: 0 8px;
    padding: 0;
}

.fc-activity-table-header {
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    border-bottom: 1px solid var(--fcom-primary-border, #e4e4e4);
}

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

.fc-activity-table th {
    text-align: left;
    padding: 12px 12px;
    border-bottom: 2px solid var(--fcom-primary-border, #e4e4e4);
    font-weight: 600;
    white-space: nowrap;
}

.fc-activity-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--fcom-primary-border, #e4e4e4);
    vertical-align: middle;
}

.fc-activity-table tbody tr:hover {
    background: var(--fcom-hover-bg, rgba(0, 0, 0, 0.02));
}

/* ========================================
   COLUMN STYLES
   ======================================== */

/* Rank column */
.fc-activity-col-rank {
    text-align: center !important;
    width: 50px;
    font-weight: 600;
    color: var(--fcom-text-secondary, #6b7280);
}

/* Member column */
.fc-activity-col-member {
    min-width: 150px;
}

.fc-activity-member-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Constrain UserAvatar to 40px (matches FC leaderboard) */
.fc-activity-member-cell .fcom_user_avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.fc-activity-member-cell .fcom_user_avatar img {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* Category columns */
.fc-activity-col-category {
    text-align: center !important;
    min-width: 70px;
}

/* Total column */
.fc-activity-col-total {
    text-align: right !important;
    font-weight: 700;
    min-width: 60px;
}

/* Tier column */
.fc-activity-col-tier {
    white-space: nowrap;
}

.fc-activity-tier {
    font-size: 13px;
}

/* ========================================
   SORTABLE COLUMN HEADERS
   ======================================== */

.fc-activity-col-sortable {
    cursor: pointer;
}

.fc-activity-col-sortable:hover {
    background: var(--fcom-hover-bg, rgba(0, 0, 0, 0.03));
}

th.fc-activity-col-sorted {
    border-bottom-color: var(--fcom-primary-color, #4f46e5);
}

/* ========================================
   TWO-LINE COLUMN HEADERS
   ======================================== */

th.fc-activity-col-category {
    vertical-align: bottom;
}

.fc-activity-cat-name {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    white-space: normal;
}

.fc-activity-cat-points {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
    line-height: 1.3;
}

/* ========================================
   HERO — Two-column table layout (1000px = leaderboard width)
   ======================================== */

.fc-boards-hero {
    width: 1000px;
    margin: 0 auto 15px;
    border-collapse: collapse;
}

.fc-boards-hero td {
    border: none;
    padding: 20px 0;
    vertical-align: middle;
}

.fc-boards-hero-left {
    text-align: left;
    vertical-align: top;
}

.fc-boards-hero-right {
    text-align: right;
}

.fc-boards-hero-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px;
}

.fc-boards-hero-subtitle {
    font-size: 17px;
    margin: 12px 0 0;
    color: var(--fcom-secondary-text, #666666);
    line-height: 1.5;
}

.fc-boards-hero-count {
    font-size: 16px;
    margin: 12px 0 0;
}

/* ========================================
   TIER BANNER (card style — matches fcom_box_list)
   ======================================== */

.fc-boards-tier-banner {
    background: var(--fcom-primary-bg, white);
    border-radius: 8px;
}

.fc-boards-tier-banner-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    padding: 10px 20px;
    border-bottom: 1px solid var(--fcom-primary-border, #e4e4e4);
    text-align: left;
}

.fc-boards-tier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fc-boards-tier-table td {
    padding: 8px 20px;
    border-bottom: 1px solid var(--fcom-primary-border, #e4e4e4);
    vertical-align: middle;
}

.fc-boards-tier-table tr:last-child td {
    border-bottom: none;
}

.fc-boards-tier-table-emoji {
    width: 36px;
    text-align: center;
    font-size: 18px;
    padding-left: 20px;
    padding-right: 0;
}

.fc-boards-tier-table-name {
    font-weight: 500;
}

.fc-boards-tier-table-points {
    text-align: right;
    color: var(--fcom-secondary-text, #666666);
    font-size: 13px;
    padding-right: 20px;
}

/* ========================================
   TIME-WINDOW TABS (v0.9.97)
   ======================================== */

.fc-activity-window-tabs {
    display: flex;
    gap: 0;
    padding: 0 12px;
    border-bottom: 1px solid var(--fcom-primary-border, #e4e4e4);
}

.fc-activity-window-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--fcom-secondary-text, #666666);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.fc-activity-window-tab:hover {
    color: var(--fcom-primary-text, #111);
}

.fc-activity-window-tab-active {
    color: var(--fcom-primary-color, #4f46e5);
    border-bottom-color: var(--fcom-primary-color, #4f46e5);
}

.fc-activity-window-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fc-activity-window-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

/* ========================================
   EMPTY & LOADING STATES
   ======================================== */

.fc-activity-empty {
    text-align: center;
    padding: 48px 16px;
    opacity: 0.6;
}

.fc-activity-loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fc-scroll-trigger {
    height: 1px;
}

/* ========================================
   RESPONSIVE — HIDE CATEGORIES ON MOBILE
   ======================================== */

@media (max-width: 768px) {
    .fc-boards-hero {
        width: 100%;
    }

    .fc-activity-col-category {
        display: none;
    }

    .fc-activity-table-wrap {
        margin: 0 4px;
    }

    .fc-activity-col-rank {
        width: 36px;
    }

    .fc-activity-table {
        font-size: 13px;
    }

    .fc-activity-table th,
    .fc-activity-table td {
        padding: 8px 6px;
    }
}
