/*
Theme Name: MangaVerse
Theme URI: https://github.com/mangaverse
Author: MangaVerse Team
Description: Theme WordPress chuyên dụng cho trang đọc truyện tranh với hệ thống quản lý chapter, custom post types, và giao diện tối tối ưu.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: mangaverse
*/

/* ============================================================
   MANGAVERSE - MAIN STYLES
   Dark manga reader theme with full chapter management
   ============================================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-primary: #0d0d12;
  --bg-secondary: #13131c;
  --bg-card: #1a1a28;
  --bg-card-hover: #22223a;
  --accent: #e63946;
  --accent-dim: #c1121f;
  --accent-glow: rgba(230,57,70,0.25);
  --gold: #ffd60a;
  --text-primary: #f0f0f5;
  --text-secondary: #9494b0;
  --text-muted: #5a5a78;
  --border: rgba(255,255,255,0.06);
  --radius: 8px; --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font-display: 'Bebas Neue', 'Oswald', sans-serif;
  --font-body: 'DM Sans', 'Nunito', sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}
html { scroll-behavior: smooth; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-body); font-size: 15px; line-height: 1.6; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); letter-spacing: 0.04em; line-height: 1.15; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: var(--bg-secondary); } ::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&family=Oswald:wght@400;600;700&display=swap');

/* === LAYOUT === */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.wrapper { display: flex; gap: 28px; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* === READING PROGRESS === */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 9999; width: 0%; transition: width 0.1s linear; }

/* === HEADER === */
#site-header { background: rgba(13,13,18,0.96); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 62px; max-width: 1280px; margin: 0 auto; }
.site-logo { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.08em; flex-shrink: 0; }
.site-logo span { color: var(--accent); }
.site-logo img { height: 36px; width: auto; }

/* Search */
.search-bar { position: relative; flex: 0 0 240px; }
.search-bar input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary); padding: 8px 36px 8px 14px; border-radius: 20px; font-size: 13px; outline: none; transition: all var(--transition); font-family: var(--font-body); }
.search-bar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-bar input::placeholder { color: var(--text-muted); }
#manga-search-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }
#manga-search-btn:hover { color: var(--accent); }
.search-autocomplete { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); z-index: 999; overflow: hidden; box-shadow: var(--shadow); }
.search-ac-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; transition: background var(--transition); }
.search-ac-item:hover { background: var(--bg-card-hover); }
.search-ac-thumb { width: 36px; height: 48px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.search-ac-title { font-size: 13px; font-weight: 600; }
.search-ac-chapter { font-size: 11px; color: var(--text-muted); }

/* Main Nav */
.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: 2px; justify-content: center; }
.main-nav a { padding: 6px 14px; border-radius: var(--radius); color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.main-nav .menu-item-has-children { position: relative; }
.main-nav .sub-menu { position: absolute; top: calc(100% + 8px); left: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); min-width: 200px; display: none; z-index: 999; box-shadow: var(--shadow); }
.main-nav .menu-item-has-children:hover .sub-menu { display: block; }
.main-nav .sub-menu a { display: block; padding: 10px 16px; font-size: 13px; }
.main-nav .sub-menu a:hover { background: var(--bg-card-hover); color: var(--accent); }
.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 8px; font-size: 18px; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); font-family: var(--font-body); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-secondary { background: rgba(255,255,255,0.07); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* === HERO SLIDER === */
.featured-slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 40px; background: var(--bg-secondary); }
.featured-slider .slide { display: none; }
.featured-slider .slide.active { display: block; }
.slide-inner { position: relative; aspect-ratio: 21/9; }
.slide-inner img { width: 100%; height: 100%; object-fit: cover; }
.slide-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,13,18,0.92) 0%, rgba(13,13,18,0.5) 55%, transparent 100%); display: flex; align-items: flex-end; padding: 40px; }
.slide-info { max-width: 480px; }
.slide-genre { display: inline-block; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 10px; border-radius: 3px; margin-bottom: 12px; }
.slide-title { font-size: 46px; margin-bottom: 10px; text-shadow: 0 2px 20px rgba(0,0,0,0.6); }
.slide-desc { color: rgba(240,240,245,0.75); font-size: 14px; margin-bottom: 20px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-actions { display: flex; gap: 10px; }
.slider-dots { position: absolute; bottom: 18px; right: 20px; display: flex; gap: 6px; }
.slider-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.25); cursor: pointer; transition: all var(--transition); border: none; }
.slider-dot.active { width: 24px; border-radius: 4px; background: var(--accent); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); border: 1px solid var(--border); color: var(--text-primary); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); z-index: 10; }
.slider-arrow:hover { background: var(--accent); border-color: var(--accent); }
.slider-arrow.prev { left: 14px; } .slider-arrow.next { right: 14px; }

