/* =========================================
   🎨 FIXER POLL ULTIMATE STYLES
========================================= */

:root {
    --fp-primary: #667eea;
    --fp-secondary: #764ba2;
    --fp-success: #10b981;
    --fp-error: #ef4444;
    --fp-text: #1f2937;
    --fp-bg: #ffffff;
    --fp-border: #e5e7eb;
    --fp-radius: 16px;
    --fp-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* کانتینر اصلی */
.fixer-poll-container {
    background: var(--fp-bg);
    border-radius: var(--fp-radius);
    box-shadow: var(--fp-shadow);
    padding: 30px;
    max-width: 700px;
    margin: 30px auto;
    font-family: inherit;
    border: 1px solid var(--fp-border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.fixer-poll-container.gamification-enabled {
    border-top: 5px solid var(--fp-primary);
}

/* هدر */
.fixer-poll-header { margin-bottom: 25px; text-align: center; }
.fixer-poll-title { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: var(--fp-text); }
.fixer-poll-description { font-size: 14px; color: #6b7280; margin: 0; }

/* گزینه‌ها */
.fixer-poll-options { display: flex; flex-direction: column; gap: 15px; }

.fixer-poll-option {
    position: relative; cursor: pointer; display: block;
    transition: transform 0.2s;
}
.fixer-poll-option:hover { transform: translateY(-2px); }

.poll-input { position: absolute; opacity: 0; cursor: pointer; }

.option-content {
    display: flex; align-items: center; gap: 15px;
    padding: 15px 20px;
    border: 2px solid var(--fp-border);
    border-radius: 12px;
    background: #f9fafb;
    transition: all 0.3s;
}

/* حالت انتخاب شده */
.poll-input:checked + .option-content {
    border-color: var(--fp-primary);
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.check-indicator {
    width: 24px; height: 24px;
    border: 2px solid #d1d5db; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.2s;
}
.check-indicator::after {
    content: ''; width: 12px; height: 12px;
    background: var(--fp-primary); border-radius: 50%;
    transform: scale(0); transition: transform 0.2s;
}
.poll-input:checked + .option-content .check-indicator { border-color: var(--fp-primary); }
.poll-input:checked + .option-content .check-indicator::after { transform: scale(1); }

/* مدیا (تصویر/ویدیو) */
.option-media { width: 100%; margin-bottom: 10px; border-radius: 8px; overflow: hidden; }
.option-media img, .option-media video, .option-media iframe {
    width: 100%; height: auto; display: block; border-radius: 8px;
}
.fixer-poll-options.type-image .option-content { flex-direction: column; align-items: flex-start; padding: 10px; }
.fixer-poll-options.type-video .option-content { flex-direction: column; padding: 0; overflow: hidden; }
.fixer-poll-options.type-video .option-text { padding: 15px; width: 100%; background: #fff; }

/* دکمه ثبت */
.fixer-poll-submit {
    width: 100%; margin-top: 25px; padding: 16px;
    background: linear-gradient(135deg, var(--fp-primary), var(--fp-secondary));
    color: white; border: none; border-radius: 12px;
    font-size: 16px; font-weight: bold; cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}
.fixer-poll-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); }
.fixer-poll-submit:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }

/* نتایج */
.result-item { margin-bottom: 15px; }
.result-info { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 14px; font-weight: 600; }
.result-bar-bg { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.result-bar-fill { height: 100%; background: var(--fp-primary); border-radius: 4px; transition: width 1s ease; }

/* --- 🎭 حالت‌های خاص --- */

/* 1. حالت کویز (Quiz) */
.mode-quiz .poll-input:checked + .option-content { border-color: #f59e0b; background: #fffbeb; }
.mode-quiz.voted .poll-input:checked + .option-content.correct { border-color: #10b981; background: #ecfdf5; }
.mode-quiz.voted .poll-input:checked + .option-content.wrong { border-color: #ef4444; background: #fef2f2; }

/* 2. حالت استوری (Story) */
.mode-story {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 99999; background: #000; color: #fff;
    border-radius: 0; margin: 0; max-width: none;
    display: flex; flex-direction: column; justify-content: center;
    background-size: cover; background-position: center;
}
.mode-story .fixer-poll-title { color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.mode-story .option-content { background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.mode-story .close-story-btn { position: absolute; top: 20px; right: 20px; font-size: 30px; color: #fff; background: none; border: none; cursor: pointer; }

/* 3. حالت مناظره (Debate - Comments) */
.fixer-poll-debate-section {
    margin-top: 30px; padding-top: 20px; border-top: 1px dashed #e5e7eb;
}
.debate-comments-list {
    max-height: 250px; overflow-y: auto; margin-bottom: 15px;
    background: #f9fafb; padding: 15px; border-radius: 10px;
}
.debate-comment {
    background: #fff; padding: 10px; border-radius: 8px; margin-bottom: 8px;
    border-left: 3px solid var(--fp-primary); font-size: 13px;
}
.debate-comment-form { display: flex; gap: 10px; flex-direction: column; }
.debate-comment-form input, .debate-comment-form textarea {
    width: 100%; padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px;
}
.fixer-btn-small { padding: 8px 15px; background: var(--fp-secondary); color: white; border: none; border-radius: 6px; cursor: pointer; align-self: flex-end; }

/* پیام‌ها */
.fixer-poll-message { margin-top: 20px; padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; }
.fixer-poll-message.success { background: #d1fae5; color: #065f46; }
.fixer-poll-message.error { background: #fee2e2; color: #991b1b; }

/* واکنش‌گرا */
@media (max-width: 600px) {
    .fixer-poll-container { padding: 20px; margin: 15px; }
    .fixer-poll-title { font-size: 18px; }
    .option-content { padding: 12px; }
}