﻿/* ============================================================
   COMMUNITY POLL
   사용자 글쓰기/수정/상세 공통
   ============================================================ */

.post-poll-editor,
.post-poll-view {
    margin: 18px 0;
    border: 1px solid #e2e7ee;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

.post-poll-editor__head,
.post-poll-view__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: #f8fafc;
}

.post-poll-editor__head strong {
    display: block;
    font-size: 15px;
}

.post-poll-editor__head p {
    margin: 4px 0 0;
    color: #7a8594;
    font-size: 12px;
}

.post-poll-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.post-poll-editor__body {
    padding: 18px;
}

.post-poll-field > label,
.post-poll-options__head > label {
    display: block;
    margin-bottom: 6px;
    color: #394150;
    font-size: 12px;
    font-weight: 700;
}

.post-poll-field input[type="text"],
.post-poll-field input[type="datetime-local"],
.post-poll-field select,
.post-poll-option-row input {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #d8dee7;
    border-radius: 7px;
    background: #fff;
    box-sizing: border-box;
    font: inherit;
    font-size: 13px;
}

.post-poll-field select:disabled,
.post-poll-option-row input:disabled,
.post-poll-option-add:disabled,
.post-poll-option-remove:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.post-poll-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.post-poll-options {
    margin-top: 16px;
}

.post-poll-options__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.post-poll-option-add,
.post-poll-option-remove {
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.post-poll-option-add {
    min-height: 30px;
    padding: 0 10px;
    background: #edf4ff;
    color: #2762b8;
}

.post-poll-option-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) 52px;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.post-poll-option-no {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #f1f3f6;
    color: #66717d;
    font-size: 10px;
    font-weight: 700;
}

.post-poll-option-remove {
    min-height: 32px;
    background: #fff0f0;
    color: #ae4242;
}

.post-poll-help,
.post-poll-edit-notice {
    margin: 8px 0 0;
    color: #7a8594;
    font-size: 11px;
    line-height: 1.55;
}

.post-poll-edit-notice {
    padding: 9px 11px;
    border-radius: 7px;
    background: #fff9e8;
    color: #8a6415;
}

.post-poll-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
}

.post-poll-checks label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
}


/* 상세 */

.post-poll-view {
    padding: 18px;
}

.post-poll-view__head {
    margin: -18px -18px 0;
}

.post-poll-view__badge {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #315fae;
    font-size: 10px;
    font-weight: 800;
}

.post-poll-view__head h3 {
    margin: 7px 0 0;
    color: #202631;
    font-size: 17px;
    line-height: 1.45;
}

.post-poll-view__participants {
    color: #7a8594;
    font-size: 11px;
    white-space: nowrap;
}

.post-poll-view__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 14px;
    color: #7a8594;
    font-size: 11px;
}

.post-poll-view__options {
    margin-top: 14px;
}

.post-poll-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 7px;
    padding: 11px;
    border: 1px solid #e3e7ed;
    border-radius: 9px;
    cursor: pointer;
}

.post-poll-option:hover {
    border-color: #b9cae4;
    background: #fbfcff;
}

.post-poll-option__input {
    padding-top: 1px;
}

.post-poll-option__content {
    flex: 1;
    min-width: 0;
}

.post-poll-option__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
}

.post-poll-option__result {
    flex: 0 0 auto;
    color: #7a8594;
    font-size: 10px;
}

.post-poll-option__bar {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf0f3;
}

.post-poll-option__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #477bd0;
    transition: width .2s ease;
}

.post-poll-view__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.post-poll-submit,
.post-poll-result-toggle {
    min-height: 36px;
    padding: 0 13px;
    border: 0;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.post-poll-submit {
    background: #315fae;
    color: #fff;
}

.post-poll-result-toggle {
    background: #eef1f5;
    color: #45515f;
}

.post-poll-state {
    color: #7a8594;
    font-size: 11px;
}

.post-poll-view__message {
    margin: 10px 0 0;
    padding: 9px 10px;
    border-radius: 7px;
    background: #f5f7fa;
    color: #45515f;
    font-size: 11px;
}

.post-poll-view__message.is-error {
    background: #fff0f0;
    color: #a33e3e;
}

.post-poll-view__message.is-success {
    background: #edf9f0;
    color: #287849;
}

@media (max-width: 700px) {
    .post-poll-editor__head,
    .post-poll-view__head {
        padding: 14px;
    }

    .post-poll-editor__body,
    .post-poll-view {
        padding: 14px;
    }

    .post-poll-view__head {
        margin: -14px -14px 0;
    }

    .post-poll-row {
        grid-template-columns: 1fr;
    }

    .post-poll-option-row {
        grid-template-columns: 25px minmax(0, 1fr);
    }

    .post-poll-option-remove {
        grid-column: 2;
        justify-self: end;
        width: 52px;
    }

    .post-poll-view__head,
    .post-poll-option__label {
        display: block;
    }

    .post-poll-view__participants,
    .post-poll-option__result {
        display: block;
        margin-top: 5px;
    }
}


/* ============================================================
   STEP7 - 게시글 목록 설문 배지
   ============================================================ */
.post-poll-list-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
    margin-left: 6px;
    padding: 0 7px;
    border: 1px solid #cfe0fb;
    border-radius: 999px;
    background: #edf4ff;
    color: #315fae;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
}

.post-poll-list-badge > span {
    color: #66788d;
    font-size: 9px;
    font-weight: 650;
}

.popular-poll-meta {
    margin-top: 6px;
}

.popular-poll-meta .post-poll-list-badge {
    margin-left: 0;
}

@media (max-width: 700px) {
    .post-poll-list-badge.is-mobile {
        min-height: 19px;
        margin-left: 5px;
        padding: 0 6px;
        font-size: 9px;
    }
}
