/* General Styles */
body {
    background-color: #0a0f16;
    color: #f3f4f6;
    font-family: 'Share Tech Mono', monospace;
}

/* Cyber theme fonts */
.cyber-font {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

.cyber-glitch {
    font-family: 'Orbitron', sans-serif;
    position: relative;
    display: inline-block;
    letter-spacing: 2px;
    text-shadow: 
        0 0 5px rgba(10, 230, 116, 0.6),
        0 0 10px rgba(10, 230, 116, 0.4),
        0 0 15px rgba(10, 230, 116, 0.2);
}

.cyber-text-small {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #4ade80;
    letter-spacing: 1px;
}

.cyber-footer {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(10, 230, 116, 0.6);
}

/* Cyber grid background */
.cyber-grid {
    background-image: linear-gradient(rgba(18, 24, 33, 0.8) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(18, 24, 33, 0.8) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.15;
}

/* Cyber box with circuit-like border */
.cyber-box {
    position: relative;
    border: 1px solid rgba(74, 222, 128, 0.3);
    box-shadow: 
        0 0 10px rgba(10, 230, 116, 0.2),
        inset 0 0 15px rgba(10, 230, 116, 0.1);
}

.cyber-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(74, 222, 128, 0.5) 20%, 
        rgba(74, 222, 128, 0.8) 50%,
        rgba(74, 222, 128, 0.5) 80%,
        transparent 100%);
    animation: scan-line 3s linear infinite;
}

@keyframes scan-line {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Cyber badge for rankings */
.cyber-badge {
    position: relative;
    overflow: hidden;
}

.cyber-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: conic-gradient(
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent 30%
    );
    animation: rotate 4s linear infinite;
}

.cyber-small-badge {
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 5px rgba(34, 211, 238, 0.3);
}

/* Scanning effect */
.cyber-scan {
    height: 2px;
    width: 100%;
    background-color: rgba(74, 222, 128, 0.7);
    position: relative;
    margin: 0.5rem auto;
    max-width: 150px;
}

.cyber-scan::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: rgba(74, 222, 128, 0.9);
    top: -9px;
    left: 0;
    filter: blur(2px);
    animation: scan 2s cubic-bezier(0.77, 0, 0.18, 1) infinite;
}

@keyframes scan {
    0% { left: 0; }
    100% { left: calc(100% - 20px); }
}

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

/* Animation for rank changes */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.05); 
        background-color: rgba(34, 211, 238, 0.3);
        box-shadow: 0 0 15px rgba(34, 211, 238, 0.5); 
    }
    100% { transform: scale(1); }
}

.rank-row.highlight {
    animation: highlight 1s ease-in-out;
}

/* Top 3 positions special styling */
.shadow-glow-gold {
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.7);
}

.shadow-glow-silver {
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.7);
}

.shadow-glow-bronze {
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.7);
}

/* First place styling enhancements */
.first-place-row {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.2) 50%, rgba(16, 185, 129, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.first-place-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: rgba(74, 222, 128, 0.15);
    transform: skewX(-30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -150%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* Second place styling */
.second-place-row {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.1) 50%, rgba(59, 130, 246, 0.05) 100%);
}

/* Third place styling */
.third-place-row {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.05) 0%, rgba(147, 51, 234, 0.1) 50%, rgba(147, 51, 234, 0.05) 100%);
}

/* Table header styling */
.table-header {
    background: linear-gradient(90deg, rgba(11, 33, 20, 0.8) 0%, rgba(17, 52, 31, 0.9) 50%, rgba(11, 33, 20, 0.8) 100%);
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(74, 222, 128, 0.3);
    padding: 0.6rem 1rem;
    color: #4ade80;
    font-family: 'Orbitron', sans-serif;
}

/* Three.js container styling */
#three-container {
    opacity: 0.3;
    pointer-events: none;
}

/* Leaderboard container */
.leaderboard-container {
    height: calc(100vh - 230px); /* Adjust to fit viewport without scrolling */
    display: flex;
    flex-direction: column;
}

