/* VotaMax Public Styles — Retenmax */

.votamax-poll {
    --vm-primary: #6c63ff;
    --vm-secondary: #f0eeff;
    --vm-accent: #28a745;
    --vm-text: #333333;
    --vm-hover: #5a52d5;
    --vm-radius: 14px;
    --vm-shadow: 0 4px 24px rgba(0,0,0,0.10);
    --vm-transition: 0.22s ease;
}

/* ── Poll Container ────────────────────────────────────── */
.votamax-poll {
    background: var(--vm-secondary);
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
    max-width: 680px;
    margin: 20px auto;
    color: var(--vm-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.07);
    position: relative;
}

/* ── Header ────────────────────────────────────────────── */
.votamax-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 0;
}
.votamax-header-text { flex: 1; min-width: 0; }
.votamax-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--vm-text);
    line-height: 1.25;
}
.votamax-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
    line-height: 1.4;
}
.votamax-vote-badge {
    flex-shrink: 0;
    background: var(--vm-primary);
    color: #fff;
    border-radius: 50px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.votamax-vote-icon { font-size: 16px; display: flex; align-items: center; }
.votamax-vote-badge .vm-icon { vertical-align: middle; flex-shrink: 0; }
.votamax-total-count { font-size: 18px; font-weight: 800; }
.votamax-vote-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }
/* SVG icon alignment global */
.vm-icon { vertical-align: middle; display: inline-block; flex-shrink: 0; }

/* ── Body (options + vote button) ──────────────────────── */
.votamax-body { padding: 20px 24px 24px; }

/* ── Text Options ──────────────────────────────────────── */
.votamax-options-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.votamax-options-text .votamax-option { cursor: pointer; display: block; }
.votamax-options-text .votamax-option-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    transition: border-color var(--vm-transition), transform var(--vm-transition), box-shadow var(--vm-transition);
}
.votamax-options-text .votamax-option:hover .votamax-option-inner {
    border-color: var(--vm-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.votamax-options-text .votamax-option-radio:checked ~ .votamax-option-inner {
    border-color: var(--vm-primary);
    background: rgba(108,99,255,0.04);
}
.votamax-options-text .votamax-option-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--vm-text);
}
.votamax-options-text .votamax-option-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all var(--vm-transition);
    opacity: 0;
    color: #fff;
}
.votamax-options-text .votamax-option:hover .votamax-option-check {
    opacity: 0.35;
    border-color: var(--vm-primary);
}
.votamax-options-text .votamax-option-radio:checked ~ .votamax-option-inner .votamax-option-check {
    background: var(--vm-primary);
    border-color: var(--vm-primary);
    opacity: 1;
}

/* ── Image Options ─────────────────────────────────────── */
.votamax-options-image {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.votamax-options-image .votamax-option { cursor: pointer; }
.votamax-options-image .votamax-option-inner {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 10px;
    background: #fff;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    transition: border-color var(--vm-transition), transform var(--vm-transition), box-shadow var(--vm-transition);
    text-align: center;
    position: relative;
}
.votamax-options-image .votamax-option:hover .votamax-option-inner {
    border-color: var(--vm-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}
.votamax-options-image .votamax-option-radio:checked ~ .votamax-option-inner {
    border-color: var(--vm-primary);
    background: rgba(108,99,255,0.04);
}
.votamax-options-image .votamax-option-img-wrap {
    width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: #f0f0f0;
}
.votamax-options-image .votamax-option-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--vm-transition); display: block;
}
.votamax-options-image .votamax-option:hover img { transform: scale(1.04); }
.votamax-options-image .votamax-option-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.votamax-options-image .votamax-option-check {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #d0d0d0; background: rgba(255,255,255,0.9);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    opacity: 0;
    transition: all var(--vm-transition);
}
.votamax-options-image .votamax-option:hover .votamax-option-check {
    opacity: 0.35;
    border-color: var(--vm-primary);
}
.votamax-options-image .votamax-option-radio:checked ~ .votamax-option-inner .votamax-option-check {
    background: var(--vm-primary); border-color: var(--vm-primary); opacity: 1;
}

