/**
 * BSkyCheck Lists Page Styles
 */

:root {
    --primary-color: rgb(10, 122, 252);
    --primary-light: rgb(88, 185, 253);
    --primary-dark: rgb(8, 98, 202);
    --secondary-color: rgb(88, 185, 253);
    --text-color: #444444;
    --text-light: #666666;
    --text-dark: #222222;
    --bg-gradient-start: rgb(10, 122, 252);
    --bg-gradient-end: rgb(88, 185, 253);
    --card-bg: #ffffff;
    --card-border: rgba(230, 230, 230, 0.8);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-light: rgba(255, 255, 255, 0.2);
    --border-medium: rgba(0, 0, 0, 0.1);
    --accent-green: #17bf63;
    --accent-red: #e0245e;
    --section-bg: #f8f9fa;
    --chart-bg: rgba(240, 247, 255, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-color);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ======================================
   LAYOUT
   ====================================== */
.container {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
}

.content-section {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.content-section.active {
    display: flex;
}

/* ======================================
   HEADER & NAV
   ====================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 15px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container img {
    height: 45px;
    width: auto;
}

.title {
    font-size: 22px;
    font-weight: bold;
    color: white;
    margin: 0;
}

.main-nav {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link svg {
    transition: transform 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link:hover svg {
    transform: translateY(-2px);
}

.nav-item.active .nav-link {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

.mobile-menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px 0;
    background-color: white;
    transition: all 0.3s ease;
}

/* ======================================
   SECTION TOGGLE (Sub-navigation)
   ====================================== */
.section-toggle-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
}

.section-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    flex: 1;
}

.section-toggle-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.section-toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(10, 122, 252, 0.3);
    pointer-events: none;
}

.section-toggle-btn.active:hover {
    background-color: var(--primary-dark);
}

.section-toggle-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ======================================
   CARDS
   ====================================== */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.full-card {
    width: 100%;
    min-height: 0;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    background-color: var(--section-bg);
    flex-shrink: 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.card-content {
    padding: 20px;
}

.lists-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ======================================
   LIVE DOT & COUNTER
   ====================================== */
.live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #e0245e;
    border-radius: 50%;
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(224, 36, 94, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(224, 36, 94, 0); }
}

.live-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-light);
    margin-left: auto;
}

/* ======================================
   LIVE TABLE
   ====================================== */
.live-table-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.live-table-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px 15px;
    min-height: 0;
    max-height: 900px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table tr {
    height: 48px;
    max-height: 48px;
    min-height: 48px;
    transition: background-color 0.2s;
}

