/* --- Root Variables for easy tweaking --- */
:root {
    --accent-color: #3fb950;
    --card-bg: rgba(22, 27, 34, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --text-main: #e6edf3;
    --text-dim: #848d97;
}

#leaderboard {
    scroll-margin-top: 100px;
}

/* --- Container Layout --- */
.vote-wrapper {
    max-width: 900px;
    margin: 40px auto 100px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.server-section {
    background: #202020;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-header {
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 700;
}

/* --- Vote List Rows --- */
.vote-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 15px 20px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-row:hover {
    background: rgba(63, 185, 80, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 185, 80, 0.15);
}

.site-title {
    color: var(--text-main);
    font-weight: 500;
}

.action-text {
    font-size: 0.7rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-dim);
    transition: 0.3s;
}

.vote-row:hover .action-text {
    color: #fff;
    background: var(--accent-color);
}

/* --- Enhanced Featured Row --- */
.vote-row.featured {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--accent-color);
    background: linear-gradient(90deg, rgba(63, 185, 80, 0.1) 0%, rgba(17, 17, 17, 1) 100%);
    box-shadow: 0 0 15px rgba(63, 185, 80, 0.1);
}

.vote-row.featured::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transform: skewX(-25deg);
    transition: 0s;
}

.vote-row.featured:hover::after {
    left: 150%;
    transition: 0.7s;
}

.vote-row.featured .action-text {
    color: var(--accent-color);
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.3);
    font-weight: 900;
}

@keyframes featured-glow {
    0% {
        box-shadow: 0 0 5px rgba(63, 185, 80, 0.2);
    }

    50% {
        box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
    }

    100% {
        box-shadow: 0 0 5px rgba(63, 185, 80, 0.2);
    }
}

.vote-row.featured {
    animation: featured-glow 3s infinite ease-in-out;
}

/* --- Bulk Action Button --- */
.bulk-action-btn {
    margin-top: auto;
    width: 100%;
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: 0.3s;
    box-shadow: 0 4px 14px rgba(63, 185, 80, 0.3);
}

.bulk-action-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.ip-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-family: monospace;
}

.ip-box:hover {
    border-color: var(--accent-color);
}

/* --- Vote Shop Section --- */
.vote-shop-container {
    max-width: 900px;
    margin: 60px auto 100px;
    padding: 40px;
    background: #242527;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 40px;
    backdrop-filter: blur(10px);
    width: calc(100% - 40px);
    box-sizing: border-box;
}

.shop-content {
    flex: 1;
}

.shop-label {
    color: var(--accent-color);
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.shop-content h2 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    line-height: 1.2;
}

.shop-content p {
    color: var(--text-dim);
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

.shop-image {
    flex: 1 1 300px;
    max-width: 300px;
}

.shop-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

/* --- Reward Modal Overlay --- */
.reward-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #161b22;
    margin: 50px auto;
    padding: 40px;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 20px rgba(63, 185, 80, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 2rem;
    color: #fff;
    font-weight: 800;
}

.close-modal {
    color: var(--text-dim);
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    line-height: 0.8;
    transition: 0.2s;
}

.close-modal:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* --- Grid for Rewards --- */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.reward-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.reward-item-card:hover {
    background: rgba(63, 185, 80, 0.05);
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.item-title {
    display: block;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-transform: capitalize;
}

#notification-zone {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.vote-toast {
    pointer-events: auto;
    width: 320px;
    background: #2c2c2c;
    color: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #098d02;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vote-toast.hide {
    animation: slideOutRight 0.4s ease forwards;
}

.vote-toast h4 {
    margin: 0 0 10px 0;
    color: #00b334;
    font-size: 1.1rem;
}

.vote-toast p {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #ccc;
}

.toast-action-btn {
    width: 100%;
    padding: 10px;
    background: #098d02;
    border: none;
    border-radius: 4px;
    color: #1a1a1a;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.toast-action-btn:hover {
    background: #11cc00;
}

.toast-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.toast-close:hover {
    color: white;
}

/* --- Vote Streak Leaderboard --- */
.leaderboard-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.streak-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Player Card Layout --- */
.player-card {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.player-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Rank & Player Info --- */
.rank-badge {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    color: var(--text-dim);
    font-size: 1.1rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* --- Fire Streak Styling --- */
.streak-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fire-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(255, 69, 0, 0.5));
    animation: fire-flicker 1.5s infinite alternate ease-in-out;
}

.streak-count {
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
}

/* --- Top Tier Highlights --- */
.top-voter {
    border-color: rgba(255, 204, 0, 0.4);
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.1) 0%, rgba(22, 27, 34, 0.8) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.top-voter .rank-badge {
    color: #ffcc00;
}

.top-voter .streak-count {
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

/* --- Animations --- */
@keyframes fire-flicker {
    0% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 2px #ff4500);
    }

    100% {
        transform: scale(1.15);
        filter: brightness(1.3) drop-shadow(0 0 10px #ff8c00);
    }
}

/* Mobile Tweaks */
@media (max-width: 600px) {
    .player-card {
        padding: 10px 15px;
        grid-template-columns: 40px 1fr auto;
    }

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

    .streak-count {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #0d1117;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Container for the tooltip */
.fire-wrapper {
    position: relative;
    display: inline-block;
}

/* Base Tooltip Styling */
.fire-wrapper::after {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Tooltip Arrow */
.fire-wrapper::before {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.95) transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* --- Tier 1: 20-hour Warning (Yellow) --- */
.fire-wrapper.streak-warning::after {
    content: "Pssst.. Seems you haven't voted today, vote soon to keep your streak!";
    border: 1px solid #ffcc00;
}

.streak-warning {
    color: #ffcc00;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

/* --- Tier 2: 40-hour Severe (Red) --- */
.fire-wrapper.streak-warning-severe::after {
    content: "You have not voted in 2 days, vote now to not lose your streak!";
    border: 1px solid #ff4444;
}

.streak-warning-severe {
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
}

/* --- Tier 3: 48-hour Expired (Gray/Skull) --- */
.fire-wrapper.streak-expired::after {
    content: "You have lost your streak.";
    border: 1px solid #848d97;
}

.streak-expired {
    color: #848d97;
    opacity: 0.8;
}

/* Show tooltips on hover for any warning/expired state */
.fire-wrapper.streak-warning:hover::after,
.fire-wrapper.streak-warning:hover::before,
.fire-wrapper.streak-warning-severe:hover::after,
.fire-wrapper.streak-warning-severe:hover::before,
.fire-wrapper.streak-expired:hover::after,
.fire-wrapper.streak-expired:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* --- Mobile Styling --- */
@media (max-width: 850px) {
    .vote-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 50px;
    }

    .server-section {
        height: auto;
    }

    .vote-shop-container {
        flex-direction: column;
        text-align: center;
    }

    .shop-image {
        order: -1;
        margin-bottom: 20px;
    }

    .modal-content {
        padding: 20px;
        margin: 20px auto;
        width: 95%;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }
}