/* csgoroll.css */
.leaderboard-page {
    min-height: calc(100vh - 250px);
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('../images/roll-lb-bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--light);
    padding-top: 80px; /* Add padding to prevent content from being hidden behind the header */
}

/* Adjust for mobile */
@media (max-width: 767.98px) {
    .leaderboard-page {
        padding-top: 60px;
    }
}

/* Leaderboard Title Logo */
.leaderboard-title-logo {
    height: 60px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
}

/* Responsive adjustments for title logo */
@media (max-width: 767.98px) {
    .leaderboard-title-logo {
        height: 30px;
    }
}

.countdown-container {
    margin: 2rem 0;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--dark2);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    min-width: 80px;
}

.countdown-item span:first-child {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--warning);
    line-height: 1;
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.countdown-separator {
    font-size: 1.5rem;
    color: var(--warning);
    margin: 0 -0.5rem;
    position: relative;
    top: -5px;
}

.leaderboard-note {
    max-width: 800px;
    margin: 0 auto;
    border-left: 3px solid var(--warning);
}

/* Leaderboard table container */
.leaderboard-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Hide scrollbar for Chrome, Safari and Opera */
.leaderboard-container::-webkit-scrollbar {
    height: 8px;
}

.leaderboard-container::-webkit-scrollbar-track {
    background: var(--dark3);
    border-radius: 4px;
}

.leaderboard-container::-webkit-scrollbar-thumb {
    background: var(--warning);
    border-radius: 4px;
}

/* For Firefox */
@-moz-document url-prefix() {
    .leaderboard-container {
        scrollbar-width: thin;
        scrollbar-color: var(--warning) var(--dark3);
    }
}

.leaderboard-table {
    background: var(--dark2);
    border-radius: 8px;
    width: 100%;
    min-width: 600px; /* Minimum width before scrolling kicks in */
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.leaderboard-table thead th {
    background: var(--dark3);
    color: var(--warning);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    border: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table header cells */
.leaderboard-table thead th:first-child {
    width: 80px; /* Rank column */
    min-width: 60px;
    padding: 1rem 0.75rem 1rem 1.5rem;
    position: sticky;
    left: 0;
    background: var(--dark3);
    z-index: 2;
}

.leaderboard-table thead th:nth-child(2) {
    min-width: 150px; /* Username column */
    text-align: left;
    padding: 1rem 0.75rem;
    white-space: nowrap;
}

.leaderboard-table thead th:nth-child(3) {
    min-width: 150px; /* Wagered column */
    text-align: right;
    padding: 1rem 1.5rem 1rem 0.75rem;
    white-space: nowrap;
}

.leaderboard-table thead th:last-child {
    min-width: 120px; /* Prize column */
    text-align: right;
    padding: 1rem 1.5rem 1rem 0.75rem;
    white-space: nowrap;
}

.leaderboard-note .text-muted {
    color: #b1b1b1 !important;
    font-weight: 500;
    font-style: italic;
    margin-left: 5px;
}

.leaderboard-table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-color: var(--dark3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    background: var(--dark2);
    transition: background-color 0.2s ease;
}

/* Make rank column sticky on mobile */
.leaderboard-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--dark2);
}

/* Add hover effect for better interaction */
.leaderboard-table tbody tr:hover td {
    background: rgba(255, 193, 7, 0.05);
}

.leaderboard-table tbody tr:hover td:first-child {
    background: var(--dark3);
}

/* Table body cells alignment */
.leaderboard-table tbody td:first-child {
    padding-left: 1.5rem;
    font-weight: 700;
}

.leaderboard-table tbody td:last-child {
    padding-right: 1.5rem;
    text-align: right;
    color: var(--warning);
    font-weight: 600;
}

.leaderboard-table tbody td:nth-child(3) {
    text-align: right;
    padding-right: 1.5rem;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .leaderboard-container {
        margin: 0 -15px;
        width: calc(100% + 30px);
        padding: 0 15px;
        box-sizing: content-box;
    }
    
    .leaderboard-table {
        min-width: 100%;
    }
    
    .leaderboard-table thead th:first-child,
    .leaderboard-table tbody td:first-child {
        position: sticky;
        left: 15px;
        z-index: 2;
    }
    
    .leaderboard-table thead th:first-child {
        left: 15px;
    }
}

.leaderboard-table tbody td.rank {
    font-weight: 700;
    color: var(--light);
    width: 80px;
}

.leaderboard-table tbody td.prize {
    color: var(--warning);
    font-weight: 600;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-note .text-muted {
    color: #b1b1b1 !important;
    font-weight: 500;
    font-style: italic;
    margin-left: 5px;
    opacity: 1 !important;
}

.coin-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin: 0 4px;
    position: relative;
    top: -2px;
}

