﻿/* --- 1. FONTS & VARIABLES --- */
/*@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display:swap');*/

:root {
    --primary: #ec4899; /* Hồng đậm (Pink-500) */
    --primary-light: #fce7f3; /* Hồng nhạt (Pink-100) */
    --teal: #14b8a6; /* Xanh cổ vịt (Teal-500) */
    --teal-light: #ccfbf1; /* Xanh nhạt */
    --orange: #f97316; /* Cam (Orange-500) */
    --orange-light: #ffedd5; /* Cam nhạt */
    --dark: #1f2937; /* Xám đen */
    --gray: #6b7280; /* Xám ghi */
    --radius: 1.5rem; /* Bo góc lớn (24px) */
}

body {
    font-family: 'Quicksand', sans-serif;
    color: var(--dark);
    background-color: #fffafb; /* Nền hồng phấn cực nhẹ */
}

h1, h2, h3, h4, h5, .font-serif {
    font-family: 'Playfair Display', serif;
}

/* --- 2. HEADER & NAV --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.nav-link {
    font-weight: 600;
    color: var(--gray) !important;
    position: relative;
    padding: 0.5rem 1rem !important;
}

    .nav-link:hover, .nav-link.active {
        color: var(--primary) !important;
    }

    /* Hiệu ứng gạch chân khi hover */
    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: var(--primary);
        transition: width 0.3s;
    }

    .nav-link:hover::after {
        width: 100%;
    }

/* --- 3. BUTTONS (Ghi đè Bootstrap) --- */
.btn {
    border-radius: 50px; /* Bo tròn viên thuốc */
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s;
}

.btn-primary-custom {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.3);
}

    .btn-primary-custom:hover {
        background-color: #db2777; /* Pink-600 */
        color: white;
        transform: translateY(-2px);
    }

.btn-outline-custom {
    border: 2px solid #fbcfe8;
    color: var(--primary);
    background: transparent;
}

    .btn-outline-custom:hover {
        background-color: #fff1f2;
        color: var(--primary);
    }

