:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-color);
    min-height: 100vh;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}

.glass-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Header */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo { font-size: 24px; color: var(--primary-color); font-weight: bold; }
.admin-link { text-decoration: none; color: var(--text-color); font-weight: 500; transition: color 0.3s; }
.admin-link:hover { color: var(--primary-color); }


@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-filter input, .search-filter select {
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    background: rgba(255,255,255,0.9);
}
.search-filter { 
    display: flex; 
    flex: 1; 
    max-width: 600px; /* Tăng độ rộng để thanh tìm kiếm to đẹp trên PC */
    margin: 0 40px; 
    gap: 10px;
}
.search-filter input { flex: 1; }

/* Video Grid (Mod Grid) - LƯỚI TỰ ĐỘNG LẤP ĐẦY KHÔNG GÓC CHẾT */
.video-grid {
    display: grid;
    /* Phép thuật auto-fit: Các thẻ có bề ngang tối thiểu 220px, nếu thừa chỗ sẽ tự giãn đều ra */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

/* Video Card (Mod Card) */
.video-card {
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.5);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

/* --- TỐI ƯU THẺ MOD (DẸT 16:9, ÉP 1 DÒNG CHỮ) --- */
.card-thumb {
    width: 100%;
    aspect-ratio: 16/9 !important; /* Ép khung ảnh chuẩn video Youtube */
    object-fit: cover;
    display: block;
}

.card-body { 
    padding: 10px; /* Gọt mỏng phần nền trắng */
    display: flex;
    flex-direction: column;
    gap: 6px; /* Khoảng cách giữa tiêu đề và Tag cực nhỏ */
}

.card-title {
    font-size: 14px;
    margin-bottom: 0;
    white-space: nowrap; /* CẤM rớt dòng */
    overflow: hidden; /* CẤM chữ thò ra ngoài */
    text-overflow: ellipsis; /* Dài quá tự biến thành 3 dấu chấm ... */
}

/* Gom Tag và Lượt xem vào chung 1 dòng dưới cùng */
.card-bottom {
    display: flex;
    justify-content: space-between; /* Đẩy Tag sang trái, Lượt xem sang phải */
    align-items: center;
}

.badge-group {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Khôi phục màu sắc và bo góc cho Tag */
.badge {
    font-size: 10px;
    padding: 4px 8px;
    white-space: nowrap;
    background: var(--primary-color); /* Màu nền xanh */
    color: white; /* Chữ màu trắng */
    border-radius: 20px; /* Bo góc tròn trịa */
    font-weight: 600;
}

/* Tag phiên bản có màu xám khác biệt */
.badge-version {
    background: #64748b; 
}

/* Chỉnh lại phần chứa Tag dưới đáy thẻ (Do đã xóa lượt xem) */
.card-bottom {
    display: flex;
    align-items: center;
}

/* Skeleton Loading */
.skeleton-card { background: #fff; border-radius: 12px; overflow: hidden; }
.skeleton-img { width: 100%; aspect-ratio: 16/9; background: #e2e8f0; animation: pulse 1.5s infinite; }
.skeleton-text { height: 20px; background: #e2e8f0; margin: 15px; border-radius: 4px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* --- GIAO DIỆN CHI TIẾT MOD (MODAL) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 95%;
    max-width: 1100px; /* Cửa sổ to hơn */
    background: #fff;
    border-radius: 16px;
    position: relative;
    max-height: 90vh; 
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

/* Nút X đóng rõ ràng hơn (Nền đen mờ, đổi màu khi di chuột) */
.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    color: #fff;
    background: rgba(0, 0, 0, 0.7); 
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    transition: 0.3s;
    text-shadow: none; 
}
.close-btn:hover { background: #ef4444; }

.mod-banner { 
    width: 100%; 
    height: 320px; /* Cố định chiều cao banner */
    background: #000; 
    position: relative;
    flex-shrink: 0;
}
.mod-banner img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
}

.mod-info { 
    padding: 25px; 
    overflow-y: auto; /* Cho phép cuộn nếu nội dung dài */
    flex: 1; 
}

/* Thư viện ảnh lướt ngang */
.mod-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: thin; 
}
.mod-gallery::-webkit-scrollbar { height: 8px; }
.mod-gallery::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px;}
.mod-gallery::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px;}

.mod-gallery img {
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s;
}
.mod-gallery img:hover {
    transform: scale(1.02);
}

/* --- GIAO DIỆN ADMIN --- */
.admin-body { background-image: none; background-color: #f1f5f9; }
.login-box { width: 100%; max-width: 400px; padding: 30px; border-radius: 16px; }
.login-box h2 { text-align: center; margin-bottom: 20px; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px;}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit;
}
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

.btn { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-family: inherit; transition: 0.3s;}
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger-color); color: white; }
.btn-secondary { background: #94a3b8; color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px;}

.admin-section { padding: 25px; border-radius: 12px; background: white; }
.admin-section h2 { margin-bottom: 20px; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px;}

.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.admin-table th { background: #f8fafc; font-weight: 600; }
.admin-table img { width: 80px; height: 45px; object-fit: cover; border-radius: 4px; }
.action-btns { display: flex; gap: 5px; }

/* Khu vực dán ảnh (Paste Area) */
.paste-area {
    border: 2px dashed #cbd5e1;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    background: #f8fafc;
    transition: 0.3s;
    outline: none;
}
.paste-area:focus, .paste-area:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
}
.paste-area p { color: #64748b; font-size: 14px; pointer-events: none; margin-bottom: 0; }
.img-preview { width: 100%; max-height: 200px; object-fit: contain; margin-top: 10px; border-radius: 8px; display: none; }

/* Chữ thông báo trạng thái tải ảnh ở Admin */
.uploading-text {
    color: #ef4444;
    font-weight: bold;
    margin-top: 10px;
    animation: pulse 1.5s infinite;
}

/* Toast Notification */
.toast {
    visibility: hidden; min-width: 250px; background-color: #333; color: #fff;
    text-align: center; border-radius: 8px; padding: 16px; position: fixed;
    z-index: 9999; right: 20px; bottom: 30px; font-size: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); opacity: 0; transition: opacity 0.3s, visibility 0.3s;
}
.toast.show { visibility: visible; opacity: 1; }
.toast.success { border-left: 5px solid #22c55e; }
.toast.error { border-left: 5px solid #ef4444; }


/* =======================================================
   CẬP NHẬT CỬA SỔ CHI TIẾT MOD (MODAL)
======================================================= */

/* 1. Hủy đính cứng ảnh bìa, cho phép cuộn toàn bộ cửa sổ cùng nhau */
.modal-content {
    display: block !important; /* Tắt chế độ chia khung ghim ảnh */
    overflow-y: auto !important; /* Bật thanh cuộn cho toàn bộ khối cửa sổ */
}

.mod-info {
    overflow-y: visible !important; /* Tắt thanh cuộn nhỏ lẻ của phần thông tin */
}

/* Nút X sẽ trôi theo ảnh bìa lên trên cho tự nhiên, nhưng ta cho nó to ra một xíu để dễ bấm */
.close-btn {
    width: 45px; height: 45px;
    font-size: 26px;
}

/* 2. Làm to "Loại mod" và "Phiên bản" bên trong cửa sổ chi tiết */
.mod-info .badge-group {
    gap: 12px; /* Tăng khoảng cách giữa 2 nhãn */
    margin-bottom: 20px; /* Cách xa nút Download ra một chút */
}

.mod-info .badge {
    font-size: 16px !important; /* Cỡ chữ to rõ ràng */
    padding: 8px 18px !important; /* Khung nhãn phình to ra */
    border-radius: 25px !important; /* Bo góc tròn trĩnh hơn */
    font-weight: bold; /* In đậm chữ cho nổi bật */
}

/* --- TÙY CHỈNH NÂNG CAO CHO KHUNG ẢNH PHỤ TRONG ADMIN --- */
#galleryPreview {
    display: flex; 
    gap: 15px; 
    margin-top: 15px; 
    overflow-x: auto; 
    padding-bottom: 10px;
    align-items: center;
}

.gallery-item {
    position: relative;
    cursor: grab; /* Con trỏ hình bàn tay báo hiệu có thể kéo */
    display: inline-block;
    transition: transform 0.2s;
}

/* Hiệu ứng khi đang cầm ảnh kéo đi */
.gallery-item.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.gallery-item img {
    height: 70px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    pointer-events: none; /* Giúp việc kéo thả mượt hơn */
    display: block;
}

/* Nút Xóa ảnh (Dấu X màu đỏ) */
.gallery-item-delete {
    position: absolute;
    top: -8px; 
    right: -8px;
    background: #ef4444; 
    color: white;
    border-radius: 50%;
    width: 22px; 
    height: 22px;
    font-size: 14px;
    font-weight: bold;
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: 0.2s;
    z-index: 10;
}

.gallery-item-delete:hover {
    background: #dc2626;
    transform: scale(1.1);
}
/* =======================================================
   GIAO DIỆN TRANG CHI TIẾT ĐỘC LẬP (chitiet.html)
======================================================= */

/* 1. Khung chứa Banner */
.detail-header-banner {
    position: relative;
    width: 100%;
    height: 280px; /* Chiều cao cố định của banner */
    overflow: hidden; /* Cắt bỏ phần mờ bị tràn ra ngoài */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 20px;
}

/* 2. Lớp nền mờ (Kéo dãn to hơn khung một xíu để viền không bị lộ) */
.detail-blur-bg {
    position: absolute;
    top: -20px; left: -20px; right: -20px; bottom: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.7); /* Làm mờ 15px và hơi tối lại */
    z-index: 1;
}

/* 3. Ảnh Avatar vuông ở giữa */
.detail-avatar {
    position: relative;
    z-index: 2; /* Nổi lên trên lớp nền mờ */
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 20px; /* Bo cong nhiều nhìn cho giống App */
    border: 4px solid #fff; /* Viền trắng */
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); /* Đổ bóng cho xịn */
}

