/**
 * Thin Tùy Biến Plugin - CSS Stylesheet
 * File: assets/css/thin-tuy-bien.css
 * Description: Định dạng giao diện Khung Chân Bài Viết (Hình 1) & Banner Cảnh Báo Bình Luận (Hình 2)
 */

/* ==========================================
   1. GIAO DIỆN KHUNG CHÂN BÀI VIẾT (Hình 1)
   ========================================== */

.thin-post-footer-box {
    margin-top: 30px;
    margin-bottom: 25px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 1.1 Hàng Thẻ Tags */
.thin-tags-wrapper {
    margin-bottom: 15px;
}

.thin-post-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
}

.thin-tag-badge {
    display: inline-flex !important;
    align-items: center !important;
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.2s ease-in-out !important;
}

.thin-tag-badge:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    transform: translateY(-1px);
}

/* Ẩn hoàn toàn thẻ tag cũ, nút sửa và thanh chia sẻ trùng lặp của Theme ở bên dưới (Hình 2, 3) */
[data-type="single"] .entry-tags,
[data-type="single"] .entry-share,
[data-type="single"] .post-tags,
.single-post .post-tags,
.single-post .entry-tags,
.single-post .entry-share,
.single-post .ct-share-box,
.single-post .post-edit-link,
.single-post .entry-meta-tags,
.single-post div[class*="single-tags"],
.single-post div[class*="single-share"],
.single-post .ct-share-container,
.single-post .post-navigation,
.single-post footer.entry-footer {
    display: none !important;
}

/* 1.2 Hàng Thống Kê (Lượt xem | Bình luận) */
.thin-stats-bar {
    text-align: right;
    font-size: 13.5px;
    color: #6b7280;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

/* 1.3 Thanh Tương Tác (Thích | Bình luận | Chia sẻ) */
.thin-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-top: 12px;
}

.thin-action-item {
    position: relative;
    flex: 1;
    text-align: center;
}

.thin-action-item button {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: auto;
}

.thin-action-item button:hover {
    background-color: #f9fafb;
    color: #1d4ed8;
}

/* Nút Thích (Like) */
.thin-btn-like .text-danger {
    color: #ef4444;
}

.thin-btn-like.liked {
    color: #ef4444;
}