/* --- 4. HERO SECTION --- */
.hero-section {
    background: linear-gradient(135deg, #fff5f6 0%, #e0f2f1 100%);
    padding-top: 100px; /* Tránh header che */
    padding-bottom: 80px;
    overflow: hidden;
}

.hero-tag {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-img-wrapper {
    position: relative;
}
/* Trang trí nền sau ảnh */
.blob-1 {
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    background-color: var(--teal-light);
    border-radius: 50%;
    z-index: -1;
    filter: blur(20px);
}

.blob-2 {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 150px;
    height: 150px;
    background-color: var(--primary-light);
    border-radius: 50%;
    z-index: -1;
    filter: blur(30px);
}

/* --- 5. CARDS (CATEGORY & BLOG) --- */
.card-custom {
    border: none;
    border-radius: var(--radius); /* Bo góc 24px */
    transition: all 0.3s ease;
}

    .card-custom:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }

/* Màu riêng cho từng loại thẻ */
.card-pink {
    background-color: #fff1f2;
}

    .card-pink:hover {
        background-color: #fce7f3;
    }

    .card-pink .icon-box {
        color: var(--primary);
    }

.card-teal {
    background-color: #f0fdfa;
}

    .card-teal:hover {
        background-color: #ccfbf1;
    }

    .card-teal .icon-box {
        color: var(--teal);
    }

.card-orange {
    background-color: #fff7ed;
}

    .card-orange:hover {
        background-color: #ffedd5;
    }

    .card-orange .icon-box {
        color: var(--orange);
    }

.icon-box {
    width: 60px;
    height: 60px;
    background-color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.blog-img {
    height: 200px;
    object-fit: cover;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0; /* Bo 2 góc trên */
}

/* --- 6. FOOTER --- */
footer {
    background-color: #111827; /* Gray-900 */
    color: #9ca3af; /* Gray-400 */
    padding-top: 4rem;
    padding-bottom: 2rem;
}

    footer h5 {
        color: white;
        margin-bottom: 1.5rem;
    }

    footer a {
        color: #9ca3af;
        text-decoration: none;
        transition: 0.3s;
    }

        footer a:hover {
            color: var(--primary);
            padding-left: 5px;
        }

/* =========================================
   SMART ADMIN SIDEBAR
   ========================================= */
:root {
    --sb-width: 260px;
    --sb-mini: 70px;
    --sb-bg: #1e293b;
    --sb-text: #94a3b8;
    --sb-active: #ec4899;
}

/* Sidebar mặc định thu nhỏ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sb-mini); /* Mặc định nhỏ */
    background: var(--sb-bg);
    color: var(--sb-text);
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

    /* Khi Ghim hoặc Hover -> Mở rộng */
    .sidebar.pinned,
    .sidebar:hover {
        width: var(--sb-width);
    }

/* Header Logo */
.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    padding-left: 0;
}

.brand-icon {
    min-width: var(--sb-mini);
    text-align: center;
    font-size: 1.5rem;
    color: var(--sb-active);
}

.brand-text {
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar.pinned .brand-text, .sidebar:hover .brand-text {
    opacity: 1;
}

/* Nút Ghim (Toggle) */
.btn-pin {
    margin-left: auto;
    margin-right: 10px;
    background: none;
    border: none;
    color: white;
    opacity: 0;
    transition: 0.2s;
    cursor: pointer;
}

.sidebar.pinned .btn-pin, .sidebar:hover .btn-pin {
    opacity: 1;
}

/* ====================================================
   FIX MÀU ICON ADMIN (LÀM SÁNG MENU)
   ==================================================== */

/* 1. Trạng thái bình thường: Icon màu Trắng tinh, Chữ màu Xám sáng */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important; /* Chữ sáng 80% */
}

    .sidebar .nav-link i {
        color: #ffffff !important; /* ICON TRẮNG TINH 100% */
        text-shadow: 0 0 5px rgba(0,0,0,0.5); /* Thêm bóng nhẹ cho nổi */
        font-size: 1.3rem; /* Tăng kích thước nhẹ */
    }

    /* 2. Trạng thái Đang chọn (Active) hoặc Rê chuột (Hover) */
    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
        background: rgba(255, 255, 255, 0.1) !important; /* Nền sáng nhẹ */
        color: #ffffff !important; /* Chữ trắng */
    }

        .sidebar .nav-link.active i,
        .sidebar .nav-link:hover i {
            color: #ec4899 !important; /* Icon chuyển sang MÀU HỒNG khi chọn */
        }

/* 3. Header & Nút Ghim */
.sidebar-header .brand-text {
    color: #ffffff !important; /* Tên Admin trắng tinh */
}

.btn-toggle {
    color: rgba(255,255,255,0.7) !important;
}

    .btn-toggle:hover {
        color: #ffffff !important;
    }

/* Main Content co giãn */
.main-content {
    margin-left: var(--sb-mini); /* Mặc định cách lề nhỏ */
    padding: 20px;
    transition: margin-left 0.3s ease;
}

    .main-content.pinned {
        margin-left: var(--sb-width);
    }
/* --- FIX MENU DROPDOWN --- */

/* 1. Tắt mũi tên tam giác mặc định của Bootstrap (để ta dùng icon đẹp hơn) */
.dropdown-toggle::after {
    display: none !important;
}

/* 2. Căn chỉnh chữ và icon nằm ngang hàng */
.nav-link {
    display: flex !important;
    align-items: center;
    gap: 6px; /* Khoảng cách giữa chữ và mũi tên */
}

    /* 3. Chỉnh icon mũi tên nhỏ lại và màu nhạt hơn chút cho tinh tế */
    .nav-link i.fa-chevron-down,
    .nav-link i.fa-angle-down {
        font-size: 0.75rem; /* Icon nhỏ */
        opacity: 0.6;
        margin-top: 2px; /* Căn chỉnh nhẹ xuống dưới */
    }