/* Podium Styles */
.podium-container {
    margin: 2rem 0;
}

.podium-container .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
}

.podium-card {
    background: rgba(30, 30, 40, 0.9);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0 auto;
    max-width: 300px;
    width: 100%;
}

.podium-card.gold {
    transform: translateY(-20px);
    background: linear-gradient(145deg, rgba(255, 200, 0, 0.15), rgba(255, 150, 0, 0.15)), 
                linear-gradient(to bottom, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px rgba(255, 200, 0, 0.2);
}

.podium-card.silver {
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.1), rgba(160, 160, 160, 0.1)), 
                linear-gradient(to bottom, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.95));
    border: 1px solid rgba(192, 192, 192, 0.2);
}

.podium-card.bronze {
    background: linear-gradient(145deg, rgba(205, 127, 50, 0.1), rgba(184, 115, 51, 0.1)), 
                linear-gradient(to bottom, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.95));
    border: 1px solid rgba(205, 127, 50, 0.2);
}

.podium-rank {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.podium-card.gold .podium-rank {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    padding: 5px;
}

/* Avatar image styles */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Crown badge for 1st place */
.crown-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Prize badge in podium */
.prize-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-top: 6px;
    display: inline-block;
}

.podium-card.gold .prize-badge {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.podium-card.silver .prize-badge {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
}

.podium-card.bronze .prize-badge {
    background: rgba(205, 127, 50, 0.15);
    color: #cd7f32;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
}

.page-btn {
    background: rgba(30, 30, 40, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 12px;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 36px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 200, 0, 0.2);
    border-color: rgba(255, 200, 0, 0.3);
}

.page-btn.active {
    background: linear-gradient(135deg, #ffc800, #ff8a00);
    border-color: #ffc800;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-container span {
    color: #aaa;
    padding: 0 8px;
    user-select: none;
}

/* Player cell in the table */
.player-cell {
    display: flex;
    align-items: center;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Make sure the avatar in the table is properly sized */
.leaderboard-table .player-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.podium-card.gold .podium-avatar {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.podium-username {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.podium-wagered {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: auto;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.podium-rank {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.podium-card.gold .podium-rank {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.podium-card.silver .podium-rank {
    color: #c0c0c0;
}

.podium-card.bronze .podium-rank {
    color: #cd7f32;
}

/* Responsive adjustments */
/* Mobile styles for podium */
@media (max-width: 767.98px) {
    .podium-container {
        padding: 0 15px;
    }
    
    .podium-container .row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* Reset Bootstrap column styles and reorder for mobile */
    .podium-container .row > [class*='col-'] {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
        width: 100%;
        order: 2; /* Default order for silver and bronze */
    }
    
    /* Gold card (1st place) */
    .podium-container .row > [class*='col-']:nth-child(2) {
        order: 1; /* Move gold card to top */
    }
    
    .podium-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 1.5rem;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .podium-container .row {
        justify-content: center;
    }
    
    .podium-card {
        max-width: 300px;
    }
}
    
/* Tablet podium card order */
@media (min-width: 768px) and (max-width: 991.98px) {
    .podium-card.gold {
        transform: none;
        order: 1;
    }
    
    .podium-card.silver {
        order: 2;
    }
    
    .podium-card.bronze {
        order: 3;
    }
}

/* Podium avatar styles */
.podium-avatar {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
}

/* Podium username styles */
.podium-username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments for podium elements */
@media (max-width: 767.98px) {
    .podium-username {
        font-size: 1.2rem;
    }
    
    .podium-wagered {
        font-size: 1rem;
    }
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 193, 7, 0.05);
}

.leaderboard-table .rank {
    font-weight: 700;
    color: var(--light);
    width: 60px;
}

.leaderboard-table .prize {
    color: var(--warning);
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .countdown-item {
        padding: 0.5rem 0.75rem;
        min-width: 60px;
    }
    
    .countdown-item span:first-child {
        font-size: 1.25rem;
    }
    
    .countdown-label {
        font-size: 0.65rem;
    }
    
    .countdown-separator {
        font-size: 1.25rem;
        margin: 0 -0.25rem;
    }
    
    .leaderboard-table thead th,
    .leaderboard-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .leaderboard-table thead th:first-child,
    .leaderboard-table tbody td:first-child {
        padding-left: 0.75rem;
    }
    
    .leaderboard-table thead th:last-child,
    .leaderboard-table tbody td:last-child {
        padding-right: 0.75rem;
    }
    
    .player-avatar {
        width: 30px;
        height: 30px;
    }
    
    .player-cell span {
        font-size: 0.9rem;
    }
}