/* 4. Thống kê (Sao, Lượt xem) */
.detail-stats {
    position: absolute;
    bottom: 15px;
    right: 20px;
    z-index: 2;
    display: flex;
    gap: 10px;
}

/* 5. Tiêu đề Mod */
.detail-title {
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    margin: 20px 0;
    color: var(--text-color);
    padding: 0 15px;
}

/* --- NHÓM NÚT BẤM TRANG CHI TIẾT --- */
.detail-actions {
    display: flex;
    flex-direction: column; /* Bắt buộc xếp dọc */
    align-items: center;    /* Căn giữa 2 nút */
    gap: 12px;              /* Khoảng cách giữa 2 nút */
    margin-bottom: 30px;
    padding: 0 15px;
}

/* Định dạng chung cho cả 2 nút */
.detail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Nút Tải xuống (Nút chính - To và Nổi bật) */
.detail-btn-primary {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    width: 100%; 
    max-width: 400px; /* Chiều ngang to */
    padding: 16px 20px; /* Chiều cao bự */
    font-size: 18px; /* Chữ to */
}
.detail-btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* Nút Hướng dẫn (Nút phụ - Nhỏ nhắn, nằm dưới) */
.detail-btn-secondary {
    background-color: transparent;
    color: #475569;
    border: 2px solid #cbd5e1;
    width: 100%;
    max-width: 250px; /* Giới hạn chiều ngang luôn luôn NHỎ HƠN nút Tải */
    padding: 10px 20px; /* Chiều cao lùn hơn */
    font-size: 14px; /* Chữ nhỏ hơn */
}
.detail-btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #6366f1;
    color: #6366f1;
}
/* --- SỬA LỖI ẢNH 1: BÓP ẢNH AVATAR THÀNH HÌNH VUÔNG CHUẨN --- */
.detail-avatar {
    object-fit: cover !important; /* Cắt cúp phần thừa sao cho đầy khung */
    aspect-ratio: 1 / 1 !important; /* Bắt buộc ép thành hình vuông tỷ lệ 1:1 */
    background-color: #1e293b; /* Màu lót phòng trường hợp ảnh trong suốt */
}

