/* 댓글 섹션 */
.comment-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 1rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
}
.comment-section-title {
    color: #f5f5f5;
    font-size: 1.3rem;
    margin-bottom: 20px;
}
.comment-form {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}
.comment-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.comment-input {
    flex: 1;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #f5f5f5;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.comment-input:focus {
    border-color: #dc2626;
}
/* ===== 닉네임 입력 래퍼 (주사위 아이콘 포함) ===== */
.nickname-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.nickname-input-wrapper .comment-input {
    width: 100%;
    padding-right: 36px;
}
.refresh-nickname-btn {
    position: absolute;
    right: 10px;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s;
}
.refresh-nickname-btn:hover {
    color: #f3f4f6;
}
.comment-textarea {
    width: 100%;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #f5f5f5;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.comment-textarea:focus {
    border-color: #dc2626;
}
.comment-submit-btn {
    display: block;
    margin-top: 10px;
    margin-left: auto;
    padding: 8px 24px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-submit-btn:hover {
    background: #b91c1c;
}
.comment-submit-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}
/* 댓글 리스트 헤더 (정렬 드롭다운 + 총 댓글 수) */
.comment-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.comment-total-count {
    color: #d1d5db;
    font-size: 0.9rem;
}
.comment-sort-select {
    background-color: transparent;
    color: #d1d5db;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}
.comment-sort-select option {
    background-color: #1f2937;
    color: #d1d5db;
}

/* 댓글 목록 */
.comment-item {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.comment-nickname {
    color: #f5f5f5;
    font-weight: 600;
    font-size: 0.9rem;
}
.comment-date {
    color: #888;
    font-size: 0.8rem;
}
.comment-actions {
    display: flex;
    gap: 6px;
}
.comment-action-btn {
    background: none;
    border: 1px solid #444;
    color: #888;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.comment-action-btn:hover {
    color: #dc2626;
    border-color: #dc2626;
}
.comment-body {
    color: #ddd;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}
.comment-empty {
    text-align: center;
    color: #888;
    padding: 30px 0;
    font-size: 0.9rem;
}
/* 반응형 */
@media (max-width: 768px) {
    .comment-form-row {
        flex-direction: column;
    }
    .comment-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .comment-sort-select {
        align-self: flex-end;
    }
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .comment-actions {
        align-self: flex-end;
    }
    .comment-like-btn,
    .comment-dislike-btn {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    .comment-reply {
        margin-left: 1.5rem;
        padding-left: 0.75rem;
    }
    .comment-reply-btn {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
}


/* ===== 공감 버튼 (그린 플래그 🟢) ===== */
.comment-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: transparent;
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #9ca3af;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.comment-like-btn:hover {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.5);
}
.comment-like-btn.liked {
    color: #22c55e;
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.1);
}
.comment-like-btn:active {
    transform: scale(1.08);
}
.comment-like-count {
    font-size: 0.8rem;
}
/* ===== 싫어요 버튼 (레드 플래그 🔴) ===== */
.comment-dislike-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #9ca3af;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.comment-dislike-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
}
.comment-dislike-btn.disliked {
    color: #ef4444;
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}
.comment-dislike-btn:active {
    transform: scale(1.08);
}
.comment-dislike-count {
    font-size: 0.8rem;
}

/* ===== 삭제 확인 모달 ===== */
.delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.delete-modal-content {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 28px 24px;
    width: 90%;
    max-width: 380px;
    text-align: center;
}
.delete-modal-content h3 {
    color: #f5f5f5;
    font-size: 1.1rem;
    margin: 0 0 8px;
}
.delete-modal-content p {
    color: #aaa;
    font-size: 0.9rem;
    margin: 0 0 16px;
}
.delete-modal-content input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #f5f5f5;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.delete-modal-content input[type="password"]:focus {
    border-color: #dc2626;
}
.delete-modal-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 8px;
    display: none;
}
.delete-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: center;
}
.delete-modal-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.delete-modal-btn.cancel {
    background: #444;
    color: #ccc;
}
.delete-modal-btn.cancel:hover {
    background: #555;
}
.delete-modal-btn.confirm {
    background: #dc2626;
    color: #fff;
}
.delete-modal-btn.confirm:hover {
    background: #b91c1c;
}

@media (max-width: 768px) {
    .delete-modal-content {
        padding: 20px 16px;
        width: 95%;
    }
    .delete-modal-actions {
        flex-direction: column;
    }
    .delete-modal-btn {
        width: 100%;
    }
}

/* ===== 대댓글(답글) 스타일 ===== */
.comment-reply {
    margin-left: 3rem;
    border-left: 2px solid #4b5563;
    padding-left: 1rem;
}

/* ===== 내가 쓴 글 배지 ===== */
.my-comment-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.2);
    padding: 1px 8px;
    border-radius: 9999px;
    margin-left: 0.5rem;
    font-weight: 500;
    line-height: 1.4;
    vertical-align: middle;
}

/* ===== 커스텀 에러 메시지 ===== */
.custom-error-msg {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ===== 삭제된 댓글 스타일 ===== */
.comment-deleted .comment-body,
.comment-deleted .comment-nickname {
    color: #6b7280;
}

/* ===== 답글 달기 버튼 ===== */
.comment-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #4b5563;
    color: #9ca3af;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.comment-reply-btn:hover {
    color: #d1d5db;
    border-color: #666;
}

/* ===== 인라인 답글 폼 (Reply_Form) ===== */
.reply-form {
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 10px;
}
.reply-form .comment-form-row {
    margin-bottom: 8px;
}
.reply-form .comment-input {
    font-size: 0.85rem;
    padding: 8px 10px;
}
.reply-form .comment-textarea {
    min-height: 60px;
    font-size: 0.85rem;
    padding: 8px 10px;
}
.reply-form .comment-submit-btn {
    padding: 6px 18px;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ===== 좋아요 전환 효과 (Phase 2) ===== */
/* 과도한 스케일 애니메이션 제거 — :active pseudo-class로 대체 */

/* ===== 빈 상태 안내 (Phase 2) ===== */
.comment-empty-state {
    text-align: center;
    color: #888;
    padding: 40px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== 더보기 버튼 (Phase 2) ===== */
.load-more-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    margin-top: 12px;
    background: none;
    border: 1px solid #444;
    border-radius: 6px;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.load-more-btn:hover {
    color: #f5f5f5;
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

/* ===== 댓글 바로가기 플로팅 버튼 ===== */
.comment-float-btn {
    position: fixed;
    bottom: 32px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.45);
    z-index: 1000;
    transition: background 0.2s, transform 0.15s;
}
.comment-float-btn:hover {
    background: #b91c1c;
    transform: scale(1.08);
}
