/* ========================================
   LOTTERY LEADERBOARD - TRANSPARENCY SYSTEM
   ======================================== */

/* Override Modal Size for Leaderboard */
#check-results-modal .lottery-modal-content {
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#check-results-modal .lottery-modal-body {
    max-height: calc(90vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* Custom Scrollbar for Modal Body */
#check-results-modal .lottery-modal-body::-webkit-scrollbar {
    width: 8px;
}

#check-results-modal .lottery-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#check-results-modal .lottery-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

#check-results-modal .lottery-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Leaderboard Header */
.leaderboard-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.lottery-week {
    font-size: 1rem;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: 0.5px;
}

.lottery-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.lottery-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.lottery-stats .stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lottery-stats .stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #ffd700;
}

/* Reveal Banner */
.reveal-banner {
    padding: 0.75rem 1.5rem;
    margin: 0.75rem 1rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.reveal-banner.pending {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
}

.reveal-banner.revealed {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    color: white;
}

.reveal-banner.closed {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

/* Leaderboard Container */
.leaderboard-container {
    overflow-y: visible;
    padding: 0.75rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Custom Scrollbar */
.leaderboard-container::-webkit-scrollbar {
    width: 10px;
}

.leaderboard-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
}

.leaderboard-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Header Row - Hidden for list layout */
.leaderboard-row.header {
    display: none;
}

/* My Tickets - Golden Border Highlight */
.leaderboard-row.my-ticket {
    border-left: 3px solid #d4af37;
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    animation: goldenPulse 3s ease-in-out infinite;
}

.leaderboard-row.my-ticket:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

@keyframes goldenPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.4);
    }
}

/* ========================================
   SECTION HEADERS & DIVIDERS
   ======================================== */

/* My Tickets Section */
.my-tickets-section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-left: 4px solid #d4af37;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.3));
}

.section-text {
    font-size: 1rem;
    font-weight: 600;
    color: #d4af37;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 0 1rem;
}

.divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 80%,
        transparent 100%
    );
}

.divider-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0 0.5rem;
}

/* All Tickets Section */
.all-tickets-section {
    position: relative;
}

.section-title-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.col-rank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 100px;
    flex-shrink: 0;
}

.rank-icon {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
}

.rank-number {
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.col-wallet {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.wallet-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.wallet-address:hover {
    color: #ffd700;
}

.col-numbers {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Numbers Display */
.numbers-display {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
}

.numbers-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.numbers-separator {
    width: 8px;
    height: 1px;
    background: rgba(255, 215, 0, 0.4);
    margin: 0 3px;
}

.ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.ball:hover {
    transform: scale(1.05);
}

/* Main Numbers - Purple Gradient */
.ball.main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Powerball - Pink/Red Gradient with Gold Border */
.ball.powerball {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: 3px solid #ffd700;
    animation: glow-powerball 2s ease-in-out infinite;
}

@keyframes glow-powerball {
    0%, 100% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                    0 0 15px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                    0 0 25px rgba(255, 215, 0, 0.8);
    }
}

/* Hidden Numbers - Dark Gray */
.ball.hidden-ball {
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.ball.powerball-hidden {
    border: 2px solid rgba(255, 215, 0, 0.3);
}

/* Hidden Hint Text */
.hidden-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 0.75rem;
    font-style: italic;
    white-space: nowrap;
}

/* Countdown Footer */
.countdown-footer {
    background: linear-gradient(135deg, #16213e 0%, #0f1419 100%);
    padding: 1rem 1.25rem;
    border-radius: 0 0 12px 12px;
    border-top: 2px solid rgba(255, 215, 0, 0.2);
}

.countdown-section {
    text-align: center;
}

.countdown-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    min-width: 50px;
}

.countdown-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Empty State */
.empty-leaderboard {
    text-align: center;
    padding: 3rem 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.buy-first-ticket-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-first-ticket-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

/* Loading State */
.leaderboard-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .leaderboard-row {
        gap: 1rem;
        padding: 1rem;
    }

    .ball {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
}

/* ========================================
   PAGINATION SYSTEM
   ======================================== */

.pagination-container {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #16213e 0%, #0f1419 100%);
    border-top: 2px solid rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pagination-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 1;
}

.pagination-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-number {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

.pagination-number.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ffd700;
    color: #1a1a2e;
    font-weight: 700;
    cursor: default;
}

.pagination-ellipsis {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .leaderboard-row {
        gap: 1rem;
        padding: 1rem;
    }

    .col-rank, .col-wallet, .col-numbers {
        justify-content: center;
        text-align: center;
    }

    .numbers-display {
        justify-content: center;
    }

    .lottery-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .countdown-display {
        gap: 1rem;
    }

    .countdown-value {
        font-size: 1.5rem;
        min-width: 50px;
        padding: 0.4rem 0.8rem;
    }

    /* Pagination responsive */
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-btn {
        width: 100%;
    }

    .pagination-numbers {
        order: -1;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .ball {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .leaderboard-container {
        max-height: 55vh;
    }

    .countdown-value {
        font-size: 1.25rem;
        min-width: 45px;
    }
}
