/* css/leaderboard.css - Brutal Gamer Design v3 - Hibajavításokkal */

:root {
    --bg-primary: #0d0d0d;
    --bg-container: rgba(20, 20, 20, 0.85);
    --bg-interactive: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --accent-green: #50fa7b;
    --accent-green-dark: #3cb863;
    --border-color: rgba(80, 250, 123, 0.3);
    --glow-color: rgba(80, 250, 123, 0.5);
    --danger-color: #ff6347;
    --font-primary: 'Roboto', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

@keyframes move-bg {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 20px;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(rgba(80, 250, 123, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80, 250, 123, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: move-bg 4s linear infinite;
}

.leaderboard-container {
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.7), inset 0 0 10px rgba(80, 250, 123, 0.1);
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto 30px auto;
    backdrop-filter: blur(10px);
}

/* --- Header & Search --- */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.site-logo { max-width: 150px; }

h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 0 10px var(--glow-color);
    text-align: center;
    flex-grow: 1;
}

.back-to-main, .search-container button[type="submit"], .search-container .clear-search {
    padding: 10px 20px;
    border: 1px solid var(--accent-green);
    background: transparent;
    color: var(--accent-green);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
/* JAVÍTÁS: A :hover állapot most már helyesen felülírja a színeket a láthatóságért */
.back-to-main:hover, .search-container button[type="submit"]:hover {
    background-color: var(--accent-green);
    color: var(--bg-primary); /* Sötét szöveg a világos háttéren */
    box-shadow: 0 0 15px var(--glow-color);
}
.clear-search { border-color: var(--danger-color); color: var(--danger-color); }
.clear-search:hover { background-color: var(--danger-color); color: #fff; }

/* --- Stats Summary --- */
.stats-summary-container {
    padding: 15px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    text-align: center;
}
.stats-main-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.stats-secondary-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.stats-main-grid .stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}
.stats-main-grid .stat-value span {
    color: var(--accent-green);
}
.stats-secondary-grid .stat-value {
    font-size: 1em;
    font-weight: 700;
    color: var(--accent-green);
    font-family: var(--font-mono);
}


.search-container { display: flex; justify-content: center; margin-bottom: 30px; }
.search-container form { display: flex; gap: 10px; }
.search-container input[type="text"] {
    padding: 10px 15px;
    width: 300px;
    border: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.search-container input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 10px var(--glow-color);
}


/* --- Table --- */
.table-responsive { width: 100%; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 15px 12px; text-align: center; }
table th {
    text-transform: uppercase;
    font-size: 0.9em;
    color: var(--text-secondary);
}
table th.sortable a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
table th.sortable a:hover { color: var(--text-primary); }
table th.active-sort a { color: var(--accent-green); font-weight: 700; }
table th.active-sort a::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}
table th.active-sort a.sort-asc::after { border-bottom: 5px solid var(--accent-green); }
table th.active-sort a.sort-desc::after { border-top: 5px solid var(--accent-green); }

tbody tr { border-bottom: 1px solid var(--border-color); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background-color: rgba(80, 250, 123, 0.05); }

td .player-name, td[data-label="Steam ID"] a, td[data-label="#"] {
    font-family: var(--font-mono);
    font-weight: 700;
}
td a { color: var(--text-primary); text-decoration: none; }
td a:hover { color: var(--accent-green); text-decoration: underline; }

/* --- Top 3 Styling --- */
@keyframes glow {
    0% { box-shadow: 0 0 5px var(--glow-color); }
    50% { box-shadow: 0 0 15px var(--glow-color); }
    100% { box-shadow: 0 0 5px var(--glow-color); }
}

.top-1, .top-2, .top-3 {
    background-image: linear-gradient(to right, rgba(80, 250, 123, 0.1), rgba(80, 250, 123, 0));
    border-left: 3px solid var(--accent-green);
    animation: glow 3s infinite;
}
.top-2 { animation-delay: 1s; }
.top-3 { animation-delay: 2s; }

.rank-badge {
    display: inline-block;
    width: 24px; height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.rank-1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd700'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z'/%3E%3Cpath d='M12 2l-3.09 6.26L2 9.27l5 4.87L5.82 22 12 18.27 18.18 22 17 14.14l5-4.87-6.91-1.01L12 2z' fill='%2350fa7b'/%3E%3Cpath d='M12 5l-2.18 4.42L5 10.14l3.5 3.4L7.64 19 12 16.54 16.36 19 15.5 13.54l3.5-3.4-4.82-.72L12 5z' fill='gold'/%3E%3C/svg%3E"); }
.rank-2 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23C0C0C0'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E"); }
.rank-3 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23cd7f32'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E"); }


/* --- Pagination & Footer --- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.pagination .page-link {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
    text-decoration: none;
    transition: all 0.2s;
}
.pagination .page-link:hover { color: var(--text-primary); border-color: var(--accent-green); }
.pagination .page-link.active {
    background-color: var(--accent-green);
    color: var(--bg-primary);
    border-color: var(--accent-green);
    pointer-events: none;
}

.site-footer { text-align: center; margin-top: 30px; color: var(--text-secondary); font-size: 0.9em; }

/* --- Scroll Button (Rebuilt & Fixed) --- */
#scroll-to-top-btn {
    /* Alapértelmezett állapot: rejtett és nem kattintható */
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    
    /* Pozícionálás */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;

    /* Kinézet */
    width: 50px;
    height: 50px;
    background-color: var(--accent-green);
    border: none;
    border-radius: 50%;
    box-shadow: 0 5px 15px var(--shadow-color);
    cursor: pointer;
    
    /* Tartalom (SVG) igazítása */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Animáció */
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

/* Látható állapot, amit a JS hozzáad */
#scroll-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#scroll-to-top-btn:hover {
    transform: translateY(-5px);
    background-color: var(--accent-green-dark);
}

#scroll-to-top-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--bg-primary);
}


/* --- Responsive Design --- */
@media screen and (max-width: 900px) {
    .header-main { flex-direction: column; }
    h1 { font-size: 2em; }
    .stats-main-grid, .stats-secondary-grid {
        gap: 15px;
    }
}

@media screen and (max-width: 768px) {
    body { padding: 10px; }
    .leaderboard-container { padding: 15px; }
    .search-container form { flex-direction: column; width: 100%; }
    .search-container input[type="text"] { width: 100%; }

    table thead { display: none; }
    table tr { display: block; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 15px; }
    .top-1, .top-2, .top-3 { border-left: none; border-top: 3px solid var(--accent-green); }
    table td {
        display: flex;
        justify-content: space-between;
        padding: 10px 15px;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }
    table tr td:last-child { border-bottom: none; }
    table td::before { content: attr(data-label); font-weight: 700; color: var(--text-primary); text-align: left; }
    
    #scroll-to-top-btn { 
        bottom: 20px; 
        right: 20px; 
        width: 45px; 
        height: 45px; 
    }
}