.thin-btn-like.liked i {
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Popup Chia Sẻ */
.thin-share-popup {
    position: absolute;
    bottom: 110%;
    right: 50%;
    transform: translateX(50%);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 99;
    min-width: 170px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.thin-share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: #374151 !important;
    text-decoration: none !important;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.thin-share-link:hover {
    background-color: #f3f4f6;
}

.thin-share-link.fb i { color: #1877f2; }
.thin-share-link.zalo i { color: #0068ff; }
.thin-share-link.twitter i { color: #000000; }
.thin-share-link.telegram i { color: #229ed9; }
.thin-share-link.pinterest i { color: #e60023; }
.thin-share-link.copy-link i { color: #6b7280; }


/* ==========================================
   2. GIAO DIỆN CẢNH BÁO BÌNH LUẬN (Hình 2)
   ========================================== */

.thin-comment-warning-banner {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    border: 1.5px solid #ff4d4f;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 25px;
    margin-bottom: 25px;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 77, 79, 0.25);
    text-align: center;
}

.thin-warning-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
}

.thin-warning-icon {
    font-size: 18px;
    color: #ffffff;
    flex-shrink: 0;
}

.thin-auth-link {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.thin-auth-link:hover {
    opacity: 0.85;
}

.thin-auth-link strong {
    font-weight: 800;
}


/* ==========================================
   2.5 GIAO DIỆN FORM BÌNH LUẬN FOX THEME (Hình 3)
   ========================================== */

.thin-custom-comment-box-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-top: 20px;
    margin-bottom: 12px;
}

.thin-comment-avatar img,
.hinh-comen img,
.comment-list .avatar,
.comment-body .avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 1px solid #e5e7eb !important;
}

/* Định dạng ô nhập nội dung bình luận */
.thin-comment-textarea,
#comment,
.comment-form textarea {
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 14.5px !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.thin-comment-textarea:focus,
#comment:focus,
.comment-form textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

/* Ẩn nút submit mặc định của WordPress để dùng nút Đăng icon máy bay Fox Theme */
p.form-submit,
.form-submit {
    display: none !important;
}

/* ==========================================
   2.6 STYLING BÌNH LUẬN NHIỀU CẤP CHUẨN 100% FOX THEME
   ========================================== */

/* Bố cục thò thụt cho các bình luận con (Nested tree indentation) */
.comment-list,
.commentlist,
ul.children,
ol.children {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.comment-list ul.children,
.comment-list ol.children,
.commentlist ul.children,
.commentlist ol.children,
li.comment ul.children,
li.comment ol.children {
    margin-left: 32px !important;
    padding-left: 12px !important;
    border-left: 2px dashed #cbd5e1 !important;
    margin-top: 10px !important;
}

/* Nút X Hủy trả lời bình luận màu xanh chuẩn hình */
#cancel-comment-reply-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 4px 12px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    margin-bottom: 8px !important;
    margin-left: 48px !important;
    transition: background-color 0.2s ease !important;
}

#cancel-comment-reply-link:hover {
    background-color: #1d4ed8 !important;
}

.box-comen {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hinh-comen {
    width: 36px;
    flex-shrink: 0;
}

.hinh-comen img {
    border-radius: 100% !important;
    width: 36px !important;
    height: 36px !important;
    object-fit: cover !important;
}

.comen {
    flex-grow: 1;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    word-break: break-word;
}

.comen.box-likes-ok {
    box-shadow: 0px 0px 4px #ff0000bd !important;
}

.tgia-comen {
    font-size: 14.5px;
    margin-bottom: 4px;
}

.tgia-comen b a,
.tgia-comen b {
    color: #1d4ed8 !important;
    text-decoration: none !important;
    font-weight: 700;
}

.tgian-comen {
    padding-left: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: normal;
}

.ndung-comen {
    font-size: 14.5px;
    color: #1f2937;
    margin-top: 4px;
    line-height: 1.5;
}

.ndung-comen img {
    margin-left: 0px;
    margin-right: 0px;
    border-radius: 5px;
    max-width: 100%;
}

.tentraloi {
    border-left: 3px solid #2563eb;
    margin-bottom: 8px;
    background: #f3f4f6;
    padding: 7px 10px;
    margin-top: 6px;
    color: #2563eb;
    font-style: italic;
    border-radius: 6px;
}

.tentraloi span {
    color: #4b5563;
    font-size: 13.5px;
}

footer.comment-footer {
    margin-top: 7px;
    margin-bottom: 15px;
    margin-left: 48px;
}

.tra-comen a,
.comment-like a {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    color: #4b5563 !important;
    transition: color 0.15s ease;
}

.tra-comen a {
    margin-right: 15px !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tra-comen a:hover {
    color: #1d4ed8 !important;
}

.comment-like a {
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-like a.likes-comment-ok,
.likes-comment-ok i,
.likes-comment-ok {
    color: #ff4444 !important;
}

.comment-like span.likes-count {
    font-size: 13.5px;
    font-weight: 700;
    color: #ff4444;
    margin-left: 3px;
}

.box-comen {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hinh-comen {
    flex-shrink: 0;
}

.comen-body {
    flex-grow: 1;
}

.tgia-comen {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author-name b a,
.comment-author-name b {
    color: #1d4ed8 !important;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
}

.tgian-comen {
    font-size: 12px;
    color: #6b7280;
}

/* Khung Trích dẫn @Tên + Bình luận cha (Mẫu Facebook/Fox) */
.tentraloi {
    background-color: #f3f4f6;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #2563eb;
}

.parent-mention-link {
    color: #2563eb !important;
    font-style: italic;
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none !important;
}

.parent-comment-snippet {
    color: #4b5563;
    font-size: 13.5px;
    margin-top: 2px;
    line-height: 1.4;
}

.ndung-comen {
    font-size: 14.5px;
    color: #1f2937;
    margin-top: 4px;
    line-height: 1.5;
}

.comen-actions-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
    padding-top: 4px;
}

.tra-comen a,
.thin-btn-like-comment {
    color: #6b7280 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease;
}

.tra-comen a:hover,
.thin-btn-like-comment:hover {
    color: #2563eb !important;
}

.thin-comment-input-area {
    position: relative;
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thin-comment-input-area:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.thin-comment-textarea {
    width: 100% !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    resize: none !important;
    font-size: 14.5px !important;
    color: #1f2937;
    height: 38px !important;
    min-height: 38px !important;
    line-height: 1.4 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: height 0.2s ease, min-height 0.2s ease;
}

.thin-comment-textarea:focus {
    height: 70px !important;
    min-height: 70px !important;
}

.thin-comment-actions-inside {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
}

/* Nút Emoji cuoi.png (Kích thước chuẩn 32px không bị to) */
.thin-emoji-trigger-btn {
    background: none !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    transition: transform 0.2s ease !important;
}

.thin-emoji-trigger-btn img,
.nuticon,
#openicon {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    object-fit: contain !important;
    display: block !important;
}

.thin-emoji-trigger-btn:hover {
    transform: scale(1.15) !important;
}

/* STYLING KHUNG MÃ NGUỒN CODE (100% WIDTH - BORDER 10PX - HÌNH 1) */
.thin-code-wrapper {
    background: #121214 !important;
    border-radius: 10px !important;
    margin-top: 20px;
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid #27272a !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    width: 100% !important;
    max-width: 100% !important;
}

.thin-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #18181b !important;
    border-bottom: 1px solid #27272a !important;
    color: #a1a1aa;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px 10px 0 0 !important;
}

.thin-code-copy-btn {
    background: none !important;
    border: none !important;
    color: #a1a1aa !important;
    cursor: pointer !important;
    font-size: 16px !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    transition: color 0.15s ease, background 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.thin-code-copy-btn:hover {
    color: #ffffff !important;
    background: #27272a !important;
}

.thin-code-pre,
.thin-code-wrapper pre[class*="language-"] {
    max-height: 350px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    margin: 0 !important;
    padding: 18px 20px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* BẢNG MÀU CÚ PHÁP CHUẨN XẮC CHO MÃ NGUỒN (HÌNH 1) */
.thin-code-wrapper pre,
.thin-code-wrapper code {
    color: #e4e4e7 !important;
    font-family: Consolas, "Fira Code", "Courier New", monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.thin-code-wrapper .token.keyword,
.thin-code-wrapper .token.tag,
.thin-code-wrapper .token.operator { color: #f43f5e !important; font-weight: bold; }
.thin-code-wrapper .token.string,
.thin-code-wrapper .token.attr-value { color: #4ade80 !important; }
.thin-code-wrapper .token.function,
.thin-code-wrapper .token.title { color: #eab308 !important; }
.thin-code-wrapper .token.comment { color: #71717a !important; font-style: italic; }
.thin-code-wrapper .token.number,
.thin-code-wrapper .token.boolean { color: #ec4899 !important; }
.thin-code-wrapper .token.variable { color: #3b82f6 !important; }

.thin-btn-like-comment.liked {
    color: #ef4444 !important;
}

.thin-btn-like-comment.liked i {
    animation: heartPulse 0.3s ease;
}

/* STYLING KHUNG CHIA SẺ TẬP TIN (DOWNLOAD MANAGER - FOX THEME HÌNH 3) */
.download-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 25px;
    margin-bottom: 25px;
}

.download-manager-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.download-manager {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.thin-dl-btn {
    background-color: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 9px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2) !important;
}

.thin-dl-btn:hover {
    background-color: #059669 !important;
    transform: translateY(-1px);
}

/* STYLING MỤC LỤC BÀI VIẾT (AUTO TOC - FOX THEME) */
.thin-toc-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.thin-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
    color: #065f46;
}

.thin-toc-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
}

.thin-toc-list {
    margin-top: 12px;
    padding-left: 20px;
    margin-bottom: 0;
}

.thin-toc-list li {
    margin-bottom: 6px;
}

.thin-toc-list li a {
    color: #2563eb;
    text-decoration: none;
    font-size: 14.5px;
}

.thin-toc-list li a:hover {
    text-decoration: underline;
}

.thin-toc-list li.toc-sub-item {
    margin-left: 15px;
}

/* Nút Submit ✈️ Đăng */
.thin-submit-comment-btn {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 7px 18px !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2) !important;
}

.thin-submit-comment-btn:hover {
    background-color: #1e40af !important;
    transform: translateY(-1px);
}

/* Popup Picker Emoji (Chuẩn Fox Theme) */
.thin-emoji-picker-popup {
    position: absolute;
    top: 100%;
    right: 75px;
    margin-top: 10px;
    z-index: 99999;
}

.thin-emoji-picker-popup::before {
    content: "";
    display: block;
    position: absolute;
    top: -9px;
    right: 25px;
    border-style: solid;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent #ffffff transparent;
    width: 0;
    height: 0;
    z-index: 1001;
}

.thin-emoji-picker-popup::after {
    content: "";
    display: block;
    position: absolute;
    top: -10px;
    right: 24px;
    border-style: solid;
    border-width: 0 11px 11px 11px;
    border-color: transparent transparent #e5e7eb transparent;
    width: 0;
    height: 0;
    z-index: 1000;
}

.thin-emoji-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 10px;
    width: 270px;
}

.thin-emoji-header {
    background: #eeeeee;
    color: #1f2937;
    font-size: 13.5px;
    font-weight: 700;
    text-align: center;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.thin-emoji-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    align-items: center;
    justify-items: center;
    padding: 4px;
}

.thin-emoji-item {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border-radius: 8px;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.thin-emoji-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: transform 0.15s ease;
}

.thin-emoji-item:hover {
    transform: scale(1.2);
    background-color: #f3f4f6;
}

/* Format icon smile khi hiển thị trong bài viết/bình luận */
.i-smile img {
    width: 26px !important;
    height: 26px !important;
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px;
}

/* Checkbox Đăng ký nhận bản tin */
.thin-subscribe-newsletter-row {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 63px;
}

.thin-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.thin-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #1d4ed8;
    cursor: pointer;
}


/* Ẩn hoàn toàn khung bình luận cũ của theme/WordPress khi khách chưa đăng nhập */
body:not(.logged-in) #respond form#commentform,
body:not(.logged-in) .comment-form,
body:not(.logged-in) #respond .comment-notes,
body:not(.logged-in) #respond .logged-in-as,
body:not(.logged-in) #respond .comment-reply-title {
    display: none !important;
}


/* ==========================================
   3. RESPONSIVE MOBILE
   ========================================== */

@media (max-width: 640px) {
    .thin-post-footer-box {
        padding: 15px;
    }

    .thin-actions-bar {
        gap: 4px;
    }

    .thin-action-item button {
        padding: 8px 6px;
        font-size: 13.5px;
    }

    .thin-comment-warning-banner {
        padding: 14px 15px;
    }

    .thin-warning-content {
        font-size: 14px;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .thin-warning-icon {
        margin-top: 3px;
    }
}
