:root {
    --primary-color: #ff4500;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}


.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo span { color: white; }

.search-box {
    display: flex;
    background: #222;
    border-radius: 20px;
    padding: 5px 15px;
}

.search-box input {
    background: none;
    border: none;
    color: white;
    padding: 5px;
    outline: none;
}

/* Hero Section */
.hero {
    height: 400px;
    background: linear-gradient(to right, rgba(0,0,0,0.8), transparent), 
                url('https://via.placeholder.com/1200x400');
    background-size: cover;
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.btn-read {
    background: var(--primary-color);
    border: none;
    padding: 10px 25px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
}

/* Manga Grid */
.container { padding: 2rem 5%; }

.section-title { margin-bottom: 1.5rem; border-left: 4px solid var(--primary-color); padding-left: 10px; }

.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.manga-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.manga-card:hover { transform: translateY(-5px); }

.card-img { position: relative; height: 250px; }

.card-img img { width: 100%; height: 100%; object-fit: cover; }

.chapter-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--primary-color);
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.card-info { padding: 10px; }

.card-info h3 { font-size: 1rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-info p { font-size: 0.8rem; color: #888; }

/* Layout 2 cột */
.main-layout {
    display: flex;
    gap: 30px;
}

.content-left { flex: 3; }
.sidebar { flex: 1; }

/* Filter Tags */
.filter-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tag {
    background: #222;
    border: 1px solid #333;
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
}

.tag.active, .tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Ranking Sidebar */
.ranking-list {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.rank-number {
    font-size: 1.2rem;
    font-weight: bold;
    width: 30px;
}

.rank-1 { color: #ffd700; } /* Vàng */
.rank-2 { color: #c0c0c0; } /* Bạc */
.rank-3 { color: #cd7f32; } /* Đồng */

.rank-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.rank-info small { color: #888; }

/* Nút Xem thêm */
.btn-load-more {
    width: 100%;
    margin-top: 30px;
    padding: 12px;
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-load-more:hover {
    background: var(--primary-color);
    color: white;
}

/* Dark/Light Mode Helper */
body.light-mode {
    --bg-color: #ffffff;
    --card-bg: #f0f0f0;
    --text-color: #333333;
}

/* Responsive cho điện thoại */
@media (max-width: 768px) {
    .main-layout { flex-direction: column; }
    .sidebar { order: 2; }
    .content-left { order: 1; }
}

.auth-box {
    width: 350px;
    margin: 80px auto;
    padding: 25px;
    background: #1e1e1e;
    border-radius: 10px;
    text-align: center;
}

.auth-box input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
}

.auth-box button {
    width: 100%;
    padding: 10px;
    background: #ff4d4d;
    border: none;
    color: #fff;
    cursor: pointer;
}

.error { color: #ff6b6b; }
.success { color: #4caf50; }

.manga-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero {
    position: relative;
    height: 420px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0,0,0,0.75) 0%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0.1) 100%
    );
        pointer-events: none;

}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    padding: 60px;
    color: #fff;
}

.hero-content h1 {
    font-size: 48px;
    margin: 12px 0;
}

.hero-content p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
}

.badge {
    display: inline-block;
    background: #e74c3c;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hero-actions {
    margin-top: 24px;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f39c12;
    color: #000;
    padding: 12px 22px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.btn-read:hover {
    background: #ffb84d;
    transform: translateY(-2px);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== BOX CHUNG ===== */
.ranking-box,
.history-box {
    background: #ff7949;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* ===== TIÊU ĐỀ ===== */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #fff;
    border-left: 4px solid #ff4757;
    padding-left: 10px;
}

/* ===== RANKING LIST ===== */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.25s;
}

.rank-item:hover {
    background: #ff4500;
}

/* ===== SỐ THỨ HẠNG ===== */
.rank-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4500;
}

/* Top 3 màu nổi bật */
.rank-1 { background: #f1c40f; }
.rank-2 { background: #95a5a6; }
.rank-3 { background: #cd7f32; }

/* Các hạng còn lại */
.rank-number:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: #ddd;
    color: #333;
}

/* ===== INFO ===== */
.rank-info h4 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.rank-info h4 a {
    color: #fff;
    text-decoration: none;
}

.rank-info h4 a:hover {
    color: #ff4757;
}

.rank-info small {
    font-size: 0.8rem;
    color: #777;
}

/* ===== HISTORY ===== */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.history-list li:last-child {
    border-bottom: none;
}

.history-list a {
    font-size: 0.95rem;
    color: #fff;
    text-decoration: none;
}

.history-list a:hover {
    color: #ff4757;
}

/* Trang chi tiết */
.detail-page {
    max-width: 1200px;   /* 👈 rộng đẹp desktop */
    margin: 0 auto;
    padding: 24px;
}
.manga-info-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 36px;
    align-items: start;
}
.manga-cover img { width: 250px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.manga-info-text h1 { margin-bottom: 15px; color: var(--primary-color); }
.tag { background: #333; padding: 5px 12px; border-radius: 15px; font-size: 0.8rem; margin-right: 5px; }
.action-buttons { margin-top: 20px; display: flex; gap: 10px; }
.btn { padding: 10px 25px; border-radius: 5px; cursor: pointer; text-decoration: none; font-weight: bold; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-outline { border: 1px solid #555; color: white; }

/* Chapter list */
.chapters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.chapter-item { background: #1e1e1e; padding: 12px; display: flex; justify-content: space-between; text-decoration: none; color: #ccc; border-radius: 5px; }
.chapter-item:hover { background: #222; border-left: 3px solid var(--primary-color); }

/* Trang đọc truyện */
.reading-control { 
    position: sticky; top: 0; background: #000; padding: 10px; 
    display: flex; flex-direction: column; align-items: center; z-index: 1000;
}
.control-main { display: flex; align-items: center; gap: 15px; margin-top: 10px; }
.chap-select { background: #222; color: white; border: 1px solid #444; padding: 5px 15px; border-radius: 5px; }
.manga-pages { display: flex; flex-direction: column; align-items: center; background: #000; }
.manga-pages img { max-width: 100%; height: auto; display: block; margin-bottom: 2px; }

/* Bình luận */
.comment-input textarea { width: 100%; height: 80px; background: #1a1a1a; color: white; padding: 10px; border: 1px solid #333; margin-top: 15px; }
.btn-submit { background: var(--primary-color); color: white; border: none; padding: 8px 20px; margin-top: 10px; cursor: pointer; }

/* ===== FOOTER ===== */
.site-footer {
    background: #0d0d0d;
    color: #ccc;
    margin-top: 40px;
    border-top: 1px solid #222;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.footer-col h3,
.footer-col h4 {
    color: #fff;
    margin-bottom: 12px;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #aaa;
    font-size: 14px;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    color: #ff6b81;
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: #1a1a1a;
    border-radius: 50%;
    margin-right: 8px;
    color: #fff;
    transition: 0.3s;
}

.social-links a:hover {
    background: #ff6b81;
}

.footer-bottom {
    text-align: center;
    padding: 15px;
    background: #080808;
    font-size: 13px;
    color: #777;
}

header {
    position: relative;
    z-index: 5000;
}

.navbar {
    z-index: 5000;
}

.hero {
    position: relative;
    z-index: 1;
}
.navbar {
    position: relative; /* BẮT BUỘC */
    z-index: 99999;
}
