/* استایل‌های عمومی نظرسنجی — فرانت‌اند سایت */
.espolls-container {
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 25px;
    margin-bottom: 30px;
}

/* عنوان نظرسنجی */
.espolls-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 0 0 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007cba;
    text-align: center;
}

/* توضیحات نظرسنجی */
.espolls-description {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 3px solid #007cba;
}

/* لیست گزینه‌ها */
.espolls-options {
    margin: 25px 0;
}

.espolls-option {
    margin-bottom: 15px;
    padding: 15px;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.espolls-option:hover {
    background: #f0f7ff;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.espolls-option.selected {
    background: #e6f2ff;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.2);
}

/* رادیو/چک‌باکس */
.espolls-option input[type="radio"],
.espolls-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-left: 12px;
    cursor: pointer;
}

/* برچسب گزینه */
.espolls-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* دکمه رأی دادن */
.espolls-vote-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 25px 0 15px;
    box-shadow: 0 2px 5px rgba(0,124,186,0.3);
}

.espolls-vote-btn:hover {
    background: #006799;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,124,186,0.4);
}

.espolls-vote-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* حالت در حال پردازش */
.espolls-vote-btn.processing {
    background: #6c757d;
    cursor: wait;
}

/* نتایج */
.espolls-results {
    margin: 30px 0 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-top: 3px solid #28a745;
}

.espolls-results-title {
    font-size: 18px;
    font-weight: 700;
    color: #28a745;
    margin: 0 0 20px;
    text-align: center;
}

.espolls-result-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.espolls-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.espolls-progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    margin: 10px 0;
}

.espolls-progress-fill {
    height: 100%;
    background: #28a745;
    border-radius: 12px;
    transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

.espolls-progress-fill:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* پیام‌ها */
.espolls-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.espolls-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.espolls-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.espolls-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .espolls-container {
        margin: 0 10px 30px;
        padding: 20px 15px;
        border-radius: 8px;
    }
    
    .espolls-title {
        font-size: 20px;
        padding-bottom: 10px;
    }
    
    .espolls-description {
        font-size: 14px;
        padding: 12px;
    }
    
    .espolls-option {
        padding: 12px;
    }
    
    .espolls-option label {
        font-size: 15px;
    }
    
    .espolls-vote-btn {
        padding: 12px;
        font-size: 15px;
    }
    
    .espolls-results {
        padding: 20px 15px;
    }
    
    .espolls-result-header {
        font-size: 14px;
    }
    
    .espolls-progress-bar {
        height: 20px;
    }
}

/* برای المنتور */
.elementor-widget-espolls .espolls-container {
    margin: 0;
}

/* انیمیشن نتایج */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.espolls-results {
    animation: fadeInUp 0.6s ease forwards;
}

.espolls-result-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(0.1s * var(--index, 0));
}

/* برای گزینه‌های چندتایی */
.espolls-option input[type="checkbox"] {
    accent-color: #007cba;
}

/* دکمه‌های کوچک */
.espolls-refresh-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
}

.espolls-refresh-btn:hover {
    background: #5a6268;
}