.votamax-option-radio { position: absolute; opacity: 0; pointer-events: none; }

/* ── Action Bar (botão Votar) ──────────────────────────── */
.votamax-action-bar { text-align: center; }
.votamax-inline-error {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    margin-bottom: 10px;
}
.votamax-vote-trigger-btn {
    background: var(--vm-primary);
    color: #fff;
    border: none;
    padding: 13px 44px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--vm-transition);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.votamax-vote-trigger-btn:hover {
    background: var(--vm-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

/* ── Identificação Modal (campos antes de votar) ───────── */
.votamax-id-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.votamax-id-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: vmFadeIn 0.2s ease;
}
.votamax-id-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: vmSlideUp 0.3s cubic-bezier(0.22,1,0.36,1);
    z-index: 1;
    max-height: 92vh;
    overflow-y: auto;
}
@keyframes vmFadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes vmSlideUp { from { transform:translateY(24px); opacity:0; } to { transform:translateY(0); opacity:1; } }

.votamax-id-close {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(0,0,0,0.07);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #555;
    transition: background 0.2s;
    line-height: 1;
}
.votamax-id-close:hover { background: rgba(0,0,0,0.13); }

.votamax-id-header {
    text-align: center;
    margin-bottom: 24px;
}
.votamax-id-icon {
    display: block;
    font-size: 36px;
    margin-bottom: 8px;
}
.votamax-id-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
    color: #222;
}
.votamax-id-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.votamax-id-preview-label { color: #666; }
.votamax-id-option-name {
    color: var(--vm-primary, #6c63ff);
    font-weight: 700;
}
.votamax-id-no-fields {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 8px 0 16px;
}

/* ── Campos dentro do modal ────────────────────────────── */
.votamax-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}
.votamax-field-wrap {}
.votamax-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.votamax-required { color: #e53935; margin-left: 2px; }
.votamax-unique-badge {
    display: inline-block;
    background: rgba(108,99,255,0.12);
    color: #6c63ff;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
    vertical-align: middle;
}
.votamax-field {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: 9px;
    font-size: 15px;
    color: #333;
    background: #fff;
    transition: border-color var(--vm-transition), box-shadow var(--vm-transition);
    outline: none;
    font-family: inherit;
}
.votamax-field:focus {
    border-color: var(--vm-primary, #6c63ff);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

/* ── Botões do modal ───────────────────────────────────── */
.votamax-id-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.votamax-id-cancel-btn {
    flex: 1;
    padding: 12px;
    border-radius: 50px;
    border: 1.5px solid rgba(0,0,0,0.12);
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    font-family: inherit;
    transition: all var(--vm-transition);
}
.votamax-id-cancel-btn:hover {
    background: #f0f0f0;
    border-color: rgba(0,0,0,0.28);
    color: #111;
}
.votamax-submit-btn {
    flex: 2;
    background: var(--vm-primary, #6c63ff);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--vm-transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.votamax-submit-btn:hover {
    background: var(--vm-hover, #5a52d5);
    transform: translateY(-1px);
}
.votamax-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* ── Spinner ───────────────────────────────────────────── */
.votamax-spinner-sm {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vm-spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes vm-spin { to { transform: rotate(360deg); } }

/* ── Mensagem de erro ──────────────────────────────────── */
.votamax-error-msg {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

/* ── Votação encerrada ─────────────────────────────────── */
.votamax-closed-notice {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    margin: 16px 24px 0;
    border-radius: 8px;
    text-align: center;
}

/* ── Resultados ────────────────────────────────────────── */
.votamax-results-container { animation: vmFadeIn 0.4s ease; }
.votamax-results { padding: 20px 24px 24px; }

.votamax-results-header {
    text-align: center;
    margin-bottom: 20px;
}
.votamax-results-icon { font-size: 32px; display: block; margin-bottom: 6px; }
.votamax-results-title {
    font-size: 18px; font-weight: 800;
    margin: 0 0 6px; color: var(--vm-text);
}
.votamax-thanks {
    font-size: 14px; color: var(--vm-accent);
    font-weight: 600; margin: 0;
}

.votamax-results-list { display: flex; flex-direction: column; gap: 10px; }

.votamax-result-item {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.3s;
}
.votamax-result-item.votamax-result-voted {
    border-color: var(--vm-primary);
    background: rgba(108,99,255,0.04);
}

.votamax-result-top {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.votamax-result-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.votamax-result-name {
    flex: 1; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0;
}
.votamax-voted-badge {
    font-size: 10px; background: var(--vm-primary); color: #fff;
    padding: 2px 8px; border-radius: 20px; font-weight: 700; white-space: nowrap;
}
.votamax-lead-badge {
    font-size: 10px; background: #fff3cd; color: #856404;
    padding: 2px 8px; border-radius: 20px; font-weight: 700; white-space: nowrap;
}
.votamax-result-pct { font-size: 18px; font-weight: 800; color: var(--vm-primary); flex-shrink: 0; }

.votamax-result-bar-wrap {
    height: 10px; background: rgba(0,0,0,0.06);
    border-radius: 20px; overflow: hidden; margin-bottom: 5px;
}
.votamax-result-bar {
    height: 100%; background: var(--vm-accent); border-radius: 20px;
    transition: width 0.8s cubic-bezier(0.22,1,0.36,1); width: 0;
}
.votamax-result-item.votamax-result-voted .votamax-result-bar { background: var(--vm-primary); }

.votamax-result-count { font-size: 12px; opacity: 0.6; font-weight: 600; }

.votamax-results-footer {
    text-align: center; margin-top: 16px;
    font-size: 13px; opacity: 0.6;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.votamax-total-votes { font-weight: 700; opacity: 1; }

/* ── Botão modal de página (votamax_button) ────────────── */
.votamax-modal-btn {
    display: inline-block;
    background: var(--vm-primary, #6c63ff);
    color: #fff !important;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.votamax-modal-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

.votamax-page-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999998;
    align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.votamax-page-modal-overlay.votamax-modal-open { display: flex; }

.votamax-page-modal-box {
    background: #fff; border-radius: 16px;
    max-width: 700px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: vmSlideUp 0.3s cubic-bezier(0.22,1,0.36,1);
}
.votamax-page-modal-close {
    position: sticky; top: 12px; float: right;
    margin: 12px 12px 0 0;
    background: rgba(0,0,0,0.08); border: none;
    border-radius: 50%; width: 32px; height: 32px;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 2; transition: background 0.2s; color: #555;
}
.votamax-page-modal-close:hover { background: rgba(0,0,0,0.14); }
.votamax-page-modal-content .votamax-poll { margin: 0; box-shadow: none; border-radius: 0; border: none; max-width: none; }

.votamax-modal-loading { text-align: center; padding: 48px 24px; color: #888; }
.votamax-spinner {
    display: inline-block; width: 36px; height: 36px;
    border: 3px solid rgba(108,99,255,0.2);
    border-top-color: #6c63ff;
    border-radius: 50%;
    animation: vm-spin 0.8s linear infinite;
    margin-bottom: 12px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 520px) {
    .votamax-header { padding: 16px 16px 0; }
    .votamax-body   { padding: 14px 16px 18px; }
    .votamax-results { padding: 14px 16px 18px; }
    .votamax-title  { font-size: 18px; }
    .votamax-options-image { grid-template-columns: repeat(2,1fr); }
    .votamax-vote-trigger-btn { width: 100%; }
    .votamax-id-box { padding: 24px 18px 20px; }
    .votamax-id-actions { flex-direction: column; }
}
