/* WP WhatsApp Poll - Frontend Styles */
:root {
    --wwp-green:      #128C7E;
    --wwp-green-lt:   #25D366;
    --wwp-bar-bg:     rgba(18, 140, 126, 0.12);
    --wwp-bar-fill:   #25D366;
    --wwp-border:     #e0e0e0;
    --wwp-text:       #1a1a1a;
    --wwp-muted:      #8696a0;
    --wwp-radius:     12px;
    --wwp-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.wwpoll-wrap {
    font-family: var(--wwp-font);
    background: #ffffff;
    border: 1.5px solid var(--wwp-border);
    border-radius: var(--wwp-radius);
    padding: 20px 22px 16px;
    max-width: 520px;
    margin: 1.5em auto;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Question */
.wwpoll-question {
    font-size: 16px;
    font-weight: 700;
    color: var(--wwp-text);
    margin: 0 0 16px;
    line-height: 1.4;
}

/* Options list */
.wwpoll-form {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}
.wwpoll-options {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wwpoll-option {
    border: 1.5px solid var(--wwp-border);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    cursor: pointer;
    position: relative;
    background: #fff;
}
.wwpoll-option:hover {
    border-color: var(--wwp-green);
    box-shadow: 0 0 0 3px rgba(18,140,126,.08);
}
.wwpoll-option.wwpoll-chosen {
    border-color: var(--wwp-green);
    background: rgba(18,140,126,.04);
}

/* Option label */
.wwpoll-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 6px;
    cursor: pointer;
    user-select: none;
}

/* Hide native input */
.wwpoll-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom radio/checkbox dot */
.wwpoll-radio-dot {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid var(--wwp-green);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s;
    position: relative;
    flex-shrink: 0;
}
.wwpoll-option.wwpoll-chosen .wwpoll-radio-dot,
.wwpoll-input:checked ~ .wwpoll-radio-dot {
    background: var(--wwp-green);
    border-color: var(--wwp-green);
}
.wwpoll-option.wwpoll-chosen .wwpoll-radio-dot::after,
.wwpoll-input:checked ~ .wwpoll-radio-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    display: block;
}

/* Checkbox style override */
[data-type="multiple"] .wwpoll-radio-dot {
    border-radius: 5px;
}
[data-type="multiple"] .wwpoll-option.wwpoll-chosen .wwpoll-radio-dot::after,
[data-type="multiple"] .wwpoll-input:checked ~ .wwpoll-radio-dot::after {
    content: '✓';
    background: transparent;
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 0;
    width: auto;
    height: auto;
}

.wwpoll-opt-text {
    flex: 1;
    font-size: 15px;
    color: var(--wwp-text);
    line-height: 1.3;
}
.wwpoll-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--wwp-green);
    min-width: 40px;
    text-align: right;
}
.wwpoll-checkmark {
    font-size: 16px;
    color: var(--wwp-green);
    font-weight: 700;
    margin-left: 4px;
}

/* Progress bar */
.wwpoll-bar-wrap {
    height: 5px;
    background: var(--wwp-bar-bg);
    margin: 0 14px 10px;
    border-radius: 3px;
    overflow: hidden;
}
.wwpoll-bar {
    height: 100%;
    background: var(--wwp-bar-fill);
    border-radius: 3px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    width: 0;
}

/* Submit button */
.wwpoll-submit-btn {
    display: block;
    width: 100%;
    padding: 11px;
    background: var(--wwp-green);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 4px;
    transition: background .2s, opacity .2s;
    letter-spacing: .02em;
}
.wwpoll-submit-btn:hover:not(:disabled) {
    background: #0f7a6e;
}
.wwpoll-submit-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Footer */
.wwpoll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.wwpoll-vote-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--wwp-muted);
}
.wwpoll-vote-count svg {
    color: var(--wwp-green);
    flex-shrink: 0;
}
.wwpoll-total { font-weight: 700; color: var(--wwp-green); }
.wwpoll-voted-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--wwp-green-lt);
    background: rgba(37,211,102,.1);
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: .03em;
}

/* Loading state */
.wwpoll-option.wwpoll-loading {
    opacity: .6;
    pointer-events: none;
}

/* Error */
.wwpoll-error {
    color: #cc0000;
    font-size: 14px;
    padding: 8px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .wwpoll-wrap { padding: 14px 14px 12px; }
    .wwpoll-question { font-size: 15px; }
    .wwpoll-opt-text { font-size: 14px; }
}


/* ============================================
   SHARE SECTION  (v1.2 — single button + dropdown)
   ============================================ */

/* The single "Share Poll" trigger button */
.wwpoll-share-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.wwpoll-share-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: #f5f5f5;
    color: #333;
    border: 1.5px solid #e0e0e0;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--wwp-font);
    transition: background .18s, border-color .18s, color .18s;
    user-select: none;
}
.wwpoll-share-toggle-btn:hover {
    background: #128C7E;
    border-color: #128C7E;
    color: #fff;
}
.wwpoll-share-toggle-btn.active {
    background: #128C7E;
    border-color: #128C7E;
    color: #fff;
}
.wwpoll-chevron {
    transition: transform .25s;
    flex-shrink: 0;
}
.wwpoll-share-toggle-btn.active .wwpoll-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel */
.wwpoll-share-dropdown {
    margin-top: 12px;
    background: #fafafa;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    padding: 14px;
    animation: wwpoll-slide-in .2s ease;
}
@keyframes wwpoll-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Copy link row */
.wwpoll-copy-row {
    display: flex;
    gap: 7px;
    margin-bottom: 12px;
}
.wwpoll-copy-input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 8px 10px;
    border: 1.5px solid var(--wwp-border);
    border-radius: 7px;
    color: #555;
    background: #fff;
    cursor: text;
    font-family: var(--wwp-font);
}
.wwpoll-copy-input:focus { outline: none; border-color: var(--wwp-green); }

.wwpoll-copy-inline-btn {
    padding: 8px 14px;
    background: var(--wwp-green);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--wwp-font);
    transition: background .18s;
}
.wwpoll-copy-inline-btn:hover { background: #0f7a6e; }

/* Platform buttons row */
.wwpoll-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wwpoll-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: opacity .18s, transform .15s;
    white-space: nowrap;
    font-family: var(--wwp-font);
    color: #fff;
}
.wwpoll-share-btn:hover  { opacity: .85; transform: translateY(-1px); }
.wwpoll-share-btn:active { transform: scale(.97); }

.wwpoll-wa-btn    { background: #25D366; }
.wwpoll-fb-btn    { background: #1877F2; }
.wwpoll-tw-btn    { background: #000;    }
.wwpoll-email-btn { background: #EA4335; }

/* Toast */
.wwpoll-copy-toast {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wwp-green-lt);
    text-align: center;
    animation: wwpoll-pop .2s ease;
}
@keyframes wwpoll-pop {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 420px) {
    .wwpoll-share-btn { font-size: 12px; padding: 8px 11px; }
    .wwpoll-share-toggle-btn { font-size: 13px; padding: 8px 14px; }
}