/* Leaderboard table styling */
.leaderboard-table {
    overflow: hidden;
    border: 1px solid rgba(74, 222, 128, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    flex: 1;
    width: 70rem;
}

.table-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Row hover effect */
.rank-row:hover:not(.first-place-row):not(.second-place-row):not(.third-place-row) {
    background-color: rgba(17, 52, 31, 0.5);
}

/* Row styling */
.rank-row {
    transition: all 0.2s ease;
    height: auto;
    padding: 0.4rem 0.7rem;
    border-left: 3px solid transparent;
}

.rank-row:hover {
    border-left: 3px solid rgba(74, 222, 128, 0.7);
}

.first-place-row, .second-place-row, .third-place-row {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.rank-row:not(:last-child) {
    border-bottom: 1px solid rgba(74, 222, 128, 0.15);
}

/* Adjust size of rank circles */
.w-14 {
    width: 2.8rem !important;
    height: 2.8rem !important;
}

.w-12 {
    width: 2.5rem !important;
    height: 2.5rem !important;
}

.w-10 {
    width: 2rem !important;
    height: 2rem !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .rank-number {
        width: 50px !important;
    }
    
    .points {
        width: 70px !important;
    }
    
    .w-14 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    .w-12 {
        width: 2.2rem !important;
        height: 2.2rem !important;
    }
    
    .w-10 {
        width: 1.8rem !important;
        height: 1.8rem !important;
    }
    
    .rank-row {
        padding: 0.3rem 0.5rem;
    }
    
    .leaderboard-container {
        height: calc(100vh - 200px);
    }
}

/* Pulsing status indicators */
.pulse-green {
    box-shadow: 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulse-green 2s infinite;
}

.pulse-yellow {
    box-shadow: 0 0 0 rgba(250, 204, 21, 0.7);
    animation: pulse-yellow 2s infinite;
}

.pulse-red {
    box-shadow: 0 0 0 rgba(248, 113, 113, 0.7);
    animation: pulse-red 1s infinite;
}

.pulse-blue {
    box-shadow: 0 0 0 rgba(96, 165, 250, 0.7);
    animation: pulse-blue 1.5s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(250, 204, 21, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(248, 113, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(96, 165, 250, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
    }
}

/* Status bar styling */
.cyber-status-bar {
    font-family: 'Share Tech Mono', monospace;
    background: rgba(10, 20, 15, 0.7);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 4px;
    padding: 3px 10px;
    position: relative;
    overflow: hidden;
}

.cyber-status-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 100%;
    background: linear-gradient(to right, 
        transparent, 
        rgba(74, 222, 128, 0.7), 
        transparent);
    animation: status-scan 2s infinite linear;
}

@keyframes status-scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Position change animations */
.moving-up {
    animation: moveUp 1s ease-in-out;
    z-index: 10;
    position: relative;
    background-color: rgba(74, 222, 128, 0.15);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

.moving-down {
    animation: moveDown 1s ease-in-out;
    z-index: 10;
    position: relative;
    background-color: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

@keyframes moveUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateY(0) scale(1.1);
        opacity: 1;
        background-color: rgba(74, 222, 128, 0.3);
    }
    40% {
        transform: translateY(-40px) scale(0.9);
        opacity: 0.3;
    }
    70% {
        transform: translateY(-20px) scale(1.05);
        opacity: 0.7;
        background-color: rgba(74, 222, 128, 0.25);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes moveDown {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateY(0) scale(1.1);
        opacity: 1;
        background-color: rgba(239, 68, 68, 0.3);
    }
    40% {
        transform: translateY(40px) scale(0.9);
        opacity: 0.3;
    }
    70% {
        transform: translateY(20px) scale(1.05);
        opacity: 0.7;
        background-color: rgba(239, 68, 68, 0.25);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Special animation for team rank changes inside badge */
.rank-change {
    position: relative;
    overflow: hidden;
    animation: pulseRank 0.8s ease-in-out;
}

@keyframes pulseRank {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }
    100% {
        transform: scale(1);
    }
}

.rank-change::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    opacity: 0;
    animation: pulseGlow 0.8s ease-in-out;
}

@keyframes pulseGlow {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
} 