/* 4. Hiệu ứng xoay mũi tên khi menu mở (Optional - cho xịn) */
.dropdown.show .nav-link i {
    transform: rotate(180deg);
    transition: transform 0.3s;
}
/* =========================================
   MOBILE BOTTOM NAVIGATION (APP BAR)
   ========================================= */
/* 1. Khung chứa thanh menu */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Chiều cao cố định */
    background-color: #ffffff;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); /* Bóng mờ nhẹ phía trên */
    border-top: 1px solid #fce7f3; /* Viền hồng nhạt */

    display: flex;
    justify-content: space-around; /* Chia đều khoảng cách các nút */
    align-items: center;
    z-index: 9999 !important; /* Luôn nằm trên cùng */
    padding-bottom: env(safe-area-inset-bottom); /* Fix cho iPhone tai thỏ */
}

    /* 2. Định dạng từng nút (Item) */
    .mobile-nav .nav-item {
        display: flex;
        flex-direction: column; /* Icon nằm trên, chữ nằm dưới */
        align-items: center;
        justify-content: left;
        text-decoration: none !important; /* QUAN TRỌNG: Bỏ gạch chân link */
        color: #94a3b8; /* Màu xám mặc định (chưa active) */
        font-size: 11px;
        font-weight: 600;
        width: 100%; /* Để vùng bấm rộng ra */
        height: 100%;
        transition: all 0.3s ease;
    }

        /* 3. Định dạng Icon trong nút */
        .mobile-nav .nav-item i {
            font-size: 22px; /* Kích thước icon to rõ */
            margin-bottom: 4px;
        }

        /* 4. Trạng thái đang chọn (Active) */
        .mobile-nav .nav-item.active {
            color: #ec4899 !important; /* Màu hồng chủ đạo */
        }

        .mobile-nav .nav-item:hover {
            background-color: #fff1f2; /* Hiệu ứng nền nhẹ khi bấm */
            color: #ec4899;
        }

/* 5. Nút tròn to ở giữa (Floating Action Button) */
.fab-wrapper {
    position: relative;
    top: -25px; /* Đẩy nổi lên trên thanh menu */
}

.fab-button {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); /* Màu gradient đẹp */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4); /* Bóng đổ hồng */
    border: 4px solid #ffffff; /* Viền trắng cắt nền */
    font-size: 24px;
    transition: transform 0.2s;
}

    .fab-button:active {
        transform: scale(0.95); /* Hiệu ứng nhấn xuống */
    }

/* 6. Đẩy nội dung web lên để không bị menu che mất */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px !important;
    }
    /* Ẩn footer to của PC đi cho đỡ rối */
    /*footer {
        display: none;
    }*/
}
/* --- HERO IMAGE ANIMATION --- */
.hero-rotate-img {
    transform: rotate(2deg); /* Mặc định nghiêng */
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Chuyển động mượt */
    z-index: 2;
    position: relative;
    max-height: 450px;
    object-fit: cover;
    border-radius: 20px; /* Bo góc */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

    /* Khi rê chuột vào: Quay thẳng đứng và phóng to nhẹ */
    .hero-rotate-img:hover {
        transform: rotate(0deg) scale(1.02);
        box-shadow: 0 15px 40px rgba(236, 72, 153, 0.3); /* Bóng hồng đẹp hơn */
    }
/* 1. Cuộn mượt toàn trang */
html {
    scroll-behavior: smooth;
}

/* 2. Xử lý Fixed Header che mất nội dung khi cuộn tới ID */
/* scroll-margin-top: Chiều cao header + khoảng hở (Ví dụ header cao 80px) */
.target-highlight {
    scroll-margin-top: 100px;
}

    /* 3. Hiệu ứng nhấp nháy để người dùng biết đang xem bài nào */
    /* Khi ID trên URL khớp với ID của thẻ, CSS này sẽ kích hoạt */
    .target-highlight:target {
        animation: highlightPost 2s ease-out;
        border: 2px solid #ec4899 !important; /* Viền hồng */
    }

@keyframes highlightPost {
    0% {
        background-color: #fff0f5;
        transform: scale(1.02);
    }

    50% {
        background-color: #fff0f5;
        transform: scale(1.02);
    }

    100% {
        background-color: white;
        transform: scale(1);
    }
}
/* --- FIX GIAO DIỆN CỘNG ĐỒNG --- */

/* 1. Sidebar dính (Sticky) */
.sticky-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 100px; /* Cách header 1 đoạn */
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 5px; /* Để thanh cuộn không dính sát */
}

