/* Custom Comments Styles */
.comments-area {
    max-width: 100%;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.comments-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Comment Share Buttons */
.comment-share-section {
    margin-bottom: 20px;
}

.comment-share-buttons {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
}

.share-label {
    margin-right: 15px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.facebook-share {
    background-color: #1877f2;
    color: white;
}

.facebook-share:hover {
    background-color: #166fe5;
    transform: translateY(-1px);
}

.zalo-share {
    background-color: #0068ff;
    color: white;
}

.zalo-share:hover {
    background-color: #0052cc;
    transform: translateY(-1px);
}

.copy-link {
    background-color: #6c757d;
    color: white;
}

.copy-link:hover {
    background-color: #545b62;
    transform: translateY(-1px);
}

.social-share-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Comment Form Container */
.comment-form-container {
    margin-bottom: 30px;
    background-color: #fff;
}

.comment-form {
    margin: 0;
}

.comment-form-comment {
    margin-bottom: 0px;
}

.comment-form-comment textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    background-color: #fff;
    transition: border-color 0.2s ease;
    margin-bottom: 15px;
    box-shadow: none;
}

/* Form Input & Button Styles - Bố cục mới */
.comment-input-row {
    display: flex;
    align-items: stretch; /* Đảm bảo các phần tử có chiều cao bằng nhau */
    gap: 15px;
    flex-wrap: nowrap;
    margin-top: 0;
}

/* Phần bên trái: họ tên, email và nút thêm hình ảnh */
.left-inputs {
     /* Chiếm nhiều không gian hơn */
    display: flex;
}

.comment-input-fields {
    display: flex;
    gap: 10px;
    align-items: stretch; /* Căn chỉnh chiều cao */
    width: 100%;
}

.comment-form-author,
.comment-form-email {
    flex: 4; /* Tăng tỉ lệ để kéo dài hơn so với trước đây */
}

.upload-image-section {
    flex: 1; /* Thu nhỏ lại so với trước đây */
}

.comment-form-author input,
.comment-form-email input {
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    background-color: #fff;
    height: 45px;
    margin: 0;
    line-height: 45px; /* Đảm bảo văn bản được căn giữa theo chiều dọc */
}

/* Nút thêm hình ảnh */
.upload-image-button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 15px;
    height: 45px;
    width: 100%;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    margin: 0;
}

/* Phần bên phải: nút gửi bình luận */
.right-submit {
    flex: 0; /* Chiếm ít không gian hơn */
    display: flex;
    align-items: stretch;
}

.submit-button-section {
    width: 100%;
    display: flex;
}

.submit-comment-button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 45px;
    padding: 0 20px;
    background-color: #004225;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin: 0;
}

/* Thêm style cụ thể cho shortcode comments theo hình mẫu */
.shortcode-comments textarea,
.shortcode-comments input[type="text"],
.shortcode-comments input[type="email"] {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    font-size: 15px;
    background: #fff;
    box-shadow: none;
}

.shortcode-comments .comment-form-fields {
    margin-bottom: 12px;
}

.shortcode-comments .comment-form-author input,
.shortcode-comments .comment-form-email input {
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 15px;
}

.shortcode-comments .submit-comment-button {
    box-sizing: border-box;
    background-color: #004225;
    color: white;
    border-radius: 4px;
    padding: 0 20px;
    height: 45px;
    margin: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcode-comments .upload-image-button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    margin: 0;
    padding: 0 15px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #333;
    width: 100%;
}

/* Special style for checkbox in shortcode */
.shortcode-comments .comment-form-cookies-consent {
    margin: 10px 0 20px;
}

.shortcode-comments .comment-form-cookies-consent input[type="checkbox"] {
    margin-right: 8px;
}

.shortcode-comments .comment-form-cookies-consent label {
    font-size: 14px;
    color: #666;
}

/* Image Preview */
.image-preview-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
}

/* Comment List */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.comment-body {
    display: flex;
    gap: 15px;
}

.comment-author-avatar {
    flex: 0 0 50px;
}

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

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
}

.comment-text {
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #888;
}

.comment-likes {
    display: flex;
    align-items: center;
    gap: 6px;
}

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #d90d2d;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.like-button:hover {
    background-color: #f0f0f0;
    color: #004225;
}

.like-button.liked {
    color: #004225;
    background-color: #f0f8f5;
}

.like-button svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.comment-reply-link {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-reply-link:hover {
    background-color: #f0f0f0;
    color: #004225;
}

.comment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.comment-image {
    width: 400px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s ease;
    max-width: 100%;
}

.comment-image:hover {
    transform: scale(1.02);
}

/* Children Comments */
.children {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 65px;
}

.children .comment {
    border-left: 2px solid #f0f0f0;
    padding-left: 20px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #004225;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
}

/* Form trả lời inline */
.inline-respond {
    margin: 15px 0 15px 0 !important;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 3px solid #004225;
    border-radius: 4px;
    max-width: 100% !important;
    width: 100% !important;
}

.inline-respond .comment-form-comment textarea {
    min-height: 120px;
    background-color: #fff;
}

.inline-respond .comment-reply-title {
    font-size: 16px;
    color: #004225;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inline-respond .comment-reply-title small {
    font-size: 13px;
}

.inline-respond .comment-reply-title small a {
    color: #666;
    text-decoration: none;
    padding: 4px 8px;
    background: #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.inline-respond .comment-reply-title small a:hover {
    background: #e0e0e0;
    color: #333;
}

.inline-respond .comment-input-row {
    margin-top: 10px;
}

/* Thêm padding trước form trả lời ở màn hình mobile */
@media (max-width: 768px) {
    .inline-respond {
        padding: 12px;
        margin: 12px 0 12px 0 !important;
    }
    
    .inline-respond .comment-form-comment textarea {
        min-height: 100px;
    }
    
    /* Cấu hình mới cho mobile */
    .comment-input-row {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    /* Họ tên và email cùng hàng */
    .comment-form-author,
    .comment-form-email {
        flex: 1;
        width: 50%;
    }
    
    .comment-input-fields {
        display: flex;
        width: 100%;
        gap: 10px;
    }
    
    /* Tạo container riêng cho nút thêm hình ảnh và nút gửi */
    .upload-image-submit-row {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    
    .upload-image-section {
        flex: 1;
    }
    
    .right-submit {
        flex: 1;
    }
    
    /* Đảm bảo các nút có chiều rộng đồng đều */
    .upload-image-button,
    .submit-comment-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .comment-body {
        gap: 10px;
    }
    
    .comment-author-avatar {
        flex: 0 0 40px;
    }
    
    .comment-author-avatar img {
        width: 40px;
        height: 40px;
    }
    
    .comment-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .comment-images {
        gap: 10px;
    }
    
    .comment-image {
        width: 100%;
        height: auto;
    }
}