/* Add to the top of your leaderboard.css file */
:root {
  --glow-color: #d99f26;
  --dark-bg: #1a1a1a;
  --darker-bg: #000000;
  --highlight: #d99f26;
  --tech-lines: rgba(217, 159, 38, 0.2);
}

.leaderboard-container {
    max-width: 800px;
    width: 95%;
    margin: 20px auto;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(217, 159, 38, 0.3);
}

.leaderboard-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
  z-index: 1;
  animation: scanline 4s linear infinite;
}

.leaderboard-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(90deg, var(--tech-lines) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(0deg, var(--tech-lines) 1px, transparent 1px) 0 0 / 20px 20px;
  pointer-events: none;
  z-index: -1;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: relative;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(217, 159, 38, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leaderboard-tabs::before {
  content: 'DATA FILTER';
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--darker-bg);
  padding: 0 10px;
  font-size: 10px;
  color: var(--glow-color);
  letter-spacing: 1px;
}

.tab-btn {
    background: #333;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(51, 51, 51, 0.5);
}

.tab-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 70%);
  transform: rotate(45deg);
  animation: sheen 3s infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.tab-btn:hover::after {
  opacity: 1;
}

.tab-btn:hover {
    background: #444;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: #d99f26;
    color: #000000;
    transform: translateY(0);
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.5);
}

.leaderboard-table {
    background: #000000;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(217, 159, 38, 0.3);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.leaderboard-table::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  background: var(--glow-color);
  border-radius: 50%;
  animation: blink 2s infinite;
}

.leaderboard-header {
    display: flex;
    padding: 12px;
    background: linear-gradient(90deg, #222, #333, #222);
    font-weight: bold;
    border-bottom: 2px solid #d99f26;
    position: relative;
    overflow: hidden;
}

.leaderboard-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
}

.leaderboard-row {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid #333;
    align-items: center;
    transition: background-color 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideIn 0.3s ease forwards;
    position: relative;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: #222;
    border-left: 3px solid var(--glow-color);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.rank-column {
    width: 60px;
    font-weight: bold;
    color: #d99f26;
    position: relative;
    font-family: 'DM Sans', monospace;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(217, 159, 38, 0.5);
}

/* Special styling for top ranks */
.leaderboard-row:nth-child(1) .rank-column,
.leaderboard-row:nth-child(2) .rank-column,
.leaderboard-row:nth-child(3) .rank-column {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.player-column {
    flex: 1;
}

.score-column {
    width: 100px;
    text-align: right;
    font-weight: bold;
}

.details-column {
    width: 150px;
    text-align: center;
}

.date-column {
    width: 120px;
    text-align: right;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(217, 159, 38, 0.1);
    border-top: 2px solid var(--glow-color);
    border-right: 2px solid var(--glow-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.leaderboard-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.leaderboard-error {
    text-align: center;
    padding: 20px;
    color: #ff6b6b;
}

.retry-btn {
    background: #d99f26;
    color: #000000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.3);
}

.retry-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 70%);
  transform: rotate(45deg);
  animation: sheen 3s infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Add animation delay to rows */
.leaderboard-row:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-row:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-row:nth-child(3) { animation-delay: 0.3s; }
/* ... and so on */

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 1px solid rgba(217, 159, 38, 0.2);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.player-settings {
    background: #000000;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    position: relative;
    border: 1px solid rgba(217, 159, 38, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.player-settings::before {
  content: 'USER PROFILE';
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--darker-bg);
  padding: 0 10px;
  font-size: 10px;
  color: var(--glow-color);
  letter-spacing: 1px;
}

.display-name-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.display-name-input {
    background: linear-gradient(to right, rgba(26, 26, 26, 0.9), #1a1a1a);
    border: 1px solid #333;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    flex: 1;
    max-width: 300px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.display-name-input:focus {
  border-color: var(--glow-color);
  box-shadow: 0 0 10px rgba(217, 159, 38, 0.3);
  outline: none;
}

.save-name-btn {
    background: #d99f26;
    color: #000000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.3);
}

.save-name-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 70%);
  transform: rotate(45deg);
  animation: sheen 3s infinite;
}

.save-name-btn:hover {
    background: #ffffff;
    box-shadow: 0 0 15px rgba(217, 159, 38, 0.6);
}

.current-player {
    color: #d99f26;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(217, 159, 38, 0.5);
    position: relative;
    display: inline-block;
    padding-left: 15px;
}

.current-player::before {
  content: '▶';
  position: absolute;
  left: 0;
  font-size: 10px;
  top: 2px;
  animation: pulse 1.5s infinite;
}

/* Difficulty tabs styling */
.difficulty-tabs {
    display: flex;
    gap: 5px;
    margin: 5px 0 15px 0;
    flex-wrap: wrap;
    background: #111;
    padding: 8px;
    border-radius: 4px;
    position: relative;
    border: 1px solid rgba(217, 159, 38, 0.2);
}

.difficulty-tab-btn {
    background: #222;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.difficulty-tab-btn:hover {
    background: #333;
}

.difficulty-tab-btn.active {
    background: #d99f26;
    color: #000000;
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.4);
}

/* Add to leaderboard.css */
.difficulty-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    position: relative;
}

.difficulty-badge::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: pulseBadge 2s infinite;
}

.badge-brutal {
    background-color: #ff4d4d; /* Red for Brutal */
}

.badge-human {
    background-color: #4d94ff; /* Blue for Human */
}

.badge-forgiving {
    background-color: #4dff4d; /* Green for Forgiving */
}

.highlighted-row {
    background: linear-gradient(to right, rgba(217, 159, 38, 0.05), rgba(217, 159, 38, 0.1), rgba(217, 159, 38, 0.05));
    border-left: 3px solid var(--glow-color);
    position: relative;
}

.highlighted-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
}

