/* style.css - Phiên bản chuẩn cho MangaFlow */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

/* Cấu hình chung */
body {
    background-color: #0f172a;
    color: #e2e8f0;
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden; /* Chặn cuộn ngang gây vỡ giao diện */
    -webkit-tap-highlight-color: transparent; /* Bỏ highlight xanh khi bấm trên mobile */
}

/* --- THANH CUỘN (SCROLLBAR) --- */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #475569 #0f172a;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0f172a; 
}
::-webkit-scrollbar-thumb {
    background: #334155; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ef4444; /* Màu đỏ thương hiệu (Tailwind red-500) */
}

/* --- HIỆU ỨNG ANIMATION --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}
.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

/* --- THẺ TRUYỆN (CARD) --- */
.manga-card {
    transition: all 0.3s ease;
}
/* Hiệu ứng hover chỉ chạy trên máy tính (có chuột) */
@media (hover: hover) {
    .manga-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px -10px rgba(239, 68, 68, 0.3); /* Bóng đỏ nhẹ */
    }
    .manga-card img {
        transition: transform 0.5s ease;
    }
    .manga-card:hover img {
        transform: scale(1.1);
    }
}

/* --- GIAO DIỆN ĐỌC TRUYỆN (READER UI) --- */
/* Ẩn hiện thanh công cụ khi đọc */
.reader-ui {
    transition: transform 0.3s ease-in-out;
}

/* Class này được script.js thêm vào body khi chạm màn hình */
.ui-hidden .top-bar {
    transform: translateY(-100%);
}
.ui-hidden .bottom-bar {
    transform: translateY(100%);
}

/* Thanh tiến trình đọc (trên cùng) */
#progress-container {
    width: 100%;
    height: 3px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    background: rgba(255,255,255,0.1);
}
#progress-bar {
    height: 100%;
    background: #ef4444;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #ef4444;
}

/* Loader xoay vòng */
.loader {
    border: 4px solid #334155;
    border-top: 4px solid #ef4444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* --- CÁC NÚT BẤM (BUTTONS) --- */
.cat-btn.active {
    background-color: #ef4444;
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.filter-btn.active {
    background-color: #ef4444;
    color: white;
}