/* ═══════════════════════════════════════════════════════
   SW Polls — Frontend Widget Styles
   Servicii-Website.ro
   ═══════════════════════════════════════════════════════ */

/* ─── CONTAINER ─── */
.sw-poll {
    max-width: 520px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin: 20px 0;
    transition: box-shadow 0.3s ease;
}
.sw-poll:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ─── HEADER ─── */
.sw-poll__header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1a2744 100%);
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}
.sw-poll__header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #2563eb);
    background-size: 200% 100%;
    animation: sw-gradient-move 3s ease infinite;
}
@keyframes sw-gradient-move {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
    100% { background-position: 0% 0%; }
}
.sw-poll__header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.sw-poll__header-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: sw-dot-pulse 2s ease-in-out infinite;
}
@keyframes sw-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

/* ─── BODY ─── */
.sw-poll__body {
    padding: 22px;
}

/* ─── QUESTION ─── */
.sw-poll__question {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
    margin: 0 0 18px 0;
    letter-spacing: -0.01em;
}

/* ─── VOTING OPTIONS (pre-vote) ─── */
.sw-poll__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sw-poll__option-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    line-height: 1.4;
}
.sw-poll__option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
    transition: width 0.3s ease;
}
.sw-poll__option-btn:hover {
    border-color: #2563eb;
    background: #f0f4ff;
    color: #1e40af;
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.12);
}
.sw-poll__option-btn:hover::before {
    width: 100%;
}
.sw-poll__option-btn:active {
    transform: translateX(2px) scale(0.99);
}
.sw-poll__option-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}
.sw-poll__option-btn:hover .sw-poll__option-radio {
    border-color: #2563eb;
}
.sw-poll__option-btn:hover .sw-poll__option-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    animation: sw-radio-in 0.15s ease;
}
@keyframes sw-radio-in {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ─── RESULTS (post-vote) ─── */
.sw-poll__results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sw-poll__result-row {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}
.sw-poll__result-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sw-poll__result-text {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
    line-height: 1.4;
}
.sw-poll__result-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sw-poll__result-bar-track {
    flex: 1;
    height: 26px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.sw-poll__result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    min-width: 0;
    width: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.sw-poll__result-bar-fill--animated {
    animation: sw-bar-glow 2s ease-in-out infinite;
}
@keyframes sw-bar-glow {
    0%, 100% { box-shadow: inset 0 0 0 rgba(255,255,255,0); }
    50% { box-shadow: inset 0 0 20px rgba(255,255,255,0.1); }
}
.sw-poll__result-pct {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.sw-poll__result-votes {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    min-width: 40px;
    text-align: right;
    white-space: nowrap;
}

/* ─── VOTED HIGHLIGHT ─── */
.sw-poll__result-row--voted .sw-poll__result-text {
    color: #1e293b;
    font-weight: 700;
}
.sw-poll__result-row--voted .sw-poll__result-bar-fill {
    background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
}

/* ─── FOOTER ─── */
.sw-poll__footer {
    padding: 12px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}
.sw-poll__total {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}
.sw-poll__total strong {
    color: #64748b;
}
.sw-poll__brand {
    font-size: 10px;
    color: #cbd5e1;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.sw-poll__brand a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}
.sw-poll__brand a:hover {
    color: #2563eb;
}

/* ─── CLOSED STATE ─── */
.sw-poll--closed .sw-poll__header-badge {
    background: #64748b;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}
.sw-poll--closed .sw-poll__header::before {
    background: linear-gradient(90deg, #64748b, #94a3b8, #64748b);
}

/* ─── LOADING ─── */
.sw-poll__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #94a3b8;
    font-size: 13px;
}
.sw-poll__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sw-spin 0.6s linear infinite;
}
@keyframes sw-spin {
    to { transform: rotate(360deg); }
}

/* ─── TRANSITIONS ─── */
.sw-poll__options--hiding {
    animation: sw-fade-out 0.3s ease forwards;
}
.sw-poll__results--showing {
    animation: sw-fade-in-up 0.4s ease forwards;
}
@keyframes sw-fade-out {
    to { opacity: 0; transform: translateY(-8px); }
}
@keyframes sw-fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .sw-poll {
        border-radius: 10px;
        margin: 12px 0;
    }
    .sw-poll__body {
        padding: 16px;
    }
    .sw-poll__question {
        font-size: 14px;
    }
    .sw-poll__option-btn {
        padding: 12px 14px;
        font-size: 13px;
    }
    .sw-poll__result-bar-wrap {
        gap: 8px;
    }
}
