/* =========================================
   CSS CHO TRANG CATEGORIES (categories.css)
   ========================================= */

/* 1. Bố cục chung */
.categories-page {
    padding-top: 125px; /* Điều chỉnh về 125px */
    min-height: 100vh;
    background-color: var(--bg-primary); /* Đồng bộ với style.min.css */
}

/* Tăng chiều rộng sidebar và loại bỏ thanh cuộn trên desktop */
@media (min-width: 992px) {
    .categories-page .col-lg-2 {
        flex: 0 0 25%; /* Tăng từ 16.67% (2/12) lên 25% (3/12) */
        max-width: 25%;
    }
    .categories-page .col-lg-10 {
        flex: 0 0 75%; /* Giảm từ 83.33% (10/12) xuống 75% (9/12) */
        max-width: 75%;
    }

    /* Đảm bảo KHÔNG CÓ THANH CUỘN trên desktop */
    .categories-sidebar {
        overflow: hidden !important;
        height: auto !important;
    }

    .category-item {
        height: 70px; /* Giảm chiều cao trên desktop */
        min-height: 70px;
    }
}

/* 2. Sidebar Categories (Cột Trái) */
.categories-sidebar {
    height: auto; /* Chiều cao tự động - KHÔNG CÓ THANH CUỘN */
    max-height: calc(100vh - 120px); /* Giới hạn chiều cao để tránh overflow */
    overflow: hidden; /* CẤM THANH CUỘN HOÀN TOÀN */
    padding: 15px;
    margin-top: 20px;
    max-width: 325px; /* Tăng 30% từ 250px lên 325px */
}

/* Tiêu đề Sidebar */
.sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    color: var(--text-heading);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.sidebar-title i {
    color: var(--accent-primary);
}

/* Danh sách Categories */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Giảm khoảng cách trên desktop */
}

/* Từng Mục Category (Item) */
.category-item {
    position: relative;
    height: 75px; /* Giảm chiều cao để tránh thanh cuộn trên desktop */
    width: 100%; /* Full chiều rộng */
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth transition cho tất cả properties */
    background-size: cover;
    background-position: center 20%; /* Điều chỉnh để hiện rõ khuôn mặt nhân vật */
    border: 1px solid var(--border-color);
    margin-bottom: 4px; /* Giảm margin trên desktop */
    display: block; /* Đảm bảo hiển thị như block element */
    min-height: 75px;
    transform: translateX(0); /* Đặt giá trị mặc định */
}

/* Lớp phủ tối trên ảnh */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Giảm tối xuống 30% để hiện rõ nhân vật */
    transition: background 0.3s ease;
    z-index: 1;
}

/* Nội dung (Chữ + Số lượng) */
.category-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    width: 100%;
}

.category-name {
    color: var(--text-heading);
    font-family: 'Orbitron', sans-serif; /* Font chữ game */
    font-weight: 700;
    font-size: 0.9rem; /* Tăng kích thước chữ */
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.category-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Hiệu ứng Hover (Rê chuột) - CHỈ áp dụng khi KHÔNG active */
.category-item:not(.active):hover {
    transform: translateX(5px); /* Di chuyển nhẹ sang phải */
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(155, 44, 136, 0.2);
}

.category-item:not(.active):hover .category-overlay {
    background: rgba(0, 0, 0, 0.15); /* Còn sáng hơn nữa khi hover */
}

/* Trạng thái Active (Đang chọn) - QUAN TRỌNG */
.category-item.active {
    transform: translateX(8px); /* Active có transform riêng, lớn hơn hover */
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(155, 44, 136, 0.4);
}

/* Active hover - Khi hover trên item đang active */
.category-item.active:hover {
    transform: translateX(8px); /* Giữ nguyên vị trí active */
    box-shadow: 0 0 20px rgba(155, 44, 136, 0.5); /* Chỉ tăng shadow */
}

/* Khi active, lớp phủ biến thành màu hồng gradient */
.category-item.active .category-overlay {
    background: linear-gradient(90deg,
        rgba(155, 44, 136, 0.85) 0%, /* Hồng đậm bên trái */
        rgba(155, 44, 136, 0.4) 100% /* Nhạt dần bên phải */
    );
}

.category-item.active .category-badge {
    background-color: var(--text-heading);
    color: var(--accent-primary);
}

/* 3. Main Content (Cột Phải) */
.main-content {
    padding: 40px 30px 30px 30px;
    background-color: var(--bg-primary);
}

.content-header {
    margin-bottom: 30px;
    text-align: center; /* Căn giữa tiêu đề lớn */
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(155, 44, 136, 0.5);
}

.page-subtitle {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Placeholder khi chưa có game */
.placeholder-content {
    text-align: center;
    color: var(--text-secondary);
    padding: 50px;
}

.placeholder-content h3 {
    color: var(--text-heading);
    margin-top: 10px;
}

/* Games Grid Container */
.games-container {
    width: 100%;
}

/* Game grid sử dụng CSS mặc định từ game-card.css */

/* Mobile responsive đã được xử lý trong mobile-optimizations.css */

/* Animation cho game cards */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive cho Mobile */
@media (max-width: 991px) {
    /* Giảm padding-top trên mobile để title gần header hơn */
    .categories-page {
        padding-top: 85px !important; /* Giảm từ 125px xuống 85px trên mobile */
    }

    .categories-sidebar {
        display: block !important; /* Hiện lại sidebar */
        height: auto; /* Chiều cao tự động */
        border-right: none;
        border-top: 1px solid #333; /* Kẻ ngang ngăn cách */
        margin-top: 40px;
        padding-top: 30px;
        max-width: 100%; /* Full chiều rộng */
    }

    /* Giữ danh sách category như cột dọc trên mobile */
    .categories-list {
        display: flex;
        flex-direction: column;
        gap: 0; /* Loại bỏ hoàn toàn khoảng cách trên mobile */
    }

    /* Tăng cường kích thước cho mobile */
    .category-item {
        height: 70px; /* Tăng chiều cao trên mobile */
        min-height: 70px;
        width: 100%;
        margin-bottom: 0; /* Bỏ margin-bottom trên mobile để dính liền */
    }

    /* Tăng kích thước chữ trên mobile */
    .category-name {
        font-size: 0.95rem;
        font-weight: 800;
    }

    .category-badge {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 20px;
    }

    .page-title {
        font-size: 1.8rem;
    }
}