/* 2. Menu bên trái (Sửa lỗi màu sắc) */
.nav-pills-custom .nav-link {
    color: #4b5563 !important; /* Màu xám đậm dễ đọc */
    background-color: #ffffff; /* Nền trắng */
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

    .nav-pills-custom .nav-link:hover {
        background-color: #fce7f3 !important; /* Nền hồng nhạt khi hover */
        color: #db2777 !important; /* Chữ hồng đậm */
        transform: translateX(5px); /* Hiệu ứng đẩy sang phải */
    }

    .nav-pills-custom .nav-link.active {
        background-color: #ec4899 !important; /* Nền hồng chủ đạo */
        color: #ffffff !important; /* Chữ TRẮNG (Khắc phục lỗi trùng màu) */
        box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
    }

    /* Giữ màu icon nguyên bản khi chưa active */
    .nav-pills-custom .nav-link i {
        width: 25px;
        text-align: center;
        margin-right: 5px;
    }
    /* Khi active thì icon thành màu trắng */
    .nav-pills-custom .nav-link.active i {
        color: #ffffff !important;
    }

/* 3. Hiệu ứng Like nảy */
.animate-bounce {
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* ==================================================
   FIX TRÀN MÀN HÌNH & LỖI MENU MOBILE
   ================================================== */

/* 1. Ngăn chặn cuộn ngang toàn trang */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}

/* 2. Đảm bảo ảnh không bao giờ to hơn màn hình */
img {
    max-width: 100%;
    /*height: auto;*/
}

/* 3. Xử lý Container trên mobile */
@media (max-width: 768px) {
    .container, .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
    }

    /* Hero section: Căn giữa nội dung và cho nút bấm xếp dọc nếu cần */
    .hero-section {
        text-align: center;
    }

        .hero-section .d-flex {
            justify-content: center;
        }

    /* Form tra cứu: Xếp dọc trên điện thoại */
    .col-md-8 .d-flex.gap-2 {
        flex-wrap: wrap;
    }

        .col-md-8 .d-flex.gap-2 input,
        .col-md-8 .d-flex.gap-2 button {
            width: 100% !important; /* Nút và ô nhập to full màn hình */
        }

    /* Fix khối Công cụ bị đè lên Banner (mt-n5) */
    /* Trên mobile bỏ margin âm để không bị lỗi layout */
    .mt-n5 {
        margin-top: 0 !important;
        padding-top: 20px;
    }
}

/* Class tự chế: Xanh -> Hồng */
.link-green-pink {
    color: #0ea5e9 !important; /* Màu Xanh lá #198754 (Hoặc #0ea5e9 là xanh dương) */
    transition: color 0.3s ease; /* Hiệu ứng chuyển màu mượt mà */
}

.link-green-pink:hover {
    color: #ec4899 !important; /* Màu Hồng khi rê chuột */
}
/* --- GIẢM KHOẢNG CÁCH TOÀN TRANG --- */

/* 1. Giảm khoảng cách giữa các Section (Khối lớn) */
section {
    padding-top: 2rem !important; /* Cũ là 3rem (py-5) */
    padding-bottom: 2rem !important;
}

