/* ===== VARIABLES ===== */
:root {
  --bg: #0d0d12;
  --bg2: #13131c;
  --bg3: #1a1a28;
  --card: #1e1e2e;
  --card-hover: #252538;
  --red: #e63946;
  --red-dark: #c1121f;
  --orange: #f4a261;
  --text: #f0f0f0;
  --text2: #9ca3af;
  --text3: #6b7280;
  --border: #2d2d44;
  --header-h: 62px;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-red: 0 4px 24px rgba(230,57,70,0.35);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.header-inner {
  max-width: 1300px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px; background: var(--red);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #fff;
}
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.logo-accent { color: var(--red); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.nav-links a {
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: var(--text2);
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg3); }

.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: var(--shadow); z-index: 300;
  padding: 8px 0;
  column-count: 2; column-gap: 0;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 8px 16px;
  font-size: 13px; color: var(--text2);
  break-inside: avoid;
}
.dropdown-menu a:hover { color: var(--red); background: var(--bg3); }

.header-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.search-form {
  display: flex; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 24px; overflow: hidden;
  transition: border-color 0.2s;
}
.search-form:focus-within { border-color: var(--red); }
.search-input {
  background: none; border: none; outline: none;
  padding: 7px 14px; font-size: 13px; color: var(--text);
  width: 200px;
}
.search-input::placeholder { color: var(--text3); }
.search-btn {
  padding: 7px 14px; background: var(--red); color: #fff;
  font-size: 13px; transition: background 0.2s;
}
.search-btn:hover { background: var(--red-dark); }

.admin-link {
  padding: 7px 14px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 24px;
  font-size: 13px; font-weight: 500; color: var(--orange);
  transition: all 0.2s; white-space: nowrap;
}
.admin-link:hover { border-color: var(--orange); background: rgba(244,162,97,0.1); }

.admin-badge {
  padding: 6px 12px; background: rgba(230,57,70,0.15);
  border: 1px solid rgba(230,57,70,0.3); border-radius: 24px;
  font-size: 13px; font-weight: 500; color: var(--red);
  display: flex; align-items: center; gap: 6px;
}
.logout-btn {
  padding: 6px 14px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 24px;
  font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s; white-space: nowrap;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); background: rgba(230,57,70,0.1); }

.hamburger { display: none; padding: 6px; font-size: 18px; color: var(--text2); }

/* ===== HERO SECTION ===== */
.hero {
  max-width: 1300px; margin: 24px auto; padding: 0 20px;
  min-height: 280px; position: relative;
}
.hero-slider { display: flex; overflow: hidden; transition: transform 0.4s ease; }
.hero-slide {
  flex-shrink: 0; width: 100%;
  border-radius: 12px; overflow: hidden;
  background: var(--card);
  display: flex; min-height: 280px;
  position: relative;
}
.hero-slide-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(30px) brightness(0.3);
  transform: scale(1.1);
}
.hero-slide-inner {
  position: relative; z-index: 1;
  display: flex; gap: 24px; padding: 24px;
  width: 100%; align-items: center;
}
.hero-cover {
  width: 160px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.hero-info { flex: 1; }
.hero-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-genre-tag {
  padding: 2px 10px; border-radius: 12px;
  background: rgba(230,57,70,0.2); border: 1px solid rgba(230,57,70,0.4);
  font-size: 11px; color: var(--red);
}
.hero-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; line-height: 1.2; }
.hero-meta { font-size: 13px; color: var(--text2); margin-bottom: 10px; }
.hero-desc {
  font-size: 14px; color: var(--text2); margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; }
.btn-read {
  padding: 10px 24px; background: var(--red);
  border-radius: 24px; color: #fff; font-weight: 600;
  font-size: 14px; transition: all 0.2s;
  display: flex; align-items: center; gap: 8px;
}
.btn-read:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: var(--shadow-red); }
.btn-details {
  padding: 10px 24px; background: rgba(255,255,255,0.1);
  border-radius: 24px; color: var(--text); font-weight: 600;
  font-size: 14px; transition: all 0.2s; border: 1px solid var(--border);
}
.btn-details:hover { background: rgba(255,255,255,0.15); }