/* --- SỬA LỖI ẢNH 2 & 3: CHỐNG TRÀN ẢNH TRONG BÀI VIẾT CHI TIẾT --- */
#detailDescription img, 
#modalDescription img, 
.ql-editor img {
    max-width: 100% !important; /* Tuyệt đối không được to hơn màn hình điện thoại/PC */
    height: auto !important; /* Tự động co giãn chiều cao cho không bị méo */
    border-radius: 8px; /* Bo góc nhẹ cho giống các trang báo mạng */
    display: block;
    margin: 10px auto; /* Tự động căn giữa ảnh */
}

/* --- CHUẨN BỊ CHO ẢNH 4: GIAO DIỆN PHÓNG TO ADMIN --- */
.editor-fullscreen-mode {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #f1f5f9;
    z-index: 99999;
    padding: 30px;
    overflow-y: auto;
}
.editor-fullscreen-mode #editor-container {
    height: calc(100vh - 150px) !important; /* Kéo dài khung soạn thảo ra chạm đáy màn hình */
}


@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HIỆU ỨNG TRƯỢT ẨN HEADER --- */
.glass-header { transition: transform 0.3s ease-in-out; }
.glass-header.header-hidden { transform: translateY(-100%); }
/* =========================================
   GIAO DIỆN MOBILE CHUẨN (GOM TẤT CẢ VÀO ĐÂY)
========================================= */
@media (max-width: 768px) {
    /* 1. Header: Ép Logo và Kính lúp sát 2 mép trái phải */
    .header-container { 
        display: flex !important;
        flex-wrap: wrap !important; 
        justify-content: space-between !important; 
        align-items: center !important;
        padding: 10px 15px !important; 
    }
    .logo { order: 1 !important; margin: 0 !important; }
    
    .header-actions { 
        order: 2 !important; 
        display: flex !important; 
        align-items: center !important; 
    }
    
    /* Hiện icon Kính lúp */
    .mobile-search-btn {
        display: block !important; 
        background: none; border: none; font-size: 22px; color: var(--primary-color); cursor: pointer;
        padding: 5px 0 5px 15px !important; 
    }
    
/* Ẩn thanh tìm kiếm dài, khi bấm Kính lúp mới trượt xuống */
    .search-filter { 
        order: 3 !important; 
        display: none !important; 
        width: 100% !important; 
        max-width: 100% !important;
        margin: 15px 0 0 0 !important; 
        flex-direction: row !important; /* Lệnh mới: Ép 2 ô nằm chung trên 1 hàng ngang */
        gap: 8px !important; /* Khoảng cách hở giữa 2 ô */
    }
    .search-filter.active { 
        display: flex !important; 
        animation: fadeInDown 0.3s ease; 
    }

    /* Lệnh chia tỷ lệ 7 - 3 trên Mobile */
    .search-filter input {
        flex: 7 !important; /* Chiếm 7 phần */
        min-width: 0 !important; /* Ép không được phình to ra ngoài */
    }
    .search-filter select {
        flex: 3 !important; /* Chiếm 3 phần */
        min-width: 0 !important;
        padding: 10px 5px !important; /* Thu nhỏ viền trắng bên trong để chữ không bị che */
        font-size: 13px !important; /* Chữ nhỏ lại một chút cho vừa vặn */
        text-overflow: ellipsis !important; /* Tự động thêm dấu ... nếu chữ dài quá */
    }

    /* 2. Thẻ Mod: Ép cứng 2 thẻ/hàng, gọt bớt chữ để không bị tràn */
    .video-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important; 
    }
    .card-body { padding: 8px !important; } 
    .card-title { font-size: 13px !important; margin-bottom: 6px !important; } 
    .badge { font-size: 10px !important; padding: 3px 6px !important; } 
    .badge-group { gap: 5px !important; }
}

