/* ============================================================
 * Feed Detail Modal — 피드 상세 보기 + 댓글
 * ============================================================ */

/* --- Overlay --- */
.fdm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    opacity: 0;
    transition: opacity .25s ease;
    display: none;
}
.fdm-overlay.is-open {
    display: block;
    opacity: 1;
}

/* --- Modal Container --- */
.fdm-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    width: 92%;
    max-width: 600px;
    max-height: 85vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(0,0,0,.15);
    z-index: 1001;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
}
.fdm-modal.is-open {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- Header --- */
.fdm-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f2f2f2;
    flex-shrink: 0;
    position: relative;
}
.fdm-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fdm-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #E8F5E9;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700;
    color: #5B8C6B;
    flex-shrink: 0;
}
.fdm-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #2E2E2E;
}
.fdm-author-meta {
    font-size: 12px;
    color: #999;
}
.fdm-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.fdm-close {
    width: 32px; height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #999;
    transition: background .2s;
    flex-shrink: 0;
}
.fdm-close:hover {
    background: #eee;
    color: #666;
}
.fdm-close .material-icons { font-size: 18px; }
.fdm-delete {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: background .2s;
    flex-shrink: 0;
}
.fdm-delete:hover {
    background: #fdecec;
    color: #d44848;
}
.fdm-delete .material-icons { font-size: 18px; }
.fdm-action-menu {
    position: absolute;
    top: 38px;
    right: 0;
    min-width: 120px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 5;
}
.fdm-action-menu__item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}
.fdm-action-menu__item:hover {
    background: #f7f7f7;
}
.fdm-action-menu__item.is-danger {
    color: #d44848;
}

/* 퀘스트(코호트) 공개 — 상세 본문 위 메타 */
.fdm-quest-strip {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(91, 140, 107, 0.09), rgba(129, 199, 132, 0.06));
    border: 1px solid rgba(91, 140, 107, 0.2);
}
.fdm-quest-strip__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.fdm-quest-strip__badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #3E6B4E;
    background: rgba(129, 199, 132, 0.35);
}
.fdm-quest-strip__name {
    font-size: 13px;
    font-weight: 700;
    color: #2E2E2E;
}
.fdm-quest-strip__round {
    font-size: 12px;
    font-weight: 600;
    color: #5B8C6B;
    margin-top: 6px;
}
.fdm-quest-strip__prompt {
    font-size: 13px;
    line-height: 1.65;
    color: #444;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: keep-all;
}
.fdm-quest-strip__context-wrap {
    margin-top: 8px;
}
.fdm-quest-strip__context-toggle {
    border: 1px solid rgba(91, 140, 107, 0.32);
    background: rgba(255, 255, 255, 0.74);
    color: #466f55;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.fdm-quest-strip__context {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.65;
    color: #5d5d5d;
    white-space: pre-wrap;
    word-break: keep-all;
}
.fdm-quest-strip__questions {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 12px;
    color: #3f3f3f;
    line-height: 1.55;
}

/* --- Scrollable Body --- */
.fdm-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    overscroll-behavior: contain;
}

/* --- Content --- */
.fdm-content {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 20px;
}

/* --- Edit Mode --- */
.fdm-edit {
    margin-bottom: 20px;
}
.fdm-edit__textarea {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    min-height: 160px;
    resize: vertical;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fafbf9;
    outline: none;
}
.fdm-edit__textarea:focus {
    border-color: #5B8C6B;
}
.fdm-edit__options {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.fdm-edit__option,
.fdm-edit__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}
.fdm-edit__select {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    font-size: 13px;
}
.fdm-edit__actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.fdm-edit__btn {
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
}
.fdm-edit__btn--ghost {
    background: #f4f4f4;
    color: #666;
}
.fdm-edit__btn--primary {
    background: #5B8C6B;
    color: #fff;
}
.fdm-edit__btn:disabled {
    opacity: .6;
    cursor: default;
}

/* --- Reactions Bar --- */
.fdm-reactions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid #f2f2f2;
    border-bottom: 1px solid #f2f2f2;
    margin-bottom: 20px;
}
.fdm-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #eee;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    transition: all .2s ease;
}
.fdm-react-btn .material-icons { font-size: 16px; }
.fdm-react-btn:hover,
.fdm-react-btn.is-active {
    border-color: #5B8C6B;
    color: #5B8C6B;
    background: #E8F5E9;
}
.fdm-react-time {
    margin-left: auto;
    font-size: 12px;
    color: #bbb;
}

