/* PollWidget — карточка опроса и модалка создания (MLP-239). Dark glassmorphism. */

.poll-widget { margin: 6px 0; }

.poll-card {
    background: rgba(40, 30, 60, 0.55);
    border: 1px solid rgba(160, 130, 210, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    backdrop-filter: blur(6px);
    max-width: 460px;
}
.poll-card-error { color: #d9a; font-size: 0.9em; }

.poll-question {
    font-weight: 600;
    margin-bottom: 10px;
    font-family: 'Philosopher', sans-serif;
    font-size: 1.05em;
}
.poll-badges { font-size: 0.85em; opacity: 0.85; white-space: nowrap; }
.poll-badge { margin-left: 4px; }
.poll-badge-closed {
    font-size: 0.75em; background: rgba(0,0,0,0.35);
    padding: 1px 6px; border-radius: 8px; color: #caa;
}

.poll-options { display: flex; flex-direction: column; gap: 6px; }

.poll-option {
    position: relative;
    border: 1px solid rgba(160, 130, 210, 0.3);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    /* overflow видимый — иначе обрезается тултип голосовавших; полоску клипает barwrap */
    overflow: visible;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.poll-option:hover { border-color: rgba(190, 160, 240, 0.7); z-index: 10; } /* поднять над соседями для тултипа */
.poll-option-closed { cursor: default; }
.poll-option-mine { border-color: #a97fd6; box-shadow: inset 0 0 0 1px #a97fd6; }

/* Враппер полоски: клипает её по скруглению, не трогая тултип */
.poll-option-barwrap {
    position: absolute; inset: 0; overflow: hidden;
    border-radius: 8px; z-index: 0; pointer-events: none;
}

/* Полоска результата (live) */
.poll-option-bar {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(140, 90, 200, 0.4), rgba(110, 70, 160, 0.28));
    width: 0; transition: width 0.4s ease;
}
.poll-option-mine .poll-option-bar {
    background: linear-gradient(90deg, rgba(170, 120, 230, 0.55), rgba(130, 90, 190, 0.4));
}

.poll-option-content {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 8px;
}
.poll-option-img {
    width: 40px; height: 40px; object-fit: cover;
    border-radius: 6px; cursor: zoom-in; flex-shrink: 0;
}
.poll-option-text { flex: 1; word-break: break-word; }
.poll-option-stat { font-size: 0.85em; opacity: 0.85; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Тултип «кто голосовал» (не-анонимные) */
.poll-voters-wrap { position: relative; }
.poll-voters-tip {
    display: none;
    position: absolute; right: 0; bottom: 100%;
    background: rgba(20, 15, 30, 0.96);
    border: 1px solid rgba(160,130,210,0.4); border-radius: 8px;
    padding: 6px 8px; margin-bottom: 4px;
    white-space: nowrap; z-index: 20; max-width: 240px; overflow: hidden;
}
.poll-option:hover .poll-voters-tip { display: block; }
.poll-voter { display: flex; align-items: center; gap: 5px; font-size: 0.85em; padding: 1px 0; }
.poll-voter-av { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }

.poll-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 10px; font-size: 0.85em; opacity: 0.9;
}
.poll-close-btn {
    background: rgba(180, 70, 90, 0.25); border: 1px solid rgba(210,110,130,0.5);
    color: #e7b8c2; border-radius: 8px; padding: 3px 10px; cursor: pointer;
}
.poll-close-btn:hover { background: rgba(200, 80, 100, 0.4); }

/* ---------------- Модалка создания ---------------- */
.pc-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
}
.pc-modal {
    background: rgba(35, 28, 52, 0.98); backdrop-filter: blur(10px);
    border: 1px solid rgba(160,130,210,0.4); border-radius: 14px;
    padding: 18px; width: min(440px, 92vw); max-height: 88vh; overflow-y: auto;
    color: #eee;
}
.pc-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.15em; font-weight: 600; margin-bottom: 12px;
    font-family: 'Philosopher', sans-serif;
}
.pc-close { background: none; border: none; color: #caa; font-size: 1.1em; cursor: pointer; }
.pc-question, .pc-opt-text {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(160,130,210,0.35);
    border-radius: 8px; color: #fff; margin-bottom: 8px;
}
.pc-option { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.pc-option .pc-opt-text { flex: 1; margin-bottom: 0; }
.pc-opt-img-btn, .pc-opt-remove {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(160,130,210,0.35);
    border-radius: 8px; color: #ccc; cursor: pointer; padding: 6px 9px;
}
.pc-opt-preview { flex-basis: 100%; }
.pc-opt-preview img { max-height: 60px; border-radius: 6px; vertical-align: middle; margin-right: 8px; }
.pc-opt-img-clear { background: none; border: none; color: #d9a; cursor: pointer; font-size: 0.85em; }
.pc-add-option {
    background: none; border: 1px dashed rgba(160,130,210,0.5);
    color: #bfa8e0; border-radius: 8px; padding: 6px 10px; cursor: pointer; margin: 4px 0 10px;
}
.pc-flag { display: block; margin: 4px 0; font-size: 0.95em; cursor: pointer; }
.pc-flag input { margin-right: 6px; }
.pc-actions { margin-top: 12px; text-align: right; }
.pc-submit {
    background: linear-gradient(90deg, #8a5ac8, #6e46a0); border: none;
    color: #fff; border-radius: 8px; padding: 9px 18px; cursor: pointer; font-weight: 600;
}
.pc-submit:disabled { opacity: 0.6; cursor: default; }

/* Кнопка «Создать опрос» в тулбаре чата */
#poll-btn { font-size: 1em; }