/* --- CSS BỐ CỤC CÁC KHU VỰC TRANG CHỦ --- */
.category-section { margin-top: 40px; }
.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    padding: 0 10px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}
.section-title { font-size: 20px; font-weight: bold; color: var(--text-color); display: flex; align-items: center; gap: 8px; }
.view-more { font-size: 14px; color: #64748b; text-decoration: none; font-weight: 600; transition: color 0.3s; }
.view-more:hover { color: var(--primary-color); }
.category-section .video-grid { margin-top: 15px; } /* Ép sát lưới vào tiêu đề */

/* --- SỬA LỖI CHỮ CHÌM VÀO NỀN ĐEN --- */
.section-title { 
    color: #ffffff !important; /* Tiêu đề màu trắng */
    text-shadow: 0 2px 4px rgba(0,0,0,0.6); /* Đổ bóng đen phía sau */
}

.view-more { 
    color: #3b82f6 !important; /* Xanh dương đậm, hiển thị cực rõ trên nền trắng */
    text-shadow: 0 1px 3px rgba(0,0,0,0.4); /* Bóng đen mờ để nổi bật trên nền tối */
    font-weight: 700;
}
.view-more:hover { 
    color: #1d4ed8 !important; /* Đổi màu xanh đen khi di chuột */
}

/* Tranh trí lại nút "Trở về Trang chủ" cho giống nút bấm thật */
#filterTitle { color: #ffffff !important; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
.section-header a[onclick*="closeFilter"] {
    background: rgba(239, 68, 68, 0.2); /* Nền đỏ nhạt mờ mờ */
    color: #fca5a5 !important; /* Chữ đỏ sáng */
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    text-shadow: none;
}
.section-header a[onclick*="closeFilter"]:hover {
    background: #ef4444;
    color: #ffffff !important;
}

/* =========================================
   GIAO DIỆN THANH PHÂN TRANG (PAGINATION)
========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px; /* Khoảng cách giữa các nút */
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Nếu trên điện thoại màn hình nhỏ sẽ tự rớt dòng */
}

