/* ===========================
   Vote / Poll Modal
   =========================== */

#voteDialogueBox {
    animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vote-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.vote-modal.vote-visible {
    opacity: 1;
    pointer-events: all;
}

.vote-modal.hidden {
    display: none !important;
}

.vote-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Dialog */
.vote-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(129, 140, 248, 0.3);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.08),
        0 8px 48px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(99, 102, 241, 0.12),
        inset 0 0 30px rgba(129, 140, 248, 0.05);
    background: linear-gradient(160deg, #151030 0%, #120c28 60%, #0f0a1f 100%);
    transform: translateY(28px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vote-modal.vote-visible .vote-dialog {
    transform: translateY(0) scale(1);
}

/* Header */
.vote-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(56, 189, 248, 0.08) 100%);
    border-bottom: 1px solid rgba(129, 140, 248, 0.2);
    flex-shrink: 0;
}

.vote-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.7));
    animation: vote-pulse 3s ease-in-out infinite;
}

@keyframes vote-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.6));
    }

    50% {
        transform: scale(1.12);
        filter: drop-shadow(0 0 18px rgba(129, 140, 248, 1));
    }
}

.vote-logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 600;
}

.vote-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #f87171;
    color: #fff;
}

.vote-methods-btn {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 600;
    margin-right: 8px;
}

.vote-methods-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff;
}

.vote-title {
    flex: 1;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-family: 'Reaver', serif;
    background: linear-gradient(90deg, #818cf8 0%, #a78bfa 45%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    text-transform: uppercase;
}

/* Body */
.vote-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 140, 248, 0.4) transparent;
}

.vote-body::-webkit-scrollbar {
    width: 4px;
}

.vote-body::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.4);
    border-radius: 4px;
}

/* Steps */
.vote-step {
    display: none;
}

.vote-step.active {
    display: block;
}

/* Auth step */
.vote-auth-label {
    display: block;
    color: rgba(248, 232, 248, 0.75);
    font-size: 0.88rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}

.vote-auth-input {
    width: 100%;
    padding: 13px 18px;
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 12px;
    background: rgba(129, 140, 248, 0.06);
    color: #e8e0f8;
    font-size: 1rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

.vote-auth-input::placeholder {
    color: rgba(129, 140, 248, 0.35);
}

.vote-auth-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15), 0 0 20px rgba(129, 140, 248, 0.08);
    background: rgba(129, 140, 248, 0.1);
}

.vote-auth-error {
    color: #f87171;
    font-size: 0.82rem;
    margin-top: 8px;
    display: none;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
}

.vote-auth-error.visible {
    display: block;
}

.vote-auth-submit {
    margin-top: 18px;
    width: 100%;
    padding: 13px 24px;
    border: 1px solid rgba(129, 140, 248, 0.5);
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(56, 189, 248, 0.1) 100%);
    color: #818cf8;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    font-family: 'Reaver', serif;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s, color 0.2s,
        transform 0.15s, box-shadow 0.2s;
}

.vote-auth-submit:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(56, 189, 248, 0.2) 100%);
    border-color: #818cf8;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.35);
}

.vote-auth-submit:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Poll step */
.vote-question {
    color: rgba(248, 232, 248, 0.92);
    font-size: 0.95rem;
    line-height: 1.7;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    margin-bottom: 24px;
    text-align: center;
}

.vote-greeting {
    color: rgba(129, 140, 248, 0.7);
    font-size: 0.82rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    text-align: center;
    margin-bottom: 16px;
}

.vote-greeting strong {
    color: #a78bfa;
}

.vote-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.vote-btn-yes,
.vote-btn-no {
    flex: 1;
    max-width: 180px;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Reaver', serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s, background 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.vote-btn-yes {
    border: 1px solid rgba(52, 211, 153, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.08) 100%);
    color: #34d399;
}

.vote-btn-yes:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(52, 211, 153, 0.18) 100%);
    border-color: #34d399;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(52, 211, 153, 0.3);
}

