/* Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('../assets/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #ffffff;
    min-height: 100vh;
    padding-top: 85px; /* Space for fixed navbar */
}

/* Semi-transparent overlay for better text readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 20, 30, 0.1);
    z-index: -1;
}

/* Main Content Area */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    position: relative;
    z-index: 1;
}

/* Page Title */
.page-title {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(20, 30, 40, 0.8);
    border-radius: 10px;
    border: 2px solid rgba(255, 140, 0, 0.3);
}

.page-title h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* Page Content Container */
.page-content {
    background: rgba(20, 30, 40, 0.85);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 140, 0, 0.2);
    min-height: 400px;
}

.page-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .page-title h1 {
        font-size: 2rem;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .page-content {
        padding: 20px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-orange {
    color: #ff8c00;
}

.bg-dark {
    background: rgba(20, 30, 40, 0.9);
    padding: 20px;
    border-radius: 8px;
}

/* Footer */
.footer {
    background: rgba(35, 35, 40, 0.85);
    border-top: 1.5px solid #ff8c00;
    padding: 20px;
    text-align: center;
    margin-top: 60px;
}

.footer p {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin: 5px 0;
}

.footer .version {
    color: #ff8c00;
    font-weight: 600;
}

/* WR Counter Display */
.wr-counter-container {
    text-align: center;
    margin: 10px 0;
}

#nbWR {
    padding: 0px 20px;
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
    display: inline-block;
    /* font-weight: bold; */
    animation: jitter 15s infinite;
    transition: background-color 0.2s, box-shadow 0.2s;
}

#nbWR:hover {
    background-color: rgba(8, 92, 8, 0.24);
    box-shadow: 0px 0px 10px rgba(8, 92, 8, 0.24);
}

#counter-number {
    font-size: 5rem;
    color: #138f13; /* Dark green color */
    text-shadow: #138f13 0px 0px 5px;
}

.wr-counter-label {
    font-size: 5rem;
    color: #e0e0e0;
    margin-left: 20px; /* Space between number and text */
    /* font-weight: 300; */
    /* vertical-align: middle; */
}

.wr-counter-update {
    display: block;
    font-size: 0.9rem;
    color: #888;
    /* margin-top: 2px; */
    padding-bottom: 8px;
}

/* Discord Report Button */
.discord-report-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px auto;
    width: fit-content;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(88, 101, 242, 0.8);
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.discord-report-btn img {
    width: 22px;
    height: auto;
    filter: brightness(0) invert(1);
}

.discord-report-btn:hover {
    background: rgba(88, 101, 242, 0.3);
    border-color: rgba(88, 101, 242, 1);
    transform: translateY(-2px);
}

/* Jitter Animation */
@keyframes jitter {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2px, 1px); }
    20% { transform: translate(2px, -1px); }
    30% { transform: translate(-1px, 2px); }
    40% { transform: translate(1px, -2px); }
    50% { transform: translate(-2px, -1px); }
    60% { transform: translate(2px, 1px); }
    70% { transform: translate(-1px, -2px); }
    80% { transform: translate(1px, 2px); }
    90% { transform: translate(0, 0); }
}

/* Responsive */
@media (max-width: 768px) {
    #nbWR {
        padding: 0px 20px;
        max-width: 95%;
    }

    #counter-number {
        font-size: 60px;
    }

    .wr-counter-label {
        font-size: 60px;
        margin-left: 10px;
    }
}

/* Panels Container */
.panels-container {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
    align-items: stretch;
}

/* Latest WRs Panel */
.latest-wrs-panel {
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    max-width: 700px;
    flex: 0 1 700px;
}

.panel-title {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 140, 0, 0.3);
    text-align: center;
}

.wrs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.wrs-list .loading {
    text-align: center;
    color: #a0a0a0;
    padding: 40px;
}

.wrs-list .error {
    text-align: center;
    color: #ff6b6b;
    padding: 40px;
}

.wr-item {
    display: grid;
    grid-template-columns: 100px 55px minmax(100px, auto) 1fr 90px 90px;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    min-height: 80px;
    background: rgba(20, 19, 19, 0.9);
    border-radius: 6px;
    border-left: 5px solid #ff8c00;
    transition: background 0.2s;
}

.wr-item:hover {
    background: rgba(255, 140, 0, 0.1);
}

/* Game info (game name + enviro logo) */
.wr-game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wr-game-name {
    color: #ff8c00;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.enviro-logo {
    height: 24px;
    width: auto;
}