/* 2. Giảm khoảng cách tiêu đề (H1, H2...) với nội dung dưới */
h1, h2, h3, h4, h5 {
    margin-bottom: 0.5rem !important; /* Cũ thường là mb-3, mb-4 */
}

/* 3. Giảm độ dày bên trong Card (Thẻ) */
.card-body {
    padding: 1rem !important; /* Cũ là 1.5rem hoặc p-4 */
}

/* 4. Giảm khoảng cách Header/Banner */
.hero-section {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
}
/* --- FIX LỖI GIẬT MÀN HÌNH KHI MỞ MODAL --- */
html {
    /* Luôn giữ khoảng trống của thanh cuộn */
    scrollbar-gutter: stable;
}

/* ==================================================
   MOBILE UI OPTIMIZATION (NHỎ GỌN HƠN) Cải thiện trải nghiệm trên di động
   ================================================== */

/* 1. Class để ẩn Header (Dùng cho Javascript) */
.header-hidden {
    transform: translateY(-100%); /* Trượt hẳn lên trên ra khỏi màn hình */
}

/* Hiệu ứng trượt mượt mà cho Header */
.fixed-top {
    transition: transform 0.3s ease-in-out;
    z-index: 1030; /* Chuẩn của Bootstrap */
}

@media (max-width: 768px) {

    /* 2. Thu nhỏ Header (Menu trên) */
    .navbar {
        padding: 5px 0 !important; /* Giảm padding trên dưới */
        min-height: 50px;
    }

    .navbar-brand span {
        font-size: 1.1rem !important; /* Chữ Logo nhỏ lại */
    }

    /* Logo tròn nhỏ lại */
    .navbar-brand div {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }

    /* 3. Thu nhỏ Bottom Nav (Menu dưới) */
    .mobile-nav {
        height: 55px !important; /* Cũ là 70px -> Giảm xuống 55px */
    }

        .mobile-nav .nav-item i {
            font-size: 18px !important; /* Icon nhỏ lại */
            margin-bottom: 2px !important;
        }

        .mobile-nav .nav-item span {
            font-size: 10px !important; /* Chữ bé lại */
            font-weight: 500 !important;
        }

    /* Nút tròn to (FAB) ở giữa cũng phải nhỏ lại cho cân đối */
    .fab-button {
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
        top: -15px !important; /* Đẩy thấp xuống 1 chút */
    }

    /* Giảm khoảng cách body để khớp với menu mới */
    body {
        padding-bottom: 70px !important; /* Cũ là 90px-100px */
    }
}
/* ======================================================
   MOBILE SCROLLBAR FIX (HIỆN THANH CUỘN RÕ RÀNG)
   ====================================================== */

/* Áp dụng cho bảng và các vùng cuộn ngang/dọc */
.table-responsive,
.overflow-auto,
.overflow-x-auto,
.nav-pills-custom { /* Menu bên trái trang cộng đồng */
    /* Giúp cuộn mượt trên iOS */
    -webkit-overflow-scrolling: touch;
    /* Chừa khoảng trống bên dưới để thanh cuộn không đè lên nội dung */
    padding-bottom: 8px;
}

    /* 1. Thiết lập kích thước thanh cuộn */
    .table-responsive::-webkit-scrollbar,
    .overflow-auto::-webkit-scrollbar,
    .overflow-x-auto::-webkit-scrollbar,
    .nav-pills-custom::-webkit-scrollbar {
        height: 6px; /* Độ dày thanh ngang (Mobile cần nhỏ vừa đủ) */
        width: 6px; /* Độ dày thanh dọc */
    }

    /* 2. Thiết lập màu nền của đường ray (Track) */
    .table-responsive::-webkit-scrollbar-track,
    .overflow-auto::-webkit-scrollbar-track,
    .overflow-x-auto::-webkit-scrollbar-track,
    .nav-pills-custom::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    /* 3. Thiết lập màu của tay nắm kéo (Thumb) - Quan trọng nhất */
    .table-responsive::-webkit-scrollbar-thumb,
    .overflow-auto::-webkit-scrollbar-thumb,
    .overflow-x-auto::-webkit-scrollbar-thumb,
    .nav-pills-custom::-webkit-scrollbar-thumb {
        background-color: #c1c1c1; /* Màu xám đậm để dễ nhìn trên nền trắng */
        border-radius: 4px;
    }

        /* 4. Hiệu ứng khi người dùng chạm vào thanh cuộn */
        .table-responsive::-webkit-scrollbar-thumb:active,
        .overflow-auto::-webkit-scrollbar-thumb:active,
        .nav-pills-custom::-webkit-scrollbar-thumb:active {
            background-color: var(--primary-color); /* Chuyển màu hồng khi đang kéo */
        }