.vote-btn-no {
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.08) 100%);
    color: #f87171;
}

.vote-btn-no:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(248, 113, 113, 0.18) 100%);
    border-color: #f87171;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(248, 113, 113, 0.3);
}

.vote-btn-yes:active,
.vote-btn-no:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Thank you step */
.vote-thanks {
    text-align: center;
}

.vote-thanks-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 16px;
    animation: vote-thanks-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vote-thanks-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.vote-thanks-text {
    color: rgba(248, 232, 248, 0.88);
    font-size: 1.1rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    line-height: 1.6;
    margin-bottom: 8px;
}

.vote-thanks-sub {
    color: rgba(129, 140, 248, 0.6);
    font-size: 0.82rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
}

/* Result bar (shown after voting) */
.vote-results {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vote-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vote-result-label {
    color: rgba(248, 232, 248, 0.7);
    font-size: 0.85rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    min-width: 40px;
    text-align: right;
}

.vote-result-bar-bg {
    flex: 1;
    height: 28px;
    background: rgba(129, 140, 248, 0.08);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.vote-result-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    min-width: 0;
}

.vote-result-bar.yes-bar {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.5), rgba(52, 211, 153, 0.7));
}

.vote-result-bar.no-bar {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.5), rgba(248, 113, 113, 0.7));
}

.vote-result-percent {
    color: rgba(248, 232, 248, 0.6);
    font-size: 0.82rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    min-width: 42px;
}

.vote-result-bar.vote-bar-highlight {
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    filter: brightness(1.2);
}

/* Footer */
.vote-footer {
    padding: 14px 24px 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(129, 140, 248, 0.15);
    flex-shrink: 0;
    background: linear-gradient(to top, rgba(15, 10, 31, 0.6), transparent);
}

.vote-close-btn {
    padding: 11px 42px;
    border: 1px solid rgba(129, 140, 248, 0.5);
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(56, 189, 248, 0.12) 100%);
    color: #818cf8;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    font-family: 'Reaver', serif;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s, color 0.2s,
        transform 0.15s, box-shadow 0.2s;
}

.vote-close-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(56, 189, 248, 0.2) 100%);
    border-color: #818cf8;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.35);
}

.vote-close-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Unclosable state: hide close buttons */
.vote-modal.modal-unclosable .vote-close-btn,
.vote-modal.modal-unclosable .vote-footer {
    display: none !important;
}

/* Your vote indicator */
.vote-your-choice {
    margin-top: 14px;
    color: rgba(167, 139, 250, 0.7);
    font-size: 0.8rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    text-align: center;
    font-style: italic;
}

/* Total votes count */
.vote-total-count {
    margin-top: 8px;
    color: rgba(129, 140, 248, 0.5);
    font-size: 0.78rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    text-align: center;
    letter-spacing: 0.03em;
}

/* Vote Widget (Top Right) */
.vote-widget {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(15, 10, 31, 0.85) 0%, rgba(22, 12, 40, 0.9) 100%);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.vote-widget:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(20, 15, 45, 0.95) 0%, rgba(30, 20, 55, 0.95) 100%);
    border-color: rgba(129, 140, 248, 0.6);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(129, 140, 248, 0.3);
}

.vote-widget-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.vote-widget-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(129, 140, 248, 0.5);
    display: none;
}

.vote-widget-text {
    color: #e8e0f8;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
}

.vote-widget-text strong {
    color: #a78bfa;
}

/* Responsive */
@media (max-width: 520px) {
    .vote-dialog {
        border-radius: 14px;
        max-height: 95vh;
    }

    .vote-header {
        padding: 16px 16px 12px;
    }

    .vote-body {
        padding: 18px 16px;
    }

    .vote-footer {
        padding: 10px 16px 16px;
    }

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

    .vote-buttons {
        flex-direction: column;
        align-items: center;
    }

    .vote-btn-yes,
    .vote-btn-no {
        max-width: 100%;
        width: 100%;
    }
}

