/* Enhanced Leaderboard Styles */

/* Stat Box Styles */
.stat-box {
    background: linear-gradient(145deg, rgba(15, 25, 35, 0.8), rgba(30, 40, 50, 0.5));
    border-radius: 8px;
    padding: 1.25rem;
    height: 100%;
    transition: all 0.3s ease;
    border-left: 3px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.stat-box:nth-child(1) { animation-delay: 0.1s; }
.stat-box:nth-child(2) { animation-delay: 0.2s; }
.stat-box:nth-child(3) { animation-delay: 0.3s; }
.stat-box:nth-child(4) { animation-delay: 0.4s; }

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.stat-content {
    width: 100%;
    text-align: center;
}

.stat-content i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    animation: pulse 2s infinite;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--light);
    font-family: var(--font-primary);
}

.stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    font-weight: 600;
}

/* Filter Section Styles */
.leaderboard-filters {
    background: linear-gradient(145deg, rgba(15, 25, 35, 0.9), rgba(30, 40, 50, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.6s ease forwards;
}

.leaderboard-filters .form-label {
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.leaderboard-filters .form-select,
.leaderboard-filters .form-control {
    background-color: rgba(15, 25, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light);
    height: 45px;
    font-size: 0.95rem;
}

.leaderboard-filters .form-select:focus,
.leaderboard-filters .form-control:focus {
    background-color: rgba(20, 30, 40, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 199, 0, 0.15);
}

.leaderboard-filters .input-group-text {
    background-color: rgba(15, 25, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.leaderboard-filters .btn {
    height: 45px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.leaderboard-filters .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
}

.leaderboard-filters .btn:hover::before {
    left: 100%;
}

.leaderboard-filters .btn i {
    transition: transform 0.3s ease;
}

.leaderboard-filters .btn:hover i {
    transform: translateX(-3px);
}

/* Table container styling */
.leaderboard-table-container {
    background: #111720;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Basic table styling */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #151c25;
    margin: 0;
    padding: 0;
}

/* Table header */
.leaderboard-table .table-header th {
    background-color: #111720;
    color: #ffc700;
    padding: 15px 10px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #ffc700;
}

/* Table rows */
.leaderboard-table .table-row {
    height: 70px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.leaderboard-table .odd-row {
    background-color: #1a212b;
}

.leaderboard-table .even-row {
    background-color: #151c25;
}

.leaderboard-table .table-row:hover {
    background-color: rgba(30, 40, 50, 0.5);
}

/* Table cells */
.leaderboard-table td {
    padding: 10px;
    vertical-align: middle;
}

/* Rank badge styling */
.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto;
    font-size: 1.1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    color: #0f1923;
}

.rank-badge.rank-1 {
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rank-badge.rank-2 {
    background: #c0c0c0;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.rank-badge.rank-3 {
    background: #cd7f32;
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}

.rank-badge.rank-other {
    background: rgba(15, 25, 35, 0.7);
    color: white;
}

/* Player info styling */
.player-content {
    display: flex;
    align-items: center;
}

.player-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: rgba(15, 25, 35, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc700;
    border: 1px solid #ffc700;
    margin-right: 12px;
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.15rem;
    color: white;
}

.player-uid {
    font-size: 0.85rem;
    color: #8b939c;
}

/* Mission info styling */
.mission-info {
    display: flex;
    flex-direction: column;
}

.mission-name {
    font-weight: 600;
    margin-bottom: 0.15rem;
    color: #ffc700;
}

.mission-desc {
    font-size: 0.85rem;
    color: #8b939c;
}

/* Video proof button */
.video-proof-btn {
    padding: 0.35rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 30px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    background: rgba(255, 199, 0, 0.15);
    border: 1px solid #ffc700;
    color: #ffc700;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    min-width: 90px;
    justify-content: center;
}

.video-proof-btn i {
    margin-right: 5px;
    font-size: 0.85rem;
}

/* Wins column styling */
.total-wins {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ff8c;
    text-shadow: 0 0 5px rgba(0, 255, 140, 0.3);
}

/* Completed date column */
.leaderboard-table td:nth-child(4) {
    color: var(--light);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Player Profile Modal */
.player-profile-modal .modal-content {
    background: linear-gradient(145deg, rgba(15, 25, 35, 0.95), rgba(30, 40, 50, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease forwards;
}

.player-profile-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player-profile-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.player-profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, rgba(30, 40, 50, 0.7), rgba(15, 25, 35, 0.5));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    animation: spin 0.8s ease forwards;
}

.player-profile-avatar i {
    font-size: 2rem;
    color: var(--primary);
}

.player-profile-details {
    display: flex;
    flex-direction: column;
    animation: fadeInRight 0.5s ease forwards;
    opacity: 0;
    transform: translateX(-10px);
}

.player-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.player-profile-uid {
    font-size: 0.9rem;
    color: var(--gray);
}

.player-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.player-stat-item {
    background: rgba(15, 25, 35, 0.5);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.player-stat-item:nth-child(1) { animation-delay: 0.1s; }
.player-stat-item:nth-child(2) { animation-delay: 0.2s; }
.player-stat-item:nth-child(3) { animation-delay: 0.3s; }
.player-stat-item:nth-child(4) { animation-delay: 0.4s; }
.player-stat-item:nth-child(5) { animation-delay: 0.5s; }
.player-stat-item:nth-child(6) { animation-delay: 0.6s; }

.player-stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.player-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
}

.recent-activity {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.6s;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(-30deg) scale(0.8);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .player-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .leaderboard-table thead th,
    .leaderboard-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .video-proof-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .leaderboard-filters form {
        flex-direction: column;
    }
    
    .leaderboard-filters .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .player-stat-grid {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-table-container {
        overflow-x: auto;
    }
    
    .leaderboard-table {
        min-width: 800px;
    }
}

@media (max-width: 576px) {
    .stat-content i {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* Pagination and Results Info */
.results-info {
    font-size: 0.9rem;
    color: var(--light);
    padding: 0.5rem 0;
}

.pagination {
    margin-bottom: 0;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--dark);
    font-weight: 600;
}

.pagination .page-link {
    background: rgba(15, 25, 35, 0.5);
    color: var(--light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 0.85rem;
}

.pagination .page-link:hover {
    background: rgba(255, 199, 0, 0.2);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
    background: rgba(15, 25, 35, 0.3);
    color: rgba(255, 255, 255, 0.4);
    border-color: transparent;
}

/* Direct targeting of the leaderboard table */
#leaderboardTable {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    box-sizing: border-box;
}

#leaderboardTable th,
#leaderboardTable td {
    overflow: hidden;
    white-space: normal;
}

#leaderboardTable th.rank-column,
#leaderboardTable td.rank-cell {
    width: 10%;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

#leaderboardTable th.player-column,
#leaderboardTable td.player-cell {
    width: 25%;
    padding: 0.75rem;
    text-align: left;
}

#leaderboardTable th.mission-column,
#leaderboardTable td.mission-cell {
    width: 25%;
    padding: 0.75rem;
    text-align: left;
}

#leaderboardTable th.completed-column,
#leaderboardTable td.completed-cell {
    width: 15%;
    padding: 0.75rem;
    text-align: center;
}

#leaderboardTable th.proof-column,
#leaderboardTable td.proof-cell {
    width: 15%;
    padding: 0.75rem;
    text-align: center;
}

#leaderboardTable th.wins-column,
#leaderboardTable td.wins-cell {
    width: 10%;
    padding: 0.75rem;
    text-align: center;
} 