.data-table tr:hover {
    background-color: var(--chart-bg);
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:nth-child(even):hover {
    background-color: var(--chart-bg);
}

.data-table th {
    padding: 12px 10px;
    font-weight: 600;
    color: var(--text-dark);
    background-color: var(--section-bg);
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table td {
    padding: 8px 10px;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    line-height: 20px;
    height: 48px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================================
   USER CELL (Avatar + Name + Handle)
   ====================================== */
.user-cell {
    overflow: hidden;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.user-link:hover .user-display-name {
    color: var(--primary-color);
    text-decoration: underline;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.user-display-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.user-handle {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================================
   STREAM CELL
   ====================================== */
.stream-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.stream-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.no-stream {
    color: var(--text-light);
}

/* ======================================
   DESCRIPTION CELL
   ====================================== */
.description-column {
    text-align: left;
}

.description-cell {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================================
   PLATFORM CELL
   ====================================== */
.platform-column {
    text-align: center !important;
}

.platform-cell {
    text-align: center;
}

.platform-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.platform-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: transform 0.2s;
}

.platform-link:hover .platform-icon {
    transform: scale(1.15);
}

.platform-name {
    font-size: 12px;
    color: var(--text-light);
}

/* ======================================
   TIME CELL
   ====================================== */
.time-column {
    text-align: center !important;
}

.time-cell {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

/* ======================================
   BLUEFACTS ATTRIBUTION
   ====================================== */
.bluefacts-attribution {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
}

.bluefacts-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.2s;
}

.bluefacts-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.bluefacts-logo {
    height: 30px;
    width: auto;
}

/* ======================================
   LEADERBOARD TABLE
   ====================================== */
.leaderboard-table th {
    font-size: 13px;
}

.rank-column {
    text-align: center !important;
}

.rank-cell {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
}

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}

/* Gold / Silver / Bronze for top 3 */
.leaderboard-table tbody tr:nth-child(1) .rank-number {
    background: linear-gradient(135deg, #f9d423, #f5a623);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(245, 166, 35, 0.3);
}

.leaderboard-table tbody tr:nth-child(2) .rank-number {
    background: linear-gradient(135deg, #c0c0c0, #9a9a9a);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(154, 154, 154, 0.3);
}

.leaderboard-table tbody tr:nth-child(3) .rank-number {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(160, 82, 45, 0.3);
}

.num-column {
    text-align: right !important;
}

.num-cell {
    text-align: right;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--text-dark);
}

.growth-cell {
    font-weight: 500;
}

.growth-positive {
    color: var(--accent-green) !important;
    font-weight: 600;
}

.rank-up {
    color: var(--accent-green) !important;
    font-weight: 600;
}

.rank-down {
    color: var(--accent-red) !important;
    font-weight: 600;
}

.rank-neutral {
    color: #999;
}

/* ======================================
   NO DATA
   ====================================== */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

/* ======================================
   SCROLLBAR
   ====================================== */
.live-table-container::-webkit-scrollbar {
    width: 8px;
}

.live-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.live-table-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.live-table-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ======================================
   FOOTER
   ====================================== */
.footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

.footer-kofi {
    flex: 0 0 auto;
}

.footer-text {
    flex: 1 1 auto;
    text-align: center;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer img {
    height: 20px;
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-width: 992px) {
    .container {
        width: 95%;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        flex-direction: column;
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        padding: 8px;
        gap: 5px;
        z-index: 1000;
        min-width: 150px;
        transform: translateY(10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active, .nav-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        color: var(--text-color);
        padding: 10px 12px;
    }

    .nav-item.active .nav-link {
        background: var(--chart-bg);
        color: var(--primary-color);
        box-shadow: none;
    }

    .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .section-toggle-container {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    .section-toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: auto;
        flex: 1 1 auto;
    }

    .section-toggle-btn span {
        display: none;
    }

    .section-toggle-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 576px) {
    .container {
        width: 100%;
        padding: 10px;
        margin: 10px auto;
        margin-top: 40px;
    }

    .header {
        padding-bottom: 10px;
    }

    .logo-container img {
        height: 40px;
        width: auto;
    }

    .title {
        font-size: 18px;
    }

    .data-table td {
        padding: 6px 5px;
        font-size: 13px;
    }

    .data-table tr {
        height: 44px;
        min-height: 44px;
    }

    .user-avatar {
        width: 26px;
        height: 26px;
    }

    .user-avatar-placeholder {
        width: 26px;
        height: 26px;
    }

    .user-display-name {
        font-size: 13px;
    }

    .user-handle {
        display: none;
    }

    .stream-link {
        font-size: 12px;
    }

    .description-column,
    .description-cell {
        display: none;
    }

    .platform-icon {
        width: 18px;
        height: 18px;
    }

    .live-table-container {
        max-height: 500px;
    }

    .mobile-row-limited {
        display: none !important;
    }

    /* Leaderboard mobile adjustments */
    .bluefacts-attribution {
        flex-wrap: wrap;
        padding: 8px 12px;
        font-size: 12px;
    }

    .num-cell {
        font-size: 12px;
    }

    .rank-cell {
        font-size: 12px;
    }

    .leaderboard-table tbody tr:nth-child(1) .rank-number,
    .leaderboard-table tbody tr:nth-child(2) .rank-number,
    .leaderboard-table tbody tr:nth-child(3) .rank-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-kofi, .footer-text {
        margin-bottom: 10px;
        width: 100%;
    }
}