.active-streak {
    color: #ffd700; /* Gold color */
    animation: pulse 2s infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    position: relative;
}

.active-streak::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffd700, transparent);
}

.empty-leaderboard {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    position: relative;
    border: 1px solid rgba(217, 159, 38, 0.1);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--glow-color);
    opacity: 0.3;
    filter: blur(1px);
    text-shadow: 0 0 15px var(--glow-color);
}

.empty-subtext {
    font-size: 14px;
    margin-top: 10px;
    opacity: 0.7;
}

.inactive-streak {
    color: #aaaaaa; /* Gray color */
}

/* Add animations */
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(calc(100vh)); }
}

@keyframes sheen {
  0%, 100% { transform: rotate(45deg) translateX(-100%); }
  50% { transform: rotate(45deg) translateX(100%); }
}

@keyframes blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.5); opacity: 0; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .leaderboard-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }

    .leaderboard-container {
        padding: 10px;
        width: 100%;
    }
    
    .tab-btn {
        margin-bottom: 5px;
        padding: 6px 10px;
        font-size: 12px;
        flex: 1 0 40%;
        text-align: center;
    }

    .rank-column {
        width: 40px;
    }
    
    .player-column {
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .score-column {
        width: 60px;
    }
    
    .leaderboard-row, .leaderboard-header {
        padding: 8px;
    }

    .details-column {
        display: none;
    }

    .date-column {
        width: 90px;
        font-size: 12px;
    }
    
    .difficulty-tabs {
        justify-content: center;
    }
    
    .difficulty-tab-btn {
        flex: 1 0 auto;
        text-align: center;
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .tab-btn::after,
    .save-name-btn::after {
        display: none; /* Disable some animations on mobile */
    }
    
    .leaderboard-container::after {
        background-size: 15px 15px; /* Smaller grid pattern */
    }
}

@media (max-width: 480px) {
    .leaderboard-container {
        padding: 10px;
    }

    .date-column {
        display: none;
    }

    .tab-btn {
        flex: 1 0 100%;
    }
    
    .details-column {
        display: none;
    }
    
    .difficulty-tab-btn {
        flex: 1 0 100%;
        margin-bottom: 5px;
    }
}