.hero-dots {
  display: flex; gap: 8px; justify-content: center; margin-top: 16px;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); cursor: pointer; transition: all 0.2s;
}
.hero-dot.active { background: var(--red); width: 24px; border-radius: 4px; }

.hero-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text3); font-size: 16px;
  min-height: 200px;
}
.hero-empty i { font-size: 48px; }

/* ===== SECTIONS ===== */
.section {
  max-width: 1300px; margin: 0 auto 40px;
  padding: 0 20px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.accent-bar {
  display: inline-block; width: 4px; height: 22px;
  background: var(--red); border-radius: 2px;
}
.see-all {
  font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  transition: all 0.2s;
}
.see-all:hover { color: var(--red); background: var(--bg3); }

/* ===== COMIC CARD ===== */
.comic-card {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
  display: block; position: relative;
}
.comic-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
.comic-card-cover {
  aspect-ratio: 2/3; overflow: hidden; background: var(--bg3);
  position: relative;
}
.comic-card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.comic-card:hover .comic-card-cover img { transform: scale(1.05); }
.comic-card-cover .no-cover {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text3); font-size: 12px;
}
.comic-card-cover .no-cover i { font-size: 32px; }
.comic-status-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.status-ongoing { background: rgba(34,197,94,0.85); color: #fff; }
.status-completed { background: rgba(99,102,241,0.85); color: #fff; }
.status-hiatus { background: rgba(234,179,8,0.85); color: #000; }
.comic-chapters-badge {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
  background: rgba(0,0,0,0.75); color: var(--text2);
}
.comic-card-info { padding: 10px 12px 12px; }
.comic-card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px; line-height: 1.4;
}
.comic-card-meta { font-size: 11px; color: var(--text3); }

/* ===== HORIZONTAL ROW ===== */
.comics-row {
  display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.comics-row::-webkit-scrollbar { height: 4px; }
.comics-row .comic-card { flex: 0 0 160px; scroll-snap-align: start; }

/* ===== GRID ===== */
.comics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

/* ===== LOADING ===== */
.row-loading {
  width: 100%; display: flex; justify-content: center; align-items: center;
  padding: 40px; color: var(--text3); font-size: 24px;
}

/* ===== GENRES SECTION ===== */
.genres-section { background: var(--bg2); border-radius: 12px; padding: 24px 24px !important; }
.genre-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.genre-tag-btn {
  padding: 8px 18px; border-radius: 20px;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 13px; color: var(--text2);
  transition: all 0.2s; cursor: pointer;
}
.genre-tag-btn:hover { background: rgba(230,57,70,0.15); border-color: var(--red); color: var(--red); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  margin-top: 60px; padding: 40px 20px;
}
.footer-inner {
  max-width: 1300px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.footer-text { font-size: 13px; color: var(--text3); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text2); }
.footer-links a:hover { color: var(--red); }

/* ===== BROWSE PAGE ===== */
.browse-page {
  max-width: 1300px; margin: 0 auto; padding: 30px 20px;
}
.browse-header { margin-bottom: 24px; }
.browse-header h1 { font-size: 26px; font-weight: 700; }
.browse-count { font-size: 14px; color: var(--text3); margin-top: 4px; }

.filters-bar {
  display: flex; gap: 16px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 24px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 12px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  font-size: 13px; color: var(--text); cursor: pointer;
  min-width: 150px;
}
.filter-select:focus { outline: none; border-color: var(--red); }

.load-more-area { display: flex; flex-direction: column; align-items: center; margin-top: 32px; gap: 16px; }
.load-more-btn {
  padding: 12px 32px; background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; font-size: 14px; font-weight: 600; color: var(--text);
  transition: all 0.2s;
}
.load-more-btn:hover { border-color: var(--red); color: var(--red); }
.no-results { color: var(--text3); font-size: 16px; padding: 40px; text-align: center; }

/* ===== COMIC DETAIL ===== */
.comic-detail-page {
  max-width: 1300px; margin: 0 auto; padding: 30px 20px;
}
.detail-loading {
  display: flex; justify-content: center; align-items: center;
  min-height: 400px; color: var(--text3); font-size: 28px;
}
.comic-detail-hero {
  display: flex; gap: 32px; margin-bottom: 40px;
}
.comic-detail-cover {
  flex-shrink: 0; width: 220px;
}
.comic-detail-cover img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 2/3; object-fit: cover;
}
.comic-detail-cover .no-cover {
  width: 100%; aspect-ratio: 2/3;
  background: var(--card); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text3);
}
.comic-detail-info { flex: 1; }
.comic-detail-title { font-size: 32px; font-weight: 800; margin-bottom: 8px; line-height: 1.2; }
.comic-detail-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.comic-meta-item { font-size: 14px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.comic-meta-item i { color: var(--red); }
.comic-detail-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.detail-genre-tag {
  padding: 4px 12px; border-radius: 12px;
  background: rgba(230,57,70,0.15); border: 1px solid rgba(230,57,70,0.3);
  font-size: 12px; color: var(--red); cursor: pointer;
}
.detail-genre-tag:hover { background: rgba(230,57,70,0.25); }
.comic-detail-desc {
  font-size: 14px; color: var(--text2); line-height: 1.8;
  margin-bottom: 24px; max-width: 680px;
}
.comic-detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.chapters-section { margin-top: 40px; }
.chapters-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.chapter-list { display: flex; flex-direction: column; gap: 8px; }
.chapter-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  transition: all 0.2s;
}
.chapter-item:hover { border-color: var(--red); background: var(--card-hover); }
.chapter-item-left { display: flex; flex-direction: column; gap: 2px; }
.chapter-item-num { font-size: 14px; font-weight: 600; }
.chapter-item-title { font-size: 12px; color: var(--text3); }
.chapter-item-right { display: flex; align-items: center; gap: 12px; }
.chapter-item-date { font-size: 12px; color: var(--text3); }
.chapter-read-btn {
  padding: 6px 16px; background: var(--red);
  border-radius: 16px; font-size: 12px; font-weight: 600; color: #fff;
  transition: background 0.2s;
}
.chapter-read-btn:hover { background: var(--red-dark); }

/* ===== READER ===== */
.reader-body { background: #000; }
.reader-toolbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,18,0.95); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.reader-toolbar-inner {
  max-width: 900px; margin: 0 auto; padding: 0 16px;
  height: 54px; display: flex; align-items: center; gap: 16px;
}
.back-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text2);
  padding: 6px 12px; border-radius: var(--radius);
  background: var(--bg3); transition: all 0.2s;
  flex-shrink: 0;
}
.back-btn:hover { color: var(--text); background: var(--border); }
.reader-info {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
}
.reader-comic-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-chapter-title { font-size: 11px; color: var(--text3); }
.reader-nav {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.reader-nav-btn {
  width: 32px; height: 32px; background: var(--bg3);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: all 0.2s; font-size: 13px;
}
.reader-nav-btn:hover { background: var(--red); color: #fff; }
.reader-nav-btn.disabled { opacity: 0.3; pointer-events: none; }
.chapter-indicator { font-size: 12px; color: var(--text3); white-space: nowrap; }

.reader-container {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 0;
}
.reader-loading {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 80px; color: var(--text3);
}
.reader-page {
  width: 100%; background: #111;
  line-height: 0; display: block;
  font-size: 0; margin: 0; padding: 0;
}
.reader-page img { width: 100%; display: block; margin: 0; padding: 0; vertical-align: top; }
.reader-page canvas { width: 100%; display: block; margin: 0; padding: 0; }

.reader-bottom-nav {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 900px; margin: 0 auto; padding: 24px 16px 40px;
}
.reader-bottom-btn {
  padding: 10px 20px; background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.reader-bottom-btn:hover { border-color: var(--red); color: var(--red); }
.reader-bottom-btn.disabled { opacity: 0.3; pointer-events: none; }
.back-to-top-btn {
  padding: 10px 20px; background: var(--red);
  border-radius: 24px; font-size: 13px; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.back-to-top-btn:hover { background: var(--red-dark); }

/* ===== ADMIN ===== */
.admin-badge {
  padding: 6px 14px; background: rgba(230,57,70,0.15);
  border: 1px solid rgba(230,57,70,0.3); border-radius: 20px;
  font-size: 12px; color: var(--red);
}
.admin-page {
  max-width: 1300px; margin: 0 auto; padding: 30px 20px;
  display: flex; gap: 24px; min-height: calc(100vh - var(--header-h));
}
.admin-sidebar {
  width: 220px; flex-shrink: 0;
}
.sidebar-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0 12px 12px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 14px; color: var(--text2);
  transition: all 0.2s; text-align: left; width: 100%;
}
.sidebar-btn:hover { background: var(--bg3); color: var(--text); }
.sidebar-btn.active { background: rgba(230,57,70,0.15); color: var(--red); }
.sidebar-btn i { width: 16px; }

.admin-content { flex: 1; min-width: 0; }
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.admin-tab-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.admin-tab-header h2 { font-size: 22px; font-weight: 700; }

.admin-comics-list { display: flex; flex-direction: column; gap: 12px; }
.admin-comic-item {
  display: flex; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.admin-comic-thumb {
  width: 50px; height: 70px; flex-shrink: 0;
  background: var(--bg3); border-radius: 6px; overflow: hidden;
}
.admin-comic-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-comic-info { flex: 1; min-width: 0; }
.admin-comic-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.admin-comic-meta { font-size: 12px; color: var(--text3); display: flex; gap: 12px; }
.admin-comic-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-icon {
  width: 34px; height: 34px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.2s;
}
.btn-edit { background: var(--bg3); color: var(--text2); }
.btn-edit:hover { background: rgba(99,102,241,0.2); color: #818cf8; }
.btn-delete { background: var(--bg3); color: var(--text2); }
.btn-delete:hover { background: rgba(230,57,70,0.2); color: var(--red); }
.btn-chapter { background: var(--bg3); color: var(--text2); font-size: 12px; padding: 0 12px; width: auto; }
.btn-chapter:hover { background: rgba(244,162,97,0.2); color: var(--orange); }

/* Admin Forms */
.admin-form { display: flex; flex-direction: column; gap: 20px; max-width: 800px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text2); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 14px; color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--red);
}
.form-group textarea { resize: vertical; min-height: 100px; }

.genre-checkboxes {
  display: flex; flex-wrap: wrap; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.genre-checkboxes label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 400; color: var(--text2);
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
  transition: all 0.15s;
}
.genre-checkboxes label:hover { color: var(--text); background: var(--border); }
.genre-checkboxes input[type="checkbox"] { accent-color: var(--red); }

.file-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all 0.2s; color: var(--text3);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.file-drop-zone:hover, .file-drop-zone.dragover { border-color: var(--red); color: var(--text); background: rgba(230,57,70,0.05); }
.file-drop-zone p { font-size: 13px; }
.file-drop-zone small { font-size: 11px; }

.cover-preview {
  position: relative; display: inline-block; margin-top: 8px;
}
.cover-preview img { width: 120px; height: 160px; object-fit: cover; border-radius: var(--radius); }
.remove-cover-btn {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; background: var(--red);
  border-radius: 50%; color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

.pages-drop-zone { min-height: 120px; }
.pages-preview {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.page-thumb {
  width: 70px; height: 100px; object-fit: cover;
  border-radius: 4px; border: 2px solid var(--border);
}
.page-count { font-size: 12px; color: var(--text3); margin-top: 8px; }

.toggle-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 14px; font-weight: 400 !important; color: var(--text) !important;
}
.toggle-switch {
  width: 40px; height: 22px; background: var(--border);
  border-radius: 11px; position: relative; transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; transition: transform 0.2s;
}
input[type="checkbox"]:checked ~ .toggle-switch { background: var(--red); }
input[type="checkbox"]:checked ~ .toggle-switch::after { transform: translateX(18px); }
.toggle-label input[type="checkbox"] { display: none; }

.form-actions {
  display: flex; gap: 12px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.btn-primary {
  padding: 10px 24px; background: var(--red);
  border-radius: var(--radius); color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  padding: 10px 24px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text2); font-size: 14px; font-weight: 600; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--text2); color: var(--text); }

.form-message {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; margin-top: 8px;
}
.form-message.success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; }
.form-message.error { background: rgba(230,57,70,0.15); border: 1px solid rgba(230,57,70,0.3); color: #f87171; }

.upload-progress { margin-top: 16px; }
.progress-bar { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--red); border-radius: 4px; transition: width 0.3s; width: 0%; }
#progressText { font-size: 13px; color: var(--text2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

  /* --- HEADER --- */
  /* Stack header into two rows: logo+icons on top, search below */
  .header { height: auto; }
  .header-inner {
    flex-wrap: wrap;
    gap: 0;
    padding: 10px 14px 0;
    align-items: center;
  }
  .logo { flex: 1; }
  .nav-links { display: none; order: 3; width: 100%; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg2);
    padding: 80px 20px 20px; z-index: 198;
    overflow-y: auto;
  }
  .header-right {
    order: 2; margin-left: 0;
    display: flex; align-items: center; gap: 8px;
  }
  .hamburger { display: block; }
  /* Full-width search bar on second row */
  .search-form {
    order: 4; width: 100%;
    margin: 8px 0 10px; border-radius: 10px;
  }
  .search-input { width: 100%; flex: 1; }
  .admin-link { white-space: nowrap; padding: 6px 10px; font-size: 12px; }

  /* --- HERO --- */
  .hero { margin: 10px auto; padding: 0 10px; }
  .hero-slider { align-items: stretch; }
  .hero-slide { min-height: unset; border-radius: 10px; }
  .hero-slide-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px; padding: 14px;
  }
  .hero-cover { width: 100%; max-width: 120px; }
  .hero-info { width: 100%; }
  .hero-genres { margin-bottom: 6px; }
  .hero-genre-tag { font-size: 10px; }
  .hero-title { font-size: 17px; line-height: 1.3; }
  .hero-meta { font-size: 11px; margin-bottom: 6px; }
  .hero-desc { font-size: 12px; -webkit-line-clamp: 2; margin-bottom: 10px; }
  .hero-actions { flex-wrap: wrap; gap: 8px; }
  .btn-read, .btn-details { padding: 8px 16px; font-size: 13px; }

  /* --- SECTIONS --- */
  .section { padding: 0 10px; margin-bottom: 24px; }
  .section-title { font-size: 16px; }

  /* --- COMIC GRID & ROW --- */
  .comics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .comics-row .comic-card { flex: 0 0 140px; }

  /* --- COMIC DETAIL --- */
  .comic-detail-hero { flex-direction: column; align-items: flex-start; }
  .comic-detail-cover { width: 140px; }

  /* --- ADMIN --- */
  .admin-page { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }

  /* --- READER --- */
  .reader-toolbar-inner { gap: 6px; }
  .reader-comic-title { display: none; }
}

@media (max-width: 400px) {
  .header-inner { padding: 8px 10px 0; }
  .logo-text { font-size: 16px; }
  .hero-title { font-size: 15px; }
  .comics-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .comics-row .comic-card { flex: 0 0 130px; }
  .btn-read, .btn-details { padding: 7px 12px; font-size: 12px; }
}

.upload-type-toggle { display: flex; gap: 24px; margin-top: 4px; }
.upload-type-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text2); }
.upload-type-option input { accent-color: var(--red); width: 16px; height: 16px; cursor: pointer; }