.fdm-empathy-note {
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid #e7efe7;
    border-radius: 12px;
    background: #fbfefb;
}
.fdm-empathy-note__title {
    font-size: 13px;
    font-weight: 700;
    color: #2f5d3f;
}
.fdm-empathy-note__desc {
    font-size: 12px;
    color: #6f7f71;
    margin-top: 4px;
}
.fdm-empathy-note__meta {
    font-size: 11px;
    color: #6f7f71;
    margin-top: 4px;
}
.fdm-empathy-note__chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.fdm-empathy-note-chip {
    border: 1px solid #dfe9df;
    background: #f7fbf7;
    color: #4a7056;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.35;
    padding: 7px 10px;
    cursor: pointer;
    text-align: left;
}
.fdm-empathy-note-chip:hover {
    background: #eef7ef;
}
.fdm-empathy-note-chip.is-active {
    background: #e5f2e6;
    border-color: #b9d8be;
}
.fdm-empathy-note-chip__count {
    margin-left: 6px;
    font-weight: 700;
    color: #34523f;
}
.fdm-empathy-note__row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.fdm-empathy-note__field {
    flex: 1;
    border: 1px solid #e1e8e1;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
}
.fdm-empathy-note__send {
    border: none;
    border-radius: 10px;
    background: #5b8c6b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 10px;
    cursor: pointer;
}
.fdm-empathy-note__send:disabled {
    background: #c8d7cb;
    cursor: default;
}
.fdm-empathy-note__mine {
    display: none;
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f2f8f2;
    border: 1px solid #d7e8d9;
}
.fdm-empathy-note__mine-label {
    font-size: 11px;
    font-weight: 700;
    color: #456a51;
}
.fdm-empathy-note__mine-text {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #34523f;
    word-break: break-word;
}
.fdm-empathy-note__mine-time {
    margin-top: 4px;
    font-size: 11px;
    color: #7b8f7f;
}

/* --- Comments Section --- */
.fdm-comments-header {
    font-size: 14px;
    font-weight: 600;
    color: #2E2E2E;
    margin-bottom: 14px;
}
.fdm-comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

/* Single Comment */
.fdm-comment {
    display: flex;
    gap: 10px;
}
.fdm-comment__avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    color: #999;
    flex-shrink: 0;
    margin-top: 2px;
}
.fdm-comment__body {
    flex: 1;
    min-width: 0;
}
.fdm-comment__top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 3px;
}
.fdm-comment__name {
    font-size: 13px;
    font-weight: 600;
    color: #2E2E2E;
}
.fdm-comment__time {
    font-size: 11px;
    color: #bbb;
}
.fdm-comment__text {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    word-break: break-word;
}
.fdm-comment__attached {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #4a7056;
    font-weight: 600;
    text-decoration: underline;
}
.fdm-comment__attached-preview {
    margin-top: 4px;
    font-size: 12px;
    color: #6d6d6d;
}

/* No comments */
.fdm-no-comments {
    text-align: center;
    padding: 24px 0;
    color: #ccc;
    font-size: 13px;
}

/* --- Comment Input (sticky bottom) --- */
.fdm-comment-input {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #f2f2f2;
    background: #fff;
    border-radius: 0 0 18px 18px;
    flex-shrink: 0;
}
.fdm-comment-input__anon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #777;
    user-select: none;
}
.fdm-comment-input__anon-toggle input {
    width: 14px;
    height: 14px;
}
.fdm-comment-input__attach-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5b8c6b;
    user-select: none;
}
.fdm-comment-input__attach-toggle input {
    width: 14px;
    height: 14px;
}
.fdm-comment-templates {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.fdm-comment-input__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fdm-comment-input__field {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #eee;
    border-radius: 24px;
    font-size: 14px;
    color: #333;
    background: #FAFBF9;
    outline: none;
    transition: border-color .2s;
}
.fdm-comment-input__field:focus {
    border-color: #5B8C6B;
}
.fdm-comment-input__field::placeholder {
    color: #bbb;
}
.fdm-comment-input__send {
    width: 36px; height: 36px;
    border: none;
    border-radius: 50%;
    background: #5B8C6B;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
    flex-shrink: 0;
}
.fdm-comment-input__send:hover {
    background: #4A7A5A;
}
.fdm-comment-input__send:disabled {
    background: #ddd;
    cursor: default;
}
.fdm-comment-input__send .material-icons { font-size: 18px; }

/* --- Mobile (bottom-sheet 스타일) --- */
@media (max-width: 600px) {
    .fdm-modal {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }
    .fdm-modal.is-open {
        transform: translateY(0);
    }
    .fdm-header {
        position: relative;
        padding-top: 18px;
    }
}
