/* Background for CSBattle page */
body.cs-battle-page {
    position: relative;
    min-height: 100vh;
}

body.cs-battle-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/csbattle-bg.png') no-repeat center center;
    background-size: cover;
    z-index: -1; /* Menaikkan z-index untuk memastikan background terlihat */
}



/* Sticky Menu */
.sticky-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-family: 'Gabarito', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--accent-1);
}

.menu-toggle i {
    font-size: 16px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.sticky-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-1);
}

.dropdown-menu a i {
    width: 20px;
    text-align: center;
}

.menu-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 5px;
}

.promo-code {
    color: var(--accent-1);
    text-decoration: none;
    transition: all 0.2s ease;
}

.promo-code:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Logo Animation */
@keyframes colorSlide {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes wave {
    0% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

.logo-huntrez {
    display: inline-block;
    position: relative;
    color: var(--accent-1);
    background: linear-gradient(90deg, #00efff, #ff00b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(0, 239, 255, 0.5);
    animation: colorSlide 5s infinite alternate, wave 3s ease-in-out infinite;
    line-height: 1;
    transform-origin: center;
}

.logo-rewards {
    display: inline-block;
    color: var(--text-light);
    text-shadow: 0 0 10px rgba(255, 0, 184, 0.5);
    line-height: 1;
    margin-top: -0.5rem;
}

/* Header with Logs */
.logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 0 15px;
}

.header-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
    transition: all 0.3s ease;
}

.csbattle-logo {
    height: 80px;
    max-width: 100%;
    transition: all 0.3s ease;
}

.logo-separator {
    font-size: 2rem;
    color: var(--accent-1);
    margin: 0 20px;
    position: relative;
    top: 4px;
    opacity: 0.9;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-separator:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .podium-item {
        padding: 20px 15px;
    }
    
    .podium-avatar {
        width: 120px;
        height: 120px;
    }
    
    .first-place .podium-avatar {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 992px) {
    .logo-separator {
        font-size: 1.8rem;
        margin: 0 15px;
        top: 2px;
    }
    
    .header-logo {
        height: 90px;
    }
    
    .csbattle-logo {
        height: 70px;
    }
}

@media (max-width: 768px) {
    .logo-title {
        gap: 10px;
    }
    
    .logo-separator {
        font-size: 4rem;
        margin: 0 10px;
        top: -5px;
    }
    
    .header-logo {
        height: 70px;
    }
    
    .csbattle-logo {
        height: 60px;
    }
}

@media (max-width: 576px) {
    .logo-title {
        flex-direction: column;
        gap: 5px;
    }
    
    .logo-separator {
        font-size: 2.5rem;
        margin: 10px 0;
        transform: none;
        top: 0;
    }
    
    .header-logo {
        height: 80px;
    }
    
    .csbattle-logo {
        height: 70px;
    }
}

/* Leaderboard Section */
.leaderboard-section {
    padding: 80px 0;
    background: var(--bg-gradient);
    min-height: 100vh;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.leaderboard-header h1 {
    margin-bottom: 10px;
}

.leaderboard-header h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 30px;
    font-weight: 600;
}

.leaderboard-note {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-1);
    padding: 15px 20px;
    margin: 0 auto 30px;
    max-width: 800px;
    border-radius: 0 8px 8px 0;
}

.leaderboard-note p {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

.leaderboard-note strong {
    color: var(--accent-1);
    font-weight: 600;
}

/* Countdown Timer */
.countdown-container {
    margin: 30px 0 40px;
}

.countdown-container p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.countdown-item span:first-child {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-1);
    font-family: 'Bubblegum Sans', cursive;
    line-height: 1;
    margin-bottom: 5px;
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.countdown-separator {
    font-size: 2rem;
    color: var(--accent-1);
    margin: 0 5px;
    line-height: 1;
    position: relative;
    top: -5px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.loading-spinner .fa-spinner {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--accent-1);
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    padding: 30px 0;
    color: #ff6b6b;
    font-size: 1.1rem;
}

.error-message .fa-exclamation-circle {
    margin-right: 8px;
    font-size: 1.3rem;
}

/* Last Updated */
.last-updated {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
    font-style: italic;
    opacity: 0.8;
}

/* Player Info Styles */
.player-cell {
    padding: 10px 15px !important;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.player-avatar:hover {
    transform: scale(1.1);
    border-color: var(--accent-1);
}

.player-name {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.2s ease;
}

tr:hover .player-name {
    color: var(--accent-1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .player-avatar {
        width: 32px;
        height: 32px;
    }
    
    .player-info {
        gap: 8px;
    }
}

/* Podium Styles */
.podium-container {
    margin: 40px 0 60px;
    padding: 0 20px;
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding-top: 60px;
}

/* Crown Styles */
.podium-crown {
    position: absolute;
    top: -30px;
    font-size: 0;
    transition: all 0.3s ease;
    z-index: 10;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.podium-crown i {
    font-size: 2.5rem;
}

.podium-crown .gold { color: #ffd700; }
.podium-crown .silver { color: #c0c0c0; }
.podium-crown .bronze { color: #cd7f32; }

/* Spin Animation */
@keyframes spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.spin {
    animation: spin 3s linear infinite;
    display: inline-block;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    padding: 0 10px;
}

.podium-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-1);
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.podium-avatar {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    overflow: hidden;
    border: 4px solid;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.podium-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.podium-details {
    text-align: center;
    margin-top: 10px;
}

.podium-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.podium-wagered {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 2px 0;
}

.podium-prize {
    font-size: 1rem;
    font-weight: 700;
    color: #ffd700;
    margin-top: 5px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.second-place .podium-prize {
    color: #c0c0c0;
    text-shadow: 0 0 5px rgba(192, 192, 192, 0.5);
}

.third-place .podium-prize {
    color: #cd7f32;
    text-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
}

/* Podium Positions */
.first-place {
    order: 2;
    z-index: 3;
    transform: translateY(-20px);
}

.first-place .podium-avatar {
    width: 160px;
    height: 160px;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    transform: scale(1);
    transition: all 0.3s ease;
}

.first-place:hover .podium-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.7);
}

.first-place .podium-rank {
    font-size: 1.8rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.first-place .podium-crown {
    top: -40px;
}

.first-place .podium-crown i {
    font-size: 3.5rem;
}

.second-place {
    order: 1;
    z-index: 2;
    transform: translateY(0);
}

.second-place .podium-avatar {
    width: 140px;
    height: 140px;
    border-color: #c0c0c0;
    box-shadow: 0 0 25px rgba(192, 192, 192, 0.4);
}

.second-place .podium-rank {
    color: #c0c0c0;
    font-size: 1.6rem;
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.second-place .podium-crown {
    top: -35px;
}

.second-place .podium-crown i {
    font-size: 3rem;
}

.third-place {
    order: 3;
    z-index: 1;
    transform: translateY(10px);
}

.third-place .podium-avatar {
    width: 140px;
    height: 140px;
    border-color: #cd7f32;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.4);
    transition: all 0.3s ease;
}

.third-place:hover .podium-avatar {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(205, 127, 50, 0.6);
}

.third-place .podium-rank {
    color: #cd7f32;
    font-size: 1.6rem;
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}

.third-place .podium-crown {
    top: -35px;
}

.third-place .podium-crown i {
    font-size: 3rem;
}

/* Add glow effect on hover */
.podium-item:hover .podium-crown {
    filter: drop-shadow(0 0 8px currentColor) brightness(1.2);
}

/* Add subtle pulse animation to first place crown */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.first-place .podium-crown i {
    animation: pulse 2s infinite ease-in-out;
}

/* Hover Effects */
.podium-item:hover {
    transform: translateY(-5px);
}

.podium-item:hover .podium-avatar {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Stack podium items vertically in rank order */
    .podium {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .podium-item {
        width: 100%;
        max-width: 350px;
        margin: 5px 0;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        padding: 15px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    .podium-rank {
        font-size: 1.5rem;
        margin-right: 15px;
        min-width: 40px;
    }
    
    .podium-avatar {
        width: 70px !important;
        height: 70px !important;
        margin-right: 15px;
    }
    
    .podium-details {
        text-align: left;
        flex-grow: 1;
    }
    
    .podium-name {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }
    
    .podium-wagered, .podium-prize {
        font-size: 0.9rem;
        margin: 2px 0;
    }
    
    .podium-crown {
        display: none;
    }
    
    /* Adjust podium item orders */
    .first-place {
        order: 1;
        transform: none;
        border-left: 4px solid #ffd700;
    }
    
    .second-place {
        order: 2;
        border-left: 4px solid #c0c0c0;
    }
    
    .third-place {
        order: 3;
        border-left: 4px solid #cd7f32;
    }
    
    .leaderboard-header h2 {
        font-size: 1.5rem;
        padding: 0 15px;
    }
    
    .leaderboard-note p {
        padding: 0 15px;
    }
    
    .countdown-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .countdown {
        justify-content: center;
    }
    
    .podium-avatar {
        width: 60px !important;
        height: 60px !important;
    }
    
    .first-place .podium-avatar {
        width: 80px !important;
        height: 80px !important;
    }
    
    .podium-name {
        font-size: 0.9rem;
        max-width: 100px;
    }
    
    .podium-wagered {
        font-size: 0.85rem;
    }
}

/* Leaderboard Table */
.leaderboard-container {
    background: rgba(15, 15, 30, 0.7);
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1000px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Table Structure */
.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin: 0;
    padding: 0;
}

/* Table Header */
.leaderboard-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(5px);
    padding: 15px 8px;
    font-weight: 600;
    color: var(--accent-1);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* Table Rows */
.leaderboard-table tbody tr {
    transition: all 0.2s ease;
}

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

/* Table Cells */
.leaderboard-table tbody td {
    padding: 15px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    transition: all 0.2s ease;
    color: var(--text-color);
}

/* Column Specific Styling */
/* Rank Column */
.leaderboard-table thead th:first-child,
.leaderboard-table tbody td:first-child {
    width: 60px;
    padding: 15px 0;
    text-align: center;
}

/* Player Column */
.leaderboard-table thead th:nth-child(2),
.leaderboard-table tbody td:nth-child(2) {
    padding: 15px 0 15px 0;
    min-width: 200px;
    max-width: 300px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Wagered Column */
.leaderboard-table thead th:nth-child(3),
.leaderboard-table tbody td:nth-child(3) {
    text-align: right;
    padding: 15px 0;
    white-space: nowrap;
    min-width: 120px;
}

/* Prize Column */
.leaderboard-table thead th:last-child,
.leaderboard-table tbody td:last-child {
    min-width: 150px;
    text-align: right;
    padding: 15px 0 15px 15px;
    white-space: nowrap;
}

/* Wagered and Prize Cells */
.leaderboard-table td:nth-last-child(-n+2) {
    text-align: right;
    white-space: nowrap;
}

/* Text alignment for right-aligned columns */
.text-right {
    text-align: right;
}

/* Coin Icon */
.coin-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    position: relative;
    top: -1px;
}

/* Podium prize */
.podium-prize {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Podium prize coin icon */
.podium-prize .coin-icon {
    width: 20px;
    height: 20px;
}

/* Header specific styles */
.leaderboard-table thead th:first-child {
    text-align: center;
    padding: 15px 0;
}

.leaderboard-table thead th:nth-child(2) {
    text-align: left;
    padding-left: 0;
}

.leaderboard-table thead th:nth-child(3),
.leaderboard-table thead th:last-child {
    text-align: right;
    padding-right: 0;
}

.leaderboard-table tbody td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    transition: all 0.2s ease;
}

/* Adjust specific columns */
.leaderboard-table thead th:first-child,
.leaderboard-table tbody td:first-child {
    padding-right: 0;
    width: 60px;
    text-align: center;
}

.leaderboard-table thead th:nth-child(2),
.leaderboard-table tbody td:nth-child(2) {
    padding-left: 0;
    min-width: 200px;
}

.leaderboard-table thead th:nth-child(3),
.leaderboard-table tbody td:nth-child(3) {
    text-align: right;
    padding-right: 0;
    white-space: nowrap;
}

.leaderboard-table thead th:last-child,
.leaderboard-table tbody td:last-child {
    text-align: right;
    padding-left: 8px;
    min-width: 120px;
    white-space: nowrap;
    color: var(--text-color);
}

.player-cell {
    padding: 10px 0 !important;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .leaderboard-header h1 {
        font-size: 2.2rem;
    }
    
    .leaderboard-header h2 {
        font-size: 1.4rem;
    }
    
    .countdown-item {
        min-width: 60px;
    }
    
    .countdown-item span:first-child {
        font-size: 2rem;
    }
    
    .countdown-separator {
        font-size: 1.5rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 15px;
    }
}

@media (max-width: 576px) {
    .logo-title {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-separator {
        margin: 10px 0;
    }
    
    .header-logo, .csbattle-logo {
        height: 70px;
    }
    
    .leaderboard-header h2 {
        font-size: 1.3rem;
        line-height: 1.4;
    }
    
    .leaderboard-note p {
        font-size: 0.9rem;
    }
    
    .countdown-item {
        min-width: 50px;
    }
    
    .countdown-separator {
        margin: 0 5px;
    }
    
    .countdown-label {
        font-size: 0.7rem;
    }
    
    .second-place, .third-place {
        width: 100%;
        display: block;
        margin: 10px 0;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }
    
    .player-avatar {
        width: 30px;
        height: 30px;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .coin-icon {
        width: 14px;
        height: 14px;
    }
    
    .leaderboard-header h2 {
        font-size: 1.2rem;
    }
    
    .countdown {
        gap: 8px;
    }
    
    .countdown-item {
        min-width: 50px;
    }
    
    .countdown-item span:first-child {
        font-size: 1.5rem;
    }
    
    .countdown-label {
        font-size: 0.7rem;
    }
    
    .countdown-separator {
        font-size: 1.2rem;
        top: -3px;
    }
}