.wr-thumbnail {
    width: 95px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.wr-player {
    color: #ffffff;
    font-weight: 600;
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

.homepage-player-link {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.homepage-player-link:hover {
    color: #ff8c00;
}

.player-flag {
    height: 28px;
    width: auto;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 1px;
    padding-top: 3px;
}

.wr-map {
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wr-time {
    color: #ffffff;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    text-align: right;
}

.wr-delta {
    color: #9790ff;
    font-size: 0.75em;
    margin-left: 4px;
}

.wr-date {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-align: right;
}


/* Scrollbar styling for WRs list */
.wrs-list::-webkit-scrollbar {
    width: 8px;
}

.wrs-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.wrs-list::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 0, 0.5);
    border-radius: 4px;
}

.wrs-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 0, 0.7);
}

/* Top Players Panel */
.top-players-panel {
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    flex: 0 1 320px;
    display: flex;
    flex-direction: column;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.players-list .loading,
.players-list .error {
    text-align: center;
    color: #a0a0a0;
    padding: 40px;
}

.players-list .error {
    color: #ff6b6b;
}

.player-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(20, 19, 19, 0.9);
    border-radius: 6px;
    border-left: 5px solid #ff8c00;
    transition: background 0.2s;
    flex: 1;
}

.player-item:hover {
    background: rgba(255, 140, 0, 0.1);
}

.player-item.has-cheated {
    color: #ff6b6b;
    font-style: italic;
    border-left-color: #ff6b6b;
}

.player-item.has-cheated .player-rank,
.player-item.has-cheated .player-name,
.player-item.has-cheated .player-wr-count {
    color: #ff6b6b;
}

.player-rank {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-rank-text {
    color: #ff8c00;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.rank-medal {
    height: 2rem;
    width: auto;
    margin-top: 4px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}

.player-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-wr-count {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* Responsive for Panels Container */
@media (max-width: 1100px) {
    .panels-container {
        flex-direction: column;
        align-items: center;
    }

    .latest-wrs-panel,
    .top-players-panel {
        max-width: 700px;
        width: 100%;
        flex: none;
    }
}

/* Responsive for Latest WRs and Top Players */
@media (max-width: 768px) {
    .latest-wrs-panel,
    .top-players-panel {
        max-width: 100%;
        padding: 15px;
    }

    .wr-item {
        grid-template-columns: 52px 40px 90px minmax(0, 1fr) auto;
        gap: 3px;
        min-height: 50px;
        padding: 6px 8px;
        border-left-width: 4px;
    }

    .wr-thumbnail {
        width: 50px;
        height: 28px;
    }

    .wr-game-info {
        gap: 3px;
        padding-left: 10px;
    }

    .wr-game-name {
        font-size: 0.7rem;
    }

    .enviro-logo {
        height: 14px;
    }

    .wr-player {
        font-size: 0.85rem;
        min-width: 0;
    }

    .wr-player .player-flag {
        height: 28px;
    }

    .wr-time {
        font-size: 0.8rem;
    }

    .wr-map {
        font-size: 0.75rem;
    }

    .wr-date {
        display: none;
    }

    .wr-delta {
        font-size: 0.65em;
    }

    .player-item {
        padding: 6px 8px;
        border-left-width: 4px;
    }

    .player-name {
        font-size: 0.85rem;
    }

    .player-info .player-flag {
        height: 20px;
    }

    .player-rank-text,
    .player-wr-count {
        font-size: 0.9rem;
    }

    .rank-medal {
        height: 1.6rem;
    }
}

@media (max-width: 480px) {
    .latest-wrs-panel,
    .top-players-panel {
        padding: 10px;
    }

    .panel-title {
        font-size: 1.2rem;
    }

    .wr-item {
        grid-template-columns: 42px 35px 70px minmax(0, 1fr) auto;
        gap: 2px;
        min-height: 45px;
        padding: 5px 6px;
        border-left-width: 3px;
    }

    .wr-thumbnail {
        width: 40px;
        height: 22px;
    }

    .wr-game-info {
        gap: 1px;
        margin-left: 3px;
    }

    .wr-game-name {
        font-size: 0.6rem;
    }

    .enviro-logo {
        height: 10px;
    }

    .wr-player {
        font-size: 0.75rem;
    }

    .wr-player .player-flag {
        height: 24px;
    }

    .wr-time {
        font-size: 0.7rem;
    }

    .wr-map {
        font-size: 0.65rem;
    }

    .wr-delta {
        font-size: 0.6em;
        margin-left: 2px;
    }

    .player-item {
        padding: 5px 6px;
        border-left-width: 3px;
        gap: 4px;
    }

    .player-name {
        font-size: 0.75rem;
    }

    .player-info .player-flag {
        height: 16px;
    }

    .player-rank-text,
    .player-wr-count {
        font-size: 0.8rem;
    }

    .rank-medal {
        height: 1.4rem;
    }
}