/* Ép bảng phải trượt ngang trên mobile thay vì xuống dòng */
@media (max-width: 768px) {
    .table-responsive table {
        white-space: nowrap; /* Không cho chữ xuống dòng */
    }

    .table-responsive th,
    .table-responsive td {
        padding: 10px 15px; /* Tăng khoảng cách để dễ đọc */
    }
}

/* ========================================================
   FIX GIAO DIỆN CỘNG ĐỒNG TRÊN MOBILE (TRÀN VIỀN)
   ======================================================== */

@media (max-width: 768px) {

    /* 1. Mở rộng khung bao ngoài cùng */
    .community-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. Mở rộng cột chứa Feed */
    .feed-col {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 3. Tùy chỉnh thẻ Bài viết (Card) cho giống Facebook Mobile */
    .feed-card {
        border-radius: 0 !important; /* Bỏ bo tròn 4 góc -> Vuông vức */
        border-left: 0 !important; /* Bỏ viền trái */
        border-right: 0 !important; /* Bỏ viền phải */
        box-shadow: none !important; /* Bỏ bóng đổ 2 bên */
        border-bottom: 8px solid #f0f2f5 !important; /* Tạo khoảng cách xám dày giữa các bài */
        margin-bottom: 0 !important; /* Bỏ margin cũ */
    }

    /* 4. Chỉnh lại Form đăng bài cho đẹp hơn */
    .feed-col .card:first-child {
        /* Card đầu tiên (Form đăng bài) cũng vuông góc và tràn viền */
        border-radius: 0 !important;
        margin-bottom: 8px !important;
        border-bottom: 8px solid #f0f2f5 !important;
    }
}
/* --- FLOATING WIDGET --- */
.floating-widget {
    position: fixed;
    bottom: 90px; /* Cách đáy để tránh menu mobile */
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: end;
    pointer-events: none;
}

/* Nút chính */
.main-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

    .main-toggle-btn:hover {
        transform: scale(1.1);
    }

/* Hiệu ứng rung khi chưa mở */
.floating-widget:not(.active) .main-toggle-btn {
    animation: pulse-ring 2s infinite;
}

/* Danh sách con */
.contact-list {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 15px;
    margin-bottom: 15px;
    /* Hiệu ứng ẩn hiện */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    background-color: transparent;
}

/* Khi Widget Active -> Hiện danh sách */
.floating-widget.active .contact-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Các nút con */
.contact-item {
    display: flex;
    align-items: center;
    text-decoration: none;
}

    .contact-item .icon-circle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        transition: 0.3s;
        font-size: 22px;
    }

    .contact-item:hover .icon-circle {
        transform: scale(1.1);
    }
/* 2. Kích hoạt lại khả năng bấm cho các nút con */
.main-toggle-btn,
.contact-list,
.contact-item {
    pointer-events: auto;
}

/* Màu sắc từng kênh */
.call .icon-circle {
    background:#ef4444;
}

.zalo .icon-circle {
    background:#0068ff;
}

.mess .icon-circle {
    background: #0084ff;
}