/* === SECTION HEADING === */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; display: block; }
.view-all { color: var(--accent); font-size: 13px; font-weight: 500; }
.view-all:hover { color: var(--text-primary); }

/* === MANGA CARD GRID === */
.manga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 18px; margin-bottom: 40px; }
.manga-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.manga-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: all var(--transition); }
.manga-card:hover { transform: translateY(-4px); background: var(--bg-card-hover); border-color: rgba(230,57,70,0.3); box-shadow: 0 10px 36px rgba(0,0,0,0.5); }
.manga-card-thumb { position: relative; aspect-ratio: 2/3; overflow: hidden; background: var(--bg-secondary); }
.manga-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.manga-card:hover .manga-card-thumb img { transform: scale(1.07); }
.manga-card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%); opacity: 0; transition: opacity var(--transition); display: flex; align-items: flex-end; padding: 10px; }
.manga-card:hover .manga-card-overlay { opacity: 1; }
.manga-card-overlay-btn { background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 4px; width: 100%; text-align: center; }
.manga-badge { position: absolute; top: 7px; left: 7px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; }
.badge-new { background: var(--gold); color: #000; }
.badge-hot { background: var(--accent); color: #fff; }
.badge-ongoing { background: #1a8f2e; color: #fff; }
.badge-completed { background: #1a5fa8; color: #fff; }
.manga-rating-badge { position: absolute; bottom: 7px; right: 7px; background: rgba(0,0,0,0.72); backdrop-filter: blur(4px); color: var(--gold); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; display: flex; align-items: center; gap: 3px; }
.manga-card-body { padding: 10px 12px; }
.manga-card-title { font-family: var(--font-body); font-weight: 700; font-size: 13px; line-height: 1.4; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.manga-card-title:hover { color: var(--accent); }
.manga-card-chapter { font-size: 12px; color: var(--accent); font-weight: 600; }
.manga-card-date { font-size: 11px; color: var(--text-muted); }

/* === LATEST UPDATES === */
.updates-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 40px; }
.update-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-card); border: 1px solid transparent; border-radius: 6px; transition: all var(--transition); }
.update-item:hover { border-color: var(--border); background: var(--bg-card-hover); }
.update-thumb { width: 42px; height: 56px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.update-title-wrap { flex: 1; min-width: 0; }
.update-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; display: block; }
.update-title:hover { color: var(--accent); }
.update-chapters { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-link { font-size: 11px; font-weight: 600; background: rgba(230,57,70,0.1); color: var(--accent); border: 1px solid rgba(230,57,70,0.2); padding: 2px 8px; border-radius: 3px; transition: all var(--transition); }
.ch-link:hover { background: var(--accent); color: #fff; }
.update-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; min-width: 68px; text-align: right; }

/* === TABS === */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; gap: 0; }
.tab-btn { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 14px; font-weight: 600; padding: 10px 20px; cursor: pointer; margin-bottom: -1px; transition: all var(--transition); font-family: var(--font-body); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text-secondary); }
.tab-content { display: none; } .tab-content.active { display: block; }

/* === SINGLE MANGA PAGE === */
.manga-page { padding: 24px 0; }
.manga-hero { display: flex; gap: 32px; background: var(--bg-secondary); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 30px; margin-bottom: 28px; }
.manga-cover-wrap { width: 220px; flex-shrink: 0; }
.manga-cover-wrap img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.manga-cover-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.manga-details { flex: 1; }
.manga-main-title { font-size: 38px; margin-bottom: 4px; }
.manga-alt-name { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.manga-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.genre-tag { font-size: 12px; color: var(--text-secondary); border: 1px solid var(--border); background: var(--bg-card); padding: 3px 12px; border-radius: 20px; transition: all var(--transition); }
.genre-tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.manga-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin-bottom: 18px; font-size: 13px; }
.manga-kv dt { color: var(--text-muted); }
.manga-kv dd { color: var(--text-primary); font-weight: 500; }
.manga-kv a { color: var(--accent); }
.manga-stats-row { display: flex; gap: 28px; margin-bottom: 18px; }
.manga-stat { text-align: center; }
.manga-stat-val { font-family: var(--font-display); font-size: 26px; color: var(--accent); }
.manga-stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.manga-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.75; border-top: 1px solid var(--border); padding-top: 18px; }
.manga-desc p { margin-bottom: 10px; }
.manga-cta { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* === CHAPTER LIST === */
.chapter-panel { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 28px; }
.chapter-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.chapter-panel-title { font-size: 18px; }
.chapter-panel-actions { display: flex; gap: 6px; align-items: center; }
.ch-sort-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; padding: 4px 12px; border-radius: 4px; cursor: pointer; transition: all var(--transition); }
.ch-sort-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chapter-search-input { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); padding: 5px 12px; border-radius: 4px; font-size: 12px; outline: none; width: 140px; font-family: var(--font-body); }
.chapter-search-input:focus { border-color: var(--accent); }
.chapter-ul { max-height: 520px; overflow-y: auto; }
.chapter-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 22px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.chapter-row:last-child { border-bottom: none; }
.chapter-row:hover { background: rgba(255,255,255,0.025); }
.chapter-row.read { opacity: 0.45; }
.chapter-row-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.chapter-num { font-family: var(--font-display); font-size: 13px; color: var(--accent); min-width: 80px; }
.chapter-row-title { font-size: 13px; color: var(--text-secondary); }
.chapter-row-link:hover .chapter-row-title, .chapter-row-link:hover .chapter-num { color: var(--accent); }
.chapter-row-right { display: flex; align-items: center; gap: 14px; }
.chapter-row-date { font-size: 11px; color: var(--text-muted); }
.chapter-row-views { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.read-pill { font-size: 10px; background: rgba(26,143,46,0.15); color: #1a8f2e; border: 1px solid rgba(26,143,46,0.25); padding: 1px 7px; border-radius: 3px; }

/* === READER === */
.reader-body { background: #0a0a0a; }
.reader-header { background: rgba(10,10,10,0.97); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.reader-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 50px; max-width: 100%; gap: 12px; }
.reader-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.reader-controls { display: flex; align-items: center; gap: 8px; }
.btn-nav { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); padding: 6px 14px; border-radius: var(--radius); font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn-nav:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.btn-nav[disabled] { opacity: 0.3; cursor: not-allowed; }
#chapter-jump { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); padding: 6px 10px; border-radius: var(--radius); font-size: 12px; cursor: pointer; max-width: 200px; }
.reader-settings-toggle { background: none; border: 1px solid var(--border); color: var(--text-secondary); width: 34px; height: 34px; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); }
.reader-settings-toggle:hover { border-color: var(--accent); color: var(--accent); }
.reader-settings-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: absolute; right: 20px; top: 58px; z-index: 200; min-width: 200px; display: none; box-shadow: var(--shadow); }
.reader-settings-panel.open { display: block; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13px; }
.settings-label { color: var(--text-secondary); }
.settings-val { display: flex; gap: 4px; }
.sv-btn { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; padding: 3px 10px; border-radius: 3px; cursor: pointer; }
.sv-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.reader-pages { max-width: 900px; margin: 0 auto; padding: 16px 16px 40px; }
.reader-page-img { display: block; width: 100%; margin-bottom: 3px; }
.reader-page-img.wide-mode { max-width: 100vw; }
.reader-progress-wrap { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(10,10,10,0.95); border-top: 1px solid var(--border); padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-secondary); z-index: 50; }
.reader-progress-bar { flex: 1; max-width: 200px; height: 4px; background: var(--bg-secondary); border-radius: 2px; overflow: hidden; margin: 0 14px; }
.reader-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; }
.no-images-msg { text-align: center; padding: 80px 20px; color: var(--text-muted); font-size: 15px; }