.page-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d1d5db; /* Viền xám nhạt */
    background-color: #f3f4f6; /* Nền xám rất nhạt */
    color: #4b5563;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Hiệu ứng khi di chuột qua nút */
.page-btn:hover:not(.disabled):not(.active) {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Nút của trang hiện tại (Màu xanh dương) */
.page-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Nút bị vô hiệu hóa (Ví dụ đang ở trang cuối nên nút "Tiếp" bị mờ) */
.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* =========================================
   SỬA LẠI UI: CHỮ MƯỢT HƠN & NÚT TRANG CHỦ XỊN HƠN
========================================= */

/* Tinh chỉnh lại Tiêu đề (Danh mục: Add-on...) cho gọn và nét hơn */
.section-title, #filterTitle { 
    color: #ffffff !important; 
    text-shadow: 0 1px 4px rgba(0,0,0,0.8) !important; /* Bóng đổ rất nhẹ, không bị lố */
    font-size: 22px; /* Thu nhỏ lại một chút cho thanh thoát */
}

/* Sửa toàn diện nút "Xem thêm >": Nền xanh nhạt, chữ xanh đậm, không bao giờ bị mờ */
.view-more { 
    background: #e0f2fe !important; /* Nền xanh da trời rất nhạt */
    color: #0284c7 !important; /* Chữ xanh biển đậm */
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
    border: 1px solid #bae6fd !important;
    text-shadow: none !important; /* Xóa sạch bóng đổ gây nhòe */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: 0.2s;
}
.view-more:hover { 
    background: #bae6fd !important;
    color: #0369a1 !important;
    transform: translateY(-2px);
}

/* 3. Nút "Trở về Trang chủ": Phong cách Kính mờ (Glassmorphism) bo tròn */
.btn-home-return {
    background: rgba(255, 255, 255, 0.1); /* Nền kính trong suốt nhẹ */
    backdrop-filter: blur(5px); /* Làm mờ nền phía sau */
    -webkit-backdrop-filter: blur(5px);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Viền trắng mờ */
    padding: 6px 16px;
    border-radius: 20px; /* Bo cong 2 đầu */
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.btn-home-return:hover {
    background: rgba(255, 255, 255, 0.25); /* Sáng lên khi di chuột */
    transform: translateY(-2px);
}

/* Sửa lỗi rớt dòng trên Mobile cho phần Tiêu đề và nút Home */
@media (max-width: 768px) {
    #filterResults .section-header {
        display: flex !important;
        flex-wrap: nowrap !important; /* Ép buộc không được rớt dòng */
        align-items: center;
        gap: 5px;
    }
    #filterTitle {
        font-size: 16px !important; /* Chữ nhỏ lại trên điện thoại */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Dài quá tự biến thành dấu ... */
        flex: 1; /* Cho phép chữ co giãn */
    }
    .btn-home-return {
        padding: 6px 10px !important;
        font-size: 12px !important; /* Nút nhỏ lại một xíu */
        white-space: nowrap; /* Cấm rớt dòng chữ trong nút */
    }
}