/* ===========================
   404 Overlay (for NO voters)
   =========================== */
#vote404Overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

.vote-404-content {
    text-align: center;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    color: #888;
}

/* ===========================
   Global Site Controls (Always Visible)
   These MUST be above the vote modal (z-index: 100000)
   =========================== */
header {
    position: relative;
    z-index: 1001000 !important;
}

.support-buttons {
    z-index: 1001000 !important;
    pointer-events: auto !important;
}

.snow-toggle {
    z-index: 1001000 !important;
}

/* Force support buttons visible when site is locked (NO voters need payment access) */
body.site-locked .support-buttons {
    display: block;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.site-locked .support-buttons.hidden {
    display: block;
    visibility: visible !important;
}

body.site-locked .support-button-wrapper {
    display: inline-block;
}

body.site-locked header {
    display: block !important;
}

body.site-locked .lang-select {
    pointer-events: auto !important;
}

body.site-locked .snow-toggle {
    display: block !important;
}

.vote-404-content h1 {
    font-size: 8rem;
    font-weight: 900;
    color: #333;
    margin: 0;
    line-height: 1;
    font-family: 'Reaver', serif;
}

.vote-404-content p {
    font-size: 1.6rem;
    color: #555;
    margin: 12px 0 8px;
}

.vote-404-content small {
    font-size: 0.85rem;
    color: #444;
}

/* ===========================
   Payment Button (in Thanks)
   =========================== */
.vote-payment-btn {
    margin-top: 20px;
    width: 100%;
    padding: 13px 24px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: #38bdf8;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: 'Reaver', serif;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s, color 0.2s,
        transform 0.15s, box-shadow 0.2s;
}

.vote-payment-btn:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.vote-payment-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ===========================
   Payment Form
   =========================== */
.vote-payment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-payment-back {
    align-self: flex-start;
    background: none;
    border: none;
    color: rgba(129, 140, 248, 0.7);
    cursor: pointer;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s;
}

.vote-payment-back:hover {
    color: #818cf8;
}

.vote-payment-title {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Reaver', serif;
    color: #a78bfa;
    text-align: center;
    letter-spacing: 0.05em;
}

.vote-payment-label {
    color: rgba(248, 232, 248, 0.7);
    font-size: 0.85rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    margin-top: 4px;
}

.vote-payment-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 12px;
    background: rgba(129, 140, 248, 0.06);
    color: #e8e0f8;
    font-size: 0.95rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    outline: none;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.vote-payment-textarea::placeholder {
    color: rgba(129, 140, 248, 0.35);
}

.vote-payment-textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15), 0 0 20px rgba(129, 140, 248, 0.08);
    background: rgba(129, 140, 248, 0.1);
}

.vote-payment-file {
    padding: 10px;
    border: 1px dashed rgba(129, 140, 248, 0.3);
    border-radius: 12px;
    background: rgba(129, 140, 248, 0.04);
    color: rgba(248, 232, 248, 0.6);
    font-size: 0.85rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.vote-payment-file:hover {
    border-color: rgba(129, 140, 248, 0.5);
    background: rgba(129, 140, 248, 0.08);
}

.vote-payment-file::file-selector-button {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(56, 189, 248, 0.1));
    border: 1px solid rgba(129, 140, 248, 0.4);
    border-radius: 8px;
    color: #818cf8;
    padding: 6px 14px;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.2s, color 0.2s;
}

.vote-payment-file::file-selector-button:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(56, 189, 248, 0.2));
    color: #fff;
}

.vote-payment-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    border: 1px solid rgba(129, 140, 248, 0.2);
    object-fit: contain;
    margin-top: 4px;
}

.vote-payment-status {
    font-size: 0.82rem;
    font-family: 'Radiance', 'Noto Sans', sans-serif;
    text-align: center;
    padding: 4px 0;
}