/* Nhãn chữ (Tooltip) */
    .contact-item .label {
    background:  rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 13px;
    opacity: 0;
    transition: 0.3s;
    transform: translateX(10px);
}

.contact-item:hover .label {
    opacity: 1;
    transform: translateX(0);
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(236, 72, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
    }
}
/* ======================================================
   SKELETON LOADING (HIỆU ỨNG XƯƠNG)
   ====================================================== */

/* Class gốc tạo hiệu ứng nhấp nháy */
.skeleton {
    background-color: #e0e0e0;
    background-image: linear-gradient( 90deg, #e0e0e0 0px, #f5f5f5 50%, #e0e0e0 100% );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px; /* Bo góc nhẹ */
}

/* Animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Các biến thể hình dạng */
.skeleton-text {
    height: 15px;
    margin-bottom: 10px;
    width: 100%;
}

.skeleton-title {
    height: 25px;
    margin-bottom: 15px;
    width: 70%;
}

.skeleton-img {
    width: 100%;
    height: 200px; /* Chiều cao ảnh giả lập */
    display: block;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
/* Style cho thông báo */
.noti-item {
    transition: 0.2s;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
}

    .noti-item:hover {
        background-color: #fce7f3;
    }
    /* Hover màu hồng */
    .noti-item.unread {
        background-color: #f0fdfa;
    }
/* Chưa đọc màu xanh nhạt */
.noti-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* ======================================================
   MOBILE TOUCH OPTIMIZATION (BẢN SỬA LỖI AN TOÀN)
   ====================================================== */

/* 1. Chỉ áp dụng con trỏ tay cho các thành phần thực sự bấm được */
a, button, .btn, .nav-item, label.btn {
    cursor: pointer;
    touch-action: manipulation; /* Tắt delay 300ms */
    -webkit-tap-highlight-color: transparent; /* Bỏ nháy xanh mặc định */
}

/* 2. KHÔNG gán cursor pointer cho ô nhập liệu và thẻ card (Tránh hiểu nhầm) */
input, textarea, select, .card {
    cursor: auto; /* Trở về con trỏ mặc định (dấu gạch đứng hoặc mũi tên) */
}

/* 3. Hiệu ứng khi bấm (Active) - ĐÃ SỬA LỖI */
/* Thay vì thu nhỏ (gây lệch cảm ứng), ta chỉ làm mờ nhẹ hoặc đổi màu nền */
a:active,
button:active,
.btn:active,
.nav-link:active {
    /* transform: scale(0.96);  <-- DÒNG GÂY LỖI: ĐÃ BỎ */
    opacity: 0.7; /* Chỉ làm mờ nhẹ để biết là đã bấm */
    transition: opacity 0.1s;
}

/* 4. Riêng thẻ Card (Bài viết/Sản phẩm) */
/* Chỉ khi bấm vào link bên trong card mới có hiệu ứng, bản thân card không nên nhúc nhích */
.card:active {
    transform: none !important;
    background-color: #fff;
}

/* Tắt hiệu ứng hover trên thiết bị cảm ứng để tránh phải bấm 2 lần */
@media (hover: none) {
    .dropdown-toggle:hover .dropdown-menu {
        display: none; /* Chỉ hiện khi click, không hiện khi hover */
    }

    /* Đảm bảo menu con không tự đóng khi lỡ tay chạm nhẹ */
    .dropdown-menu {
        margin-top: 0;
    }
}

/* Đảm bảo nội dung trong Modal không bị cắt cụt khi xổ danh sách xuống */
.modal-body {
    overflow: visible !important;
}

/* Tăng độ nổi của hộp gợi ý */
#headerSuggestBox {
    border: 1px solid #eee;
    border-top: none;
}

/* Hiển thị tối đa 2 dòng, thừa thì ... */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal !important;
    /* THÊM DÒNG NÀY: Để chắc chắn chữ dài sẽ xuống dòng */
    word-break: break-word;
    /* BỎ DÒNG height: 40px đi để tránh cắt chữ nếu font to */
    /* Thay vào đó chỉnh line-height cho thoáng */
    line-height: 1.4;
    /* Đảm bảo nó chiếm không gian trong Flexbox */
    width: 100%;
}

