/* ============================================
   기본 컨테이너 및 레이아웃
   ============================================ */
.read-container {
    margin: 0 auto;
    padding: 40px 24px;
    box-sizing: border-box;
    max-width: 1200px;
}

.read-container * {
    box-sizing: border-box;
}

/* ============================================
   뒤로가기 버튼
   ============================================ */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8b95a1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 32px;
    transition: color 0.2s ease;
}

.back-button:hover {
    color: #3182f6;
}

.back-icon {
    width: 16px;
    height: 16px;
}

/* ============================================
   게시글 헤더
   ============================================ */
.post-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f1f3f4;
}

.post-category {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    background-color: #e8f3ff;
    color: #3182f6;
}

.post-title {
    font-size: 32px;
    font-weight: 700;
    color: #191f28;
    line-height: 1.3;
    margin-bottom: 24px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    color: #8b95a1;
    font-size: 14px;
    flex-wrap: wrap;
    font-weight: 400;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    width: 16px;
    height: 16px;
}

/* ============================================
   게시글 내용
   ============================================ */
.post-content {
    font-size: 16px;
    line-height: 1.7;
    color: #191f28;
}

.content-section {
    margin-bottom: 32px;
}

.content-text {
    margin-bottom: 24px;
}

/* ============================================
   정보 박스
   ============================================ */
.info-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    border-left: 4px solid #3182f6;
}

.info-title {
    font-size: 18px;
    font-weight: 600;
    color: #191f28;
    margin-bottom: 16px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    font-size: 15px;
    color: #4e5968;
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.info-list li:before {
    content: "•";
    color: #3182f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ============================================
   하이라이트 박스
   ============================================ */
.highlight-box {
    background: #fff4e6;
    border: 1px solid #ffd700;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.highlight-title {
    font-size: 16px;
    font-weight: 600;
    color: #e67e00;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-icon {
    width: 20px;
    height: 20px;
    color: #e67e00;
}

/* ============================================
   액션 버튼
   ============================================ */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #f1f3f4;
}

.action-buttons > .btn, .comment-form-actions > .btn {
    padding: 12px 22px !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.action-buttons .btn-primary, .comment-form-actions .btn-primary {
    background: #3182f6;
    color: white;
}

.action-buttons .btn-primary:hover, .comment-form-actions .btn-primary:hover {
    background: #2563eb;
}

.action-buttons .btn-secondary, .comment-form-actions .btn-secondary {
    background: #f8f9fa;
    color: #4e5968;
    border: 1px solid #e5e8eb;
}

.action-buttons .btn-secondary:hover, .comment-form-actions .btn-secondary:hover {
    background: #e5e8eb;
}

.action-buttons .btn-danger, .comment-form-actions .btn-danger {
    background: #ffffff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.action-buttons .btn-danger:hover, .comment-form-actions .btn-danger:hover {
    background: #dc3545;
    color: white;
}

/* ============================================
   댓글 섹션
   ============================================ */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #f1f3f4;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 50px;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.comments-title {
    font-size: 20px;
    font-weight: 600;
    color: #191f28;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count {
    background: #3182f6;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   댓글 폼
   ============================================ */
.comment-form {
    margin-bottom: 32px;
}

.comment-form > .comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 16px;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
    background: #ffffff;
    font-weight: 400;
}

.comment-form > .comment-textarea:focus {
    outline: none;
    border-color: #3182f6;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.comment-form-actions > .btn-small {
    padding: 8px 18px !important;
    font-size: 13px;
}

/* ============================================
   댓글 목록
   ============================================ */
.comments-list {
    /* 댓글 간격은 각 댓글 아이템의 margin으로 처리 */
}

.comment-item {
    padding: 20px 0;
    border-bottom: 1px solid #f1f3f4;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    background: #e5e8eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #4e5968;
}

.comment-avatar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #191f28;
}

.comment-date {
    font-size: 12px;
    color: #8b95a1;
}

.comment-actions {
    display: flex;
    gap: 8px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #8b95a1;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-action-btn:hover {
    background: #f8f9fa;
    color: #4e5968;
}

.comment-content > .rhymix_content, .comment-content > .xe_content {
    font-size: 14px;
    line-height: 1.6;
    color: #191f28;
    margin-bottom: 12px;
}

/* ============================================
   댓글 답글
   ============================================ */
.comment-reply {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.reply-btn {
    background: none;
    border: none;
    color: #8b95a1;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.reply-btn:hover {
    color: #3182f6;
}

.reply-icon {
    width: 14px;
    height: 14px;
}

.comment-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #8b95a1;
    font-size: 13px;
}

.like-btn {
    background: none;
    border: none;
    color: #8b95a1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.like-btn:hover {
    color: #3182f6;
}

.like-btn.liked {
    color: #3182f6;
}

.like-icon {
    width: 14px;
    height: 14px;
}

/* ============================================
   답글 아이템
   ============================================ */
