/* =====================================================
   VIEW CHI TIẾT THÔNG BÁO (PHONG CÁCH MẠNG XÃ HỘI)
===================================================== */
.tb-detail-container {
    max-width: 800px;
    margin: 24px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* HEADER BÀI VIẾT */
.tb-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.tb-avatar-placeholder {
    width: 44px;
    height: 44px;
    background-color: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.tb-avatar-placeholder.sm {
    width: 20px;
    height: 20px;
    font-size: 10px;
}
.tb-post-meta-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tb-author {
    font-weight: 600;
    color: #050505;
    font-size: 15px;
}
.tb-date {
    font-size: 13px;
    color: #65676b;
}

/* KHỐI TIÊU ĐỀ - ĐÃ TINH CHỈNH ĐƠN GIẢN, CANH GIỮA */
.tb-title-block {
    margin-bottom: 24px;
    padding: 10px 0;
    text-align: center; /* Đưa tất cả ra giữa */
}
.tb-type {
    font-size: 18px;      /* To hơn phần nội dung một chút */
    font-weight: 700;
    color: #050505;       /* Chuyển thành chữ đen */
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.tb-title {
    font-size: 18px;      /* Bằng kích thước tên văn bản hoặc to hơn một chút */
    font-weight: 600;
    color: #050505;       /* Chữ đen */
    line-height: 1.4;
    font-style: italic;   /* Thêm chút nghiêng cho phần trích yếu để dễ phân biệt */
}

/* NỘI DUNG */
.tb-content {
    font-size: 16px;
    line-height: 1.6;
    color: #050505;
    white-space: pre-wrap;
    text-align: justify;
    margin-bottom: 24px;
}

/* FILE ĐÍNH KÈM */
.tb-attachments {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.tb-attachment-link {
    color: #1877f2;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: underline 0.2s;
}
.tb-attachment-link:hover {
    text-decoration: underline;
}

.tb-divider {
    border: 0;
    border-top: 1px solid #e4e6eb;
    margin: 16px 0;
}

/* SỐ LƯỢNG BÌNH LUẬN */
.tb-comment-header {
    font-size: 14px;
    font-weight: 600;
    color: #65676b;
    margin-bottom: 16px;
}

/* Ô INPUT GIẢ LẬP (FAKE INPUT) */
.tb-fake-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0f2f5;
    padding: 10px 14px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 28px;
    transition: background 0.2s;
}
.tb-fake-input-container:hover {
    background: #e4e6eb;
}
.tb-fake-input-placeholder {
    color: #65676b;
    font-size: 14px;
    user-select: none;
}



/* CONTAINER CỦA KHỐI TRÍCH DẪN CON */
.comment-reply-quote-box {
    background-color: #f0f2f5; 
    border-left: 2px solid #1877f2; 
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 6px; 
    width: 100%;              /* Chiếm tối đa không gian được cấp */
    max-width: 100%;          /* Khống chế tuyệt đối */
    box-sizing: border-box;
    overflow: hidden;         /* Chống tràn */
    display: block;
}

/* 3. NỘI DUNG TRÍCH DẪN: IN NGHIÊNG + ÉP 1 DÒNG BA CHẤM */
.comment-reply-quote-content {
    font-size: 9px;           /* Giữ nguyên kích thước bạn thích */
    color: #65676b;
    line-height: 1.3;
    font-style: italic;       
    white-space: nowrap;      
    overflow: hidden;         
    text-overflow: ellipsis;  /* Tự động tính toán sinh ra dấu ... khi view co lại */
    display: block;           /* Bắt buộc phải là block/inline-block mới ăn text-overflow */
    width: 100%;
}

/* TÊN NGƯỜI ĐƯỢC TRẢ LỜI TRONG BOX TRÍCH DẪN */
.comment-reply-quote-user {
    font-weight: 700;
    color: #4b5563; /* Màu tối hơn chữ nội dung một chút để tạo điểm nhấn */
}

/* ĐÁP ỨNG DI ĐỘNG SIÊU GỌN */
@media (max-width: 768px) {
    /* Ép tất cả các khối bao ngoài không được phá vỡ layout */
    .comment-wrapper, 
    .comment-main-block, 
    .flat-comment-item {
        max-width: 100%;
        overflow: hidden;
    }

    /* Thu nhỏ bớt padding của bong bóng chứa trích dẫn trên mobile để tăng không gian hiển thị chữ */
    .comment-bubble {
        padding: 6px 10px;
    }

    /* Giữ nguyên size chữ bạn cấu hình cho mobile */
    .comment-reply-quote-content {
        font-size: 8px; 
    }
}
/* =====================================================
   CÂY BÌNH LUẬN BONG BÓNG PHẲNG TỐI ƯU KHÔNG GIAN
===================================================== */
.comment-tree {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Thu hẹp khoảng cách giữa các khối lớn */
}
.comment-wrapper {
    display: flex;
    position: relative;
    gap: 2px;
    margin-bottom: 2px;
}
.comment-main-block {
    flex: 1;
    position: relative;
    max-width: 100%;
}

/* Đồ họa đường chỉ kết nối tinh chỉnh theo khoảng cách thụt lề mới */
.comment-thread-line {
    position: absolute;
    left: -14px;
    top: -10px;
    width: 10px;
    height: 24px;
    border-left: 2px solid #e4e6eb;
    border-bottom: 2px solid #e4e6eb;
    border-bottom-left-radius: 6px;
}

/* Toàn khối bình luận hỗ trợ hover báo hiệu click */
.clickable-bubble {
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.1s ease;
}
.clickable-bubble:hover {
    background-color: #e4e6eb !important; /* Tối hơn 1 chút khi di chuột vào */
}
.clickable-bubble:active {
    transform: scale(0.99);
}

/* =====================================================
   HỆ THỐNG CÂY BÌNH LUẬN TỰ ĐỘNG PHẲNG (UI REFACTOR)
===================================================== */
.comment-tree {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* Khung bao bọc mỗi node bình luận */
.comment-wrapper {
    display: flex;
    gap: 10px;
    position: relative;
    width: 100%;
}

/* Khối nội dung chính bên phải Avatar */
.comment-main-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 100%;
}

/* CONTAINER CHỨA CÁC BÌNH LUẬN CON - ĐÂY LÀ CHÌA KHÓA TỰ ĐỘNG THỤT LỀ */
.comment-children-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    padding-left: 2px; /* Tạo độ thụt lề tự nhiên, an toàn cho Mobile */
    border-left: 1px dashed #e4e6eb; /* Đường chỉ phụ mờ kết nối các tầng */
}

/* BONG BÓNG BÌNH LUẬN - THẨM MỸ CAO CẤP */
.comment-bubble {
    background-color: #f0f2f5;
    border-radius: 16px;
    padding: 10px 14px;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}

/* Hiệu ứng tương tác khi di chuột và click vào bong bóng */
.clickable-bubble {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.clickable-bubble:hover {
    background-color: #e4e6eb !important;
}
.clickable-bubble:active {
    transform: scale(0.995);
}

/* Header bên trong bong bóng bình luận */
.comment-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-author-name {
    font-weight: 600;
    font-size: 10px;
    color: #1877f2; /* Đổi từ màu đen sang xanh dương mạng xã hội */
    word-break: break-word;
    cursor: pointer
}
.comment-author-name:hover {
    text-decoration: underline; /* Tạo hiệu ứng hover nhẹ khi rê chuột vào tên */
}
.comment-meta-time {
    font-size: 8px;
    color: #65676b;
    white-space: normal !important;;
}

/* Văn bản nội dung bình luận */
.comment-text-content {
    font-size: 14px;
    line-height: 1.5;
    color: #050505;
    white-space: pre-wrap;
    word-break: break-word;
}

/* THẺ NHẮC TÊN NỘI TUYẾN (@MENTION) VÀNG/XANH NỔI BẬT */
.comment-mention-inline {
    display: inline;
    font-size: 14px;
    font-weight: 700;
    color: #1877f2;
    margin-right: 4px;
}

/* =====================================================
   LUỒNG PHẲNG ĐỘC LẬP CHO CÁC BÌNH LUẬN CẤP SÂU (LEVEL 4+)
===================================================== */
.flat-replies-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 2px;
    border-left: 2px solid #1877f2; /* Đường line xanh đậm chất mạng xã hội báo hiệu luồng phẳng */
}

/* Giữ nguyên cấu trúc bong bóng cho tầng phẳng giúp giao diện đồng nhất tuyệt đối */
.flat-comment-item {
    display: flex;
    gap: 2px;
    width: 100%;
}

/* ĐÁP ỨNG DI ĐỘNG */
@media (max-width: 768px) {
    .comment-children-container {
        padding-left: 2px; /* Giảm thụt lề trên mobile để tăng khoảng trống hiển thị chữ */
    }
    .comment-bubble {
        padding: 8px 12px;
    }
}

/* DROPDOWN CONTEXT MENU THEO ĐIỂM CLICK */
.comment-context-dropdown {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 160px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.comment-context-dropdown button {
    width: 100%;
    border: none;
    background: none;
    padding: 11px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #050505;
    transition: background 0.1s;
}
.comment-context-dropdown button:hover {
    background-color: #f2f3f5;
}

/* ĐÁP ỨNG DI ĐỘNG SIÊU GỌN */
@media (max-width: 768px) {
    .comment-wrapper.level-1 { margin-left: 14px; }
    .comment-wrapper.level-2 { margin-left: 14px; }
    .comment-wrapper.level-3 { margin-left: 14px; }
    .comment-thread-line { left: -11px; width: 8px; }
    .comment-bubble { padding: 6px 10px; }
}
/* =====================================================
   MỞ RỘNG VÀ ĐỒNG BỘ VIEW LIST THEO KHUNG DETAIL
===================================================== */

/* Đảm bảo danh sách các card giãn cách nhau hợp lý trong khung mới */
.tb-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Tăng khoảng cách giữa các card cho thoáng */
    margin-top: 12px;
}

/* ĐÓNG KHUNG CARD: Giảm bớt padding nhẹ để hợp với khung bao ngoài 800px */
.tb-card {
    background: #ffffff;
    border: 1px solid #e4e6eb; /* Đồng bộ màu border với hệ thống comment */
    border-radius: 12px;       /* Bo góc mềm mại hơn */
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.tb-card:hover {
    transform: translateY(-1px); /* Chỉ nhấc nhẹ lên để tránh cảm giác bị giật khung */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #ccd0d5;
}

/* Format lại Header của từng thông báo trong danh sách */
.tb-card-meta {
    display: flex;
    justify-content: space-between;
    color: #65676b; /* Sử dụng màu xám chuẩn mạng xã hội giống view detail */
    font-size: 12.5px;
    margin-bottom: 10px;
}

.tb-card-type {
    text-align: center;      /* Đưa ra giữa */
    font-size: 14px;
    font-weight: 700;
    color: #050505;          /* Chuyển thành chữ đen giống detail */
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.tb-card-title {
    text-align: center; /* Chuyển sang căn trái */
    font-size: 16px;
    font-weight: 600;
    color: #050505;
    line-height: 1.4;
    margin-bottom: 10px;
}

.tb-card-content {
    font-size: 14px;
    line-height: 1.5;
    text-align: justify;
    color: #4b5563;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Giới hạn tối đa hiển thị 3 dòng tránh card quá dài */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tb-card-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    color: #65676b;
    font-size: 13px;
}



/* =====================================================
   PHẪU THUẬT THẨM MỸ FORM BÌNH LUẬN (MODAL OVERLAY)
===================================================== */

/* Khung bọc ngoài cùng của Form nhập */
.reply-form-container {
    background: #ffffff;
    border-radius: 16px;       /* Bo góc rộng đồng bộ với detail box */
    padding: 20px;
    max-width: 500px;         /* Giới hạn độ rộng vừa vặn, không bị bè ngang */
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15); /* Đổ bóng sâu tạo độ nổi */
}

/* Tiêu đề Form */
.reply-form-title {
    font-size: 15px;
    font-weight: 600;
    color: #050505;
    margin-top: 0;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f2f5; /* Đường gạch nhẹ phân cách */
    text-align: left;
}

/* Ô nhập liệu Textarea */
.form-textarea {
    width: 100%;
    border: 1px solid #e4e6eb;
    border-radius: 12px;       /* Bo góc mềm mại */
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #050505;
    background-color: #f8f9fa; /* Nền xám nhẹ tạo chiều sâu */
    resize: none;             /* Khóa không cho kéo giãn vỡ khung */
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-bottom: 12px;
}

/* Hiệu ứng khi focus vào ô nhập liệu */
.form-textarea:focus {
    outline: none;
    background-color: #ffffff; /* Đổi sang nền trắng */
    border-color: #1877f2;     /* Viền xanh thương hiệu sáng lên */
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.1);
}

/* Khối chứa nút bấm hành động */
.form-actions {
    display: flex;
    justify-content: flex-end; /* Đẩy nút bấm hẳn về góc phải */
    gap: 8px;
}

/* Nút Gửi chuẩn mạng xã hội */
#btnSubmitReply.btn-primary {
    background-color: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 8px;       /* Bo góc nút gọn gàng */
    padding: 8px 24px;         /* Tăng chiều ngang cho nút nhìn cân đối */
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#btnSubmitReply.btn-primary:hover {
    background-color: #166fe5; /* Tối hơn 1 chút khi di chuột */
}

#btnSubmitReply.btn-primary:active {
    transform: scale(0.98);    /* Hiệu ứng lún nút khi nhấn */
}


.tb-post-actions{
    margin-left:auto;
    display:flex;
    gap:8px;
}

.tb-action-btn{
    border:none;
    border-radius:8px;
    padding:6px 12px;
    cursor:pointer;
}

.tb-action-btn.danger{
    color:#dc2626;
}