/* --- THÊM CON TRỎ CHUỘT BÀN TAY KHI RÊ VÀO CARD --- */

/* 1. Áp dụng cho các card có hiệu ứng hover-up (Card chung) */
.card.hover-up {
    cursor: pointer;
}

/* 2. Áp dụng cho các card có class tool-card (Trang Tiện ích) */
.tool-card {
    cursor: pointer;
}

/* 3. Áp dụng cho card tên (Trang Tra cứu tên) */
.card-name {
    cursor: pointer;
}

/* =========================================
   ADMIN MOBILE FIX
   ========================================= */
@media (max-width: 768px) {
    /* 1. Mặc định ẩn Sidebar sang bên trái màn hình */
    .sidebar {
        width: 260px !important; /* Luôn giữ rộng */
        left: -260px; /* Giấu đi */
        transition: left 0.3s ease-in-out;
        z-index: 1050; /* Cao hơn nội dung */
    }

        /* 2. Khi kích hoạt -> Trượt vào */
        .sidebar.mobile-open {
            left: 0;
        }

    /* 3. Nội dung chính không bị đẩy sang phải mà giữ nguyên */
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    /* 4. Lớp phủ đen (Overlay) để làm tối nền khi mở menu */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040; /* Thấp hơn sidebar 1 chút */
    }

        .sidebar-overlay.show {
            display: block;
        }

    /* Hiện nút Toggle trên Mobile */
    .mobile-toggle-btn {
        display: block !important;
    }

    /* Ẩn bớt các cột trong bảng trên mobile */
    .table td:nth-child(n+4),
    .table th:nth-child(n+4) {
        display: none; /* Ẩn cột thứ 4 trở đi */
    }
}
/* Tắt nháy xanh/đen khi chạm trên điện thoại */
* {
    -webkit-tap-highlight-color: transparent !important;
}

a, button, .card, .nav-item {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}

/* --- FIX LỖI VIDEO BỊ LỆCH TRONG NỘI DUNG BÀI VIẾT --- */
.blog-content video,
.blog-content iframe {
    width: 100% !important; /* Ép rộng 100% theo khung chứa */
    max-height: 500px !important; /* Không cho video dọc dài quá tràn màn hình */
    height: auto;
    /* 3 Thuộc tính quan trọng nhất để căn giữa */
    object-fit: contain !important; /* Hiển thị trọn vẹn video, không cắt xén */
    display: block !important; /* Ép thành khối độc lập */
    margin: 15px auto !important; /* Căn giữa tuyệt đối (Auto margin) */

    background-color: #000; /* Tạo viền đen cho khoảng trống (giống Youtube) */
    border-radius: 12px;
}
/* ==========================================================
   TỐI ƯU CHIỀU RỘNG MÀN HÌNH LAPTOP/PC (98% WIDTH)
   ========================================================== */

/* Áp dụng cho màn hình từ 992px trở lên (Laptop, PC) */
@media (min-width: 992px) {
    .container {
        /* Ép chiều rộng tối đa lên 98% màn hình */
        max-width: 98% !important;
        /* Đảm bảo vẫn căn giữa (1% lề trái, 1% lề phải) */
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Áp dụng cho màn hình siêu rộng (Màn hình 2K, 4K) */
@media (min-width: 1400px) {
    .container {
        max-width: 96% !important; /* Màn hình quá to thì lùi lại 96% cho đỡ mỏi mắt khi đọc từ trái sang phải */
    }
}
/* Trong file site.css */
input, textarea {
    /* Tránh bị Header che mất khi cuộn, thay 70px bằng chiều cao Header của bạn */
    scroll-margin-top: 70px;
}