.reply-item {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.reply-item.indent1 {
    margin-left: 48px;
}

.reply-item.indent2 {
    margin-left: 68px;
}

.reply-item.indent3 {
    margin-left: 88px;
}

.reply-item.indent4 {
    margin-left: 108px;
}

.reply-item.indent5 {
    margin-left: 128px;
}

.reply-item.indent6 {
    margin-left: 148px;
}

.reply-item.indent7 {
    margin-left: 168px;
}

.reply-item .reply-item {
    margin-left: 32px;
    background: #f1f3f4;
}

/* ============================================
   답글 폼
   ============================================ */
#reply_form_base {
    display: none;
}

.reply-form {
    margin-top: 16px;
}

.reply-form-content {
    margin-left: 32px;
}

.reply-form-content > .reply-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
    background: #ffffff;
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.reply-form-cancel {
    padding: 8px 16px;
    font-size: 13px;
    background: #f8f9fa;
    color: #4e5968;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    cursor: pointer;
}

.reply-form-submit {
    padding: 8px 16px;
    font-size: 13px;
    background: #3182f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* ============================================
   댓글 삭제 폼
   ============================================ */
.delete_comment_form {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.delete_comment_form.show {
    display: flex;
}

.delete_comment_form .delete_comment_modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.delete_comment_message_text_content, .delete_comment_nickname {
    font-size: 16px;
    font-weight: 600;
    color: #191f28;
    margin: 0 0 5px 0;
    text-align: center;
}

.delete_comment_instant_delete {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e8eb;
    display: flex;
    gap: 5px;
    align-items: center;
}

.delete_comment_bt_area {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.delete_comment_bt_cancel,
.delete_comment_bt_submit {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.delete_comment_bt_cancel {
    background: #f8f9fa;
    color: #4e5968;
    border: 1px solid #e5e8eb;
}

.delete_comment_bt_cancel:hover {
    background: #e5e8eb;
}

.delete_comment_bt_submit {
    background: #dc3545;
    color: white;
}

.delete_comment_bt_submit:hover {
    background: #c82333;
}

/* ============================================
   댓글 페이지네이션
   ============================================ */
.comments-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f1f3f4;
}

.cpage-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e8eb;
    background: white;
    color: #4e5968;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
}

.cpage-button:hover {
    background: #f8f9fa;
    border-color: #d1d6db;
}

.cpage-button.active {
    background: #3182f6;
    color: white;
    border-color: #3182f6;
    font-weight: 500;
}

.cpage-button.disabled {
    color: #d1d6db;
    cursor: not-allowed;
}

.cpage-button.disabled:hover {
    background: white;
    border-color: #e5e8eb;
}

/* ============================================
   기타 스타일
   ============================================ */
a.nick_name {
    color: #8b95a1;
}

/* ============================================
   반응형 디자인
   ============================================ */
/* 작은 모바일 화면 (480px 이하) */
@media (max-width: 480px) {
    .read-container {
        padding: 12px 8px;
    }
    
    .reply-item.indent1 {
        margin-left: 16px;
    }
    .reply-item.indent2 {
        margin-left: 24px;
    }
    .reply-item.indent3 {
        margin-left: 32px;
    }
    .reply-item.indent4 {
        margin-left: 40px;
    }
    .reply-item.indent5 {
        margin-left: 48px;
    }
    .reply-item.indent6 {
        margin-left: 56px;
    }
    .reply-item.indent7 {
        margin-left: 64px;
    }
}

/* 중간 모바일 화면 (481px ~ 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .read-container {
        padding: 20px 16px;
    }

    .post-title {
        font-size: 24px;
    }

    .post-meta {
        gap: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .comment-form-actions {
        flex-direction: column;
    }

    .reply-item .reply-item {
        margin-left: 16px;
    }

    .reply-item.indent1 {
        margin-left: 24px;
    }
    .reply-item.indent2 {
        margin-left: 32px;
    }
    .reply-item.indent3 {
        margin-left: 40px;
    }
    .reply-item.indent4 {
        margin-left: 48px;
    }
    .reply-item.indent5 {
        margin-left: 56px;
    }
    .reply-item.indent6 {
        margin-left: 64px;
    }
    .reply-item.indent7 {
        margin-left: 72px;
    }

    /* 댓글 삭제 폼 모바일 스타일 */
    .delete_comment_form .delete_comment_modal {
        margin: 20px;
        padding: 20px;
        max-width: none;
        width: calc(100% - 40px);
    }

    .delete_comment_bt_area {
        flex-direction: column;
    }

    .delete_comment_bt_cancel,
    .delete_comment_bt_submit {
        width: 100%;
        padding: 12px 20px;
    }
}

/* 태블릿 및 데스크톱 (768px 이하) */
@media (max-width: 768px) {
    .comments-pagination {
        gap: 4px;
        margin-top: 24px;
        padding-top: 20px;
    }
    
    .cpage-button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .post-title {
        font-size: 24px;
    }

    .post-meta {
        gap: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .comment-form-actions {
        flex-direction: column;
    }

    .reply-item {
        margin-left: 20px;
    }

    .reply-item .reply-item {
        margin-left: 16px;
    }
}