/* ===================================
   SIDEBAR BẢNG XẾP HẠNG STYLES
   =================================== */

.sidebar-bxh-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== LEAGUE SELECT ========== */
.sidebar-league-select {
    position: relative;
    margin-bottom: 16px;
}

.sidebar-league-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 5px;
    background: #2e2f31;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-height: auto;
    line-height: 1;
    margin-bottom: 5px;
    transition: background 0.2s;
}

.sidebar-league-select-btn:hover {
    background: #3a3b3d;
}

.sidebar-league-select-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-league-flag {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
}

.sidebar-league-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.sidebar-select-arrow {
    color: #ffffff;
    transition: transform 0.2s;
}

.sidebar-league-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #2e2f31;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
}

.sidebar-league-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-league-option:hover {
    background: #3a3b3d;
}

.sidebar-league-option.active {
    background: #c70137;
}

/* ========== TABLE ========== */
.sidebar-standings-table {
    display: flex;
    flex-direction: column;
}

.sidebar-table-header {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 2px solid #e5e7eb;
}

.sidebar-table-row {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s;
}

.sidebar-table-row:hover {
    background: #f8f9fa !important;
}

.sidebar-table-row:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

/* ========== COLUMNS ========== */
.sidebar-col-rank {
    width: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6b7280;
}

.sidebar-col-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 0 4px;
}

.sidebar-col-stat {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #4b5563;
}

.sidebar-col-points {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== TEAM ELEMENTS ========== */
.sidebar-team-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-team-name {
    font-size: 12px;
    color: #1f2937;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== BADGES ========== */
.sidebar-rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-points-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

/* ========== LOADING STATE ========== */
#sidebarLoading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.sidebar-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #5793fc;
    border-radius: 50%;
    animation: sidebar-spin 0.8s linear infinite;
}

@keyframes sidebar-spin {
    to { transform: rotate(360deg); }
}

.sidebar-empty {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
    font-size: 14px;
}

/* ========== HEADER TEXT ========== */
.sidebar-table-header .sidebar-col-rank,
.sidebar-table-header .sidebar-col-stat,
.sidebar-table-header .sidebar-col-points {
    color: #9ca3af;
    font-weight: 500;
    font-size: 11px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {

    .sidebar-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .sidebar-team-name {
        font-size: 11px;
    }

    .sidebar-col-stat {
        font-size: 10px;
        width: 24px;
    }

    .sidebar-points-badge {
        font-size: 11px;
        min-width: 24px;
        height: 20px;
    }
}