/* === SIDEBAR === */
.sidebar-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.sidebar-widget-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.015); }
.sidebar-widget-title i { color: var(--accent); }
.sidebar-widget-body { padding: 14px 16px; }
.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-n { font-family: var(--font-display); font-size: 20px; min-width: 22px; color: var(--text-muted); }
.rank-n.gold { color: #ffd60a; } .rank-n.silver { color: #b0b0b0; } .rank-n.bronze { color: #cd7f32; }
.rank-thumb { width: 38px; height: 52px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.rank-info { flex: 1; min-width: 0; }
.rank-title { font-size: 12px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-title:hover { color: var(--accent); }
.rank-sub { font-size: 11px; color: var(--text-muted); }
.genre-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.genre-pill { font-size: 12px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); padding: 4px 12px; border-radius: 16px; transition: all var(--transition); }
.genre-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* === BREADCRUMB === */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--accent); }
.bc-sep { font-size: 10px; }

/* === PAGINATION === */
.pagination { display: flex; justify-content: center; gap: 5px; margin: 36px 0; flex-wrap: wrap; }
.pn { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-weight: 500; transition: all var(--transition); }
.pn:hover, .pn.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* === ARCHIVE / CATEGORY PAGE === */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; align-items: center; }
.filter-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px; }
.filter-select { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); padding: 6px 10px; border-radius: var(--radius); font-size: 13px; cursor: pointer; }
.sort-links { display: flex; gap: 4px; margin-left: auto; }
.sort-link { font-size: 12px; padding: 5px 12px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); transition: all var(--transition); }
.sort-link.active, .sort-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* === COMMENTS === */
.comments-section { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-top: 28px; }
.comments-title { font-size: 20px; margin-bottom: 20px; }
.comment-form-area textarea { width: 100%; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); border-radius: var(--radius); padding: 12px; font-size: 13px; min-height: 80px; outline: none; resize: vertical; transition: border-color var(--transition); font-family: var(--font-body); }
.comment-form-area textarea:focus { border-color: var(--accent); }
.comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: var(--bg-card); }
.comment-content { flex: 1; }
.comment-author { font-size: 13px; font-weight: 700; }
.comment-date { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.comment-text { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* === FOOTER === */
#site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 48px 0 36px; max-width: 1280px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.footer-about p { font-size: 13px; color: var(--text-secondary); margin-top: 10px; line-height: 1.7; }
.footer-widget h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }
.footer-widget ul { display: flex; flex-direction: column; gap: 8px; }
.footer-widget a { font-size: 13px; color: var(--text-secondary); }
.footer-widget a:hover { color: var(--text-primary); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 16px 20px; font-size: 12px; color: var(--text-muted); }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.social-icon { width: 34px; height: 34px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 14px; transition: all var(--transition); }
.social-icon:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* === ADMIN BAR OVERRIDE === */
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* === NOTIFICATIONS === */
.toast-wrap { position: fixed; top: 78px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: var(--radius); font-size: 13px; max-width: 290px; box-shadow: var(--shadow); animation: toastIn 0.3s ease; }
.toast.success { border-left-color: #1a8f2e; }
.toast.error { border-left-color: var(--accent); }
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === SHIMMER LOADING === */
.shimmer { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* === BACK TO TOP === */
#back-top { position: fixed; bottom: 28px; right: 28px; background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; pointer-events: none; transition: all var(--transition); border: none; font-size: 16px; z-index: 500; box-shadow: 0 4px 14px var(--accent-glow); }
#back-top.visible { opacity: 1; pointer-events: all; }
#back-top:hover { transform: translateY(-3px); }

/* === RESPONSIVE === */
@media (max-width: 1100px) { .manga-grid.cols-6 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .wrapper { flex-direction: column; } .sidebar { width: 100%; } .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .main-nav, .search-bar { display: none; }
  .menu-toggle { display: flex; }
  .manga-hero { flex-direction: column; }
  .manga-cover-wrap { width: 100%; max-width: 220px; }
  .slide-inner { aspect-ratio: 4/3; }
  .slide-title { font-size: 26px; }
  .slide-overlay { padding: 20px; }
  .manga-grid { grid-template-columns: repeat(3, 1fr); }
  .manga-grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .manga-kv { grid-template-columns: 1fr; }
  .reader-title { max-width: 160px; }
}
@media (max-width: 480px) {
  .manga-grid { grid-template-columns: repeat(2, 1fr); }
  .manga-stats-row { flex-wrap: wrap; gap: 14px; }
  .reader-nav { gap: 6px; }
}

/* ============================================================
   CẬP NHẬT: 3 CHAPTER / CARD + VIEWS FORMAT + TOP TABS + FOLLOWING
   ============================================================ */

/* === MANGA CARD — 3 chapter rows === */
.manga-card-foot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 7px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  font-size: 11px;
  font-weight: 700;
}
.mc-rating { color: var(--gold); }
.mc-views  { color: rgba(255,255,255,0.85); }

.manga-card-chapters {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}
.mc-chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.4;
}
.mc-ch-link {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.mc-ch-link:hover { color: var(--text-primary); }
.mc-ch-time {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  margin-left: 4px;
}

/* Card title now has <a> inside */
.manga-card-title a { color: inherit; }
.manga-card-title a:hover { color: var(--accent); }

/* === MANGA LIST ITEM — 3 chapters + views === */
.manga-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.manga-list-item:last-child { border-bottom: none; }
.manga-list-thumb img {
  width: 70px; height: 95px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.manga-list-info { flex: 1; min-width: 0; }
.manga-list-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.manga-list-title a:hover { color: var(--accent); }
.manga-list-chapters { display: flex; flex-direction: column; gap: 3px; }
.manga-list-chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.ml-ch-link { color: var(--accent); font-weight: 600; }
.ml-ch-link:hover { color: var(--text-primary); }
.ml-ch-time { color: var(--text-muted); font-size: 11px; }
.manga-list-views {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: center;
  min-width: 52px;
  text-align: right;
}

/* === TOP WIDGET TABS (Tháng / Tuần / Ngày) === */
.top-widget-tabs { }
.top-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.top-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 4px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
  font-family: var(--font-body);
  text-align: center;
}
.top-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.top-tab-btn:hover:not(.active) { color: var(--text-secondary); }

.top-tab-pane { display: none; padding: 12px 14px; }
.top-tab-pane.active { display: block; }

.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-num {
  font-family: var(--font-display);
  font-size: 17px;
  min-width: 24px;
  color: var(--text-muted);
  text-align: center;
}
.rank-num.gold   { color: #ffd60a; text-shadow: 0 0 8px rgba(255,214,10,0.4); }
.rank-num.silver { color: #c0c0c0; }
.rank-num.bronze { color: #cd7f32; }
.rank-thumb img {
  width: 44px; height: 60px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.rank-info { flex: 1; min-width: 0; }
.rank-title {
  font-size: 12px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  color: var(--text-primary);
}
.rank-title:hover { color: var(--accent); }
.rank-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.rank-views { color: var(--text-muted); }

/* === FOLLOWING WIDGET === */
.following-list { display: flex; flex-direction: column; gap: 10px; }
.following-item { display: flex; align-items: center; gap: 10px; }
.following-thumb img {
  width: 48px; height: 65px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.following-info { flex: 1; min-width: 0; }
.following-title {
  font-size: 13px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.following-title:hover { color: var(--accent); }
.following-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.fw-ch-new {
  color: var(--accent);
  font-weight: 600;
}
.fw-ch-new:hover { color: var(--text-primary); }
.fw-ch-read { color: var(--text-muted); }

.following-view-all {
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.following-view-all:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.following-login-prompt {
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .mc-ch-link { max-width: 80px; }
  .manga-list-views { display: none; }
}
