/* ============================================================
   Nogden.eu - Voting Page Stylesheet (Optimized Edition)
   ============================================================ */

/* --- 1. Global Page Background --- */
body.vote-page {
    width: 100%;
    min-height: 100vh;
    background-color: #181a1b !important;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    /* Optimalizace pro plynulé vykreslování */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Desktop background implementation */
@media (min-width: 769px) {
    body.vote-page {
        background: 
            linear-gradient(rgba(24, 26, 27, 0.8), rgba(24, 26, 27, 0.8)), 
            url('/files/pictures/bcknogden.webp?v=4') !important; /* Update verze na v4 */
        background-position: center !important;
        background-size: cover !important;
        background-repeat: no-repeat !important;
        background-attachment: fixed !important;
    }
}

/* --- 2. Voting Section Layout --- */
.vote-section {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 160px 20px 60px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.vote-section h1 {
    font-size: clamp(2.2rem, 8vw, 3rem);
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* --- 3. Username Input Section --- */
.vote-nick-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.vote-nick-section label {
    font-weight: 800;
    font-size: 0.8rem;
    color: #b000f4;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
}

.vote-nick-section input {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    outline: none;
    background-color: rgba(0,0,0,0.4);
    color: #fff;
    transition: all 0.3s ease;
}

.vote-nick-section input:focus {
    border-color: #b000f4;
    background-color: rgba(0,0,0,0.6);
    box-shadow: 0 0 15px rgba(176, 0, 244, 0.2);
}

/* --- 4. Voting Links Grid --- */
.vote-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 1100px;
    margin-bottom: 50px;
}

.vote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    backdrop-filter: blur(5px);
}

.vote-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.vote-btn:hover {
    background-color: rgba(176, 0, 244, 0.15);
    border-color: #b000f4;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- 5. Monthly Top 10 Leaderboard (Optimized) --- */
.vote-leaderboard {
    width: 100%;
    max-width: 600px;
    /* Rezervace místa pro stabilitu (CLS Fix) */
    min-height: 550px;
}

.vote-leaderboard h2 {
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    color: #ffffff;
    display: inline-block;
    padding-bottom: 12px;
    margin-bottom: 35px;
    border-bottom: 3px solid #b000f4;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    /* Placeholder pozadí pro plynulé načtení */
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
}

#leaderboard-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 12px 18px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    /* Stabilní výška řádku */
    min-height: 58px;
}

.player-info-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-rank {
    font-size: 1rem;
    font-weight: 900;
    min-width: 30px;
    color: rgba(255,255,255,0.2);
}

.player-head {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    /* Placeholder barva před načtením skinu */
    background-color: rgba(255, 255, 255, 0.05);
    display: block;
}

.player-name {
    font-weight: 700;
}

.player-votes {
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff; 
}

/* Top 3 Rank Gradients */
#leaderboard-list li.rank-1 { background: linear-gradient(135deg, #ffd700, #ffb800); border: none; }
#leaderboard-list li.rank-2 { background: linear-gradient(135deg, #d3d3d3, #bcbcbc); border: none; }
#leaderboard-list li.rank-3 { background: linear-gradient(135deg, #cd7f32, #b26b27); border: none; }

#leaderboard-list li.rank-1 *, 
#leaderboard-list li.rank-2 *, 
#leaderboard-list li.rank-3 * { color: #181a1b !important; }

/* --- 6. Mobile Responsiveness & iOS Background Fix --- */
@media (max-width: 768px) {
    #nav-menu li a:hover,
    #nav-menu li a.store-link:hover {
        background-color: rgba(176, 0, 244, 0.15) !important;
        color: #ffffff !important;
        border-radius: 8px;
    }

    #nav-menu li a.active {
        background-color: rgba(176, 0, 244, 0.25) !important;
        color: #b000f4 !important;
        box-shadow: inset 6px 0 0 0 #b000f4 !important;
        border-radius: 4px 12px 12px 4px !important;
    }

    #nav-menu li a.store-link {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        background: transparent !important;
    }

    /* iOS Fixed Background Fix */
    body.vote-page::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('/files/pictures/bcknogden.webp?v=4');
        background-position: center top;
        background-size: cover;
        background-repeat: no-repeat;
        z-index: -1;
        pointer-events: none;
        background-color: rgba(24, 26, 27, 0.8);
        background-blend-mode: darken;
        will-change: transform;
    }

    .vote-section { 
        padding-top: 120px; 
        background: transparent !important;
    }
    
    /* Skrytí sekce pro nick na telefonech */
    .vote-nick-section { 
        display: none !important; 
    }
    
    .vote-buttons { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 10px;
        width: 100%;
    }

    .vote-btn { 
        padding: 12px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .vote-buttons { grid-template-columns: 1fr; }
    .vote-section h1 { font-size: 1.8rem; }
}