/* ==========================================================================
   Google Drive Manga Reader - Modern Glassmorphic Dark Theme System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Tokens */
  --bg-main: #090d16;
  --bg-card: rgba(22, 28, 45, 0.7);
  --bg-card-hover: rgba(30, 39, 64, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  --bg-glass-hover: rgba(255, 255, 255, 0.12);
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--accent-glow);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Be Vietnam Pro', 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Common UI Elements */
a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  outline: none;
  transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Primary Glass Card Effect */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Main Layout & Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-glass-border);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  cursor: pointer;
}

.brand-logo .logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-glow);
}

.brand-logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box input {
  width: 100%;
  padding-left: 40px;
  padding-right: 40px;
  border-radius: var(--radius-full);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-glass-border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Page Container Views */
.view-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem;
}

.hidden {
  display: none !important;
}

/* Hero Section */
.hero-banner {
  position: relative;
  min-height: 360px;
  height: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem;
  background: linear-gradient(180deg, rgba(9, 13, 22, 0.25) 0%, rgba(9, 13, 22, 0.95) 100%),
              url('https://images.unsplash.com/photo-1578632767115-351597cf2477?w=1600&auto=format&fit=crop&q=80') center/cover;
  border: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-lg);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

/* Prominent App Link Badge on Hero Banner */
.hero-app-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(168, 85, 247, 0.45) 100%);
  border: 1px solid rgba(168, 85, 247, 0.6);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-app-link-badge:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55) 0%, rgba(168, 85, 247, 0.75) 100%);
  border-color: rgba(244, 114, 182, 0.9);
  box-shadow: 0 0 35px rgba(244, 114, 182, 0.6);
  color: #ffffff;
}

.hero-app-link-badge strong {
  color: #f472b6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-app-link-badge .icon-arrow {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.hero-app-link-badge:hover .icon-arrow {
  transform: translateX(4px);
}

.hero-content h1 {
  font-family: 'Be Vietnam Pro', 'Outfit', sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn-hero-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
  transition: var(--transition-fast);
}

.btn-hero-app:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(236, 72, 153, 0.6);
  color: #ffffff;
}

/* Section Header & Filters */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.genre-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 2rem;
}

.chip-filter {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition-fast);
}

.chip-filter:hover, .chip-filter.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Manga Grid Cards */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.manga-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  transition: var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.manga-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.4);
}

.card-cover {
  position: relative;
  width: 100%;
  padding-top: 140%; /* 1:1.4 aspect ratio */
  overflow: hidden;
  background: #1e293b;
}

.card-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.manga-card:hover .card-cover img {
  transform: scale(1.08);
}

.card-badge-top {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* Manga Detail View */
.detail-header-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  padding: 2.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .detail-header-card {
    grid-template-columns: 1fr;
  }
}

.detail-cover {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--bg-glass-border);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.detail-info .alt-title {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.detail-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Chapter List Table / Cards */
.chapter-list-section {
  padding: 2rem;
}

.chapter-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.chapter-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
}

.chapter-item:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.chapter-title-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.chapter-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Reader Split-View Layout (Matching User Screenshot) */
.reader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #05070c;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.reader-main-area {
  flex: 1;
  height: 100vh;
  overflow: hidden !important; /* Cấm thanh cuộn */
  position: relative;
  scroll-behavior: smooth;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.reader-main-area::-webkit-scrollbar,
.reader-wrapper::-webkit-scrollbar,
.reader-sidebar::-webkit-scrollbar,
.sidebar-body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.reader-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 340px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1030;
  transition: right 0.3s ease;
}

.reader-wrapper.sidebar-collapsed .reader-progress-track {
  right: 0;
}

.reader-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.1s linear;
}

/* Floating Top Controls (Quick Back Button Only) */
.reader-top-floating {
  position: fixed;
  top: 16px;
  left: 24px;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-lg);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.reader-title-top {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Canvas Override */
.reader-canvas {
  width: 100%;
  max-width: 900px;
  margin: 60px auto 80px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 140px);
  transition: max-width 0.3s ease;
}

.reader-canvas.wide {
  max-width: 1200px;
}

.reader-canvas.full {
  max-width: 100%;
}

.reader-canvas iframe {
  width: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.reader-canvas.is-pdf-mode {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.reader-canvas.is-pdf-mode iframe {
  height: 100vh !important;
  margin-top: 0 !important;
}





/* Right Control & Comments Sidebar Panel */
.reader-sidebar {
  width: 340px;
  height: 100vh;
  background: #0f1420;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1010;
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.reader-wrapper.sidebar-collapsed .reader-sidebar {
  margin-right: -340px;
  pointer-events: none;
  opacity: 0;
}

/* Floating Expand Sidebar Button when Sidebar Collapsed (Icon Only) */
.btn-expand-sidebar {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1025;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-expand-sidebar:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.08);
  box-shadow: var(--shadow-glow);
  color: #ffffff;
}

.reader-wrapper.sidebar-collapsed .btn-expand-sidebar {
  display: flex !important;
}

.sidebar-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-manga-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.btn-icon-sm:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px;
}

.box-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.nav-control-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.btn-nav-square {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
}

.btn-nav-square:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.sidebar-select {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 6px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: #161c2b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sidebar-select-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: #161c2b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-sidebar-action {
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-sidebar-action:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* Comments Section Style (Exact Match Screenshot) */
.comments-section {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comments-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comment-input-box {
  background: #141926;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-display-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-input-box textarea {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 0.8rem;
  color: var(--text-primary);
  padding: 0;
  resize: none;
  outline: none;
}

.comment-input-box textarea:focus {
  box-shadow: none;
}

.comment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-icons {
  display: flex;
  gap: 8px;
}

.tool-icons button {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.tool-icons button:hover {
  color: var(--accent-primary);
}

.btn-send-comment {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-send-comment:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.05);
}

.comment-disclaimer {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.comments-feed-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.comment-card-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.78rem;
}

.comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.comment-card-author {
  font-weight: 600;
  color: #818cf8;
}

.comment-card-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.comment-card-text {
  color: var(--text-secondary);
  line-height: 1.4;
}

.empty-feed {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
}

.reader-page-item {
  width: 100%;
  position: relative;
  margin-bottom: 2px;
  display: flex;
  justify-content: center;
  background: #000;
}

.reader-page-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.reader-page-item img.img-load-error {
  min-height: 300px;
  background: #1e1b4b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #f87171;
  text-align: center;
}

/* Modal Popup Base */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  width: 100%;
  max-width: 650px;
  background: #0f172a;
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================
   COMPREHENSIVE MOBILE RESPONSIVE DESIGN SYSTEM (<= 768px & <= 480px)
   ========================================================= */

/* Mobile & Tablet Devices (<= 768px) */
@media (max-width: 768px) {
  /* Header & Navigation */
  .app-header {
    height: 60px;
    padding: 0 12px;
    gap: 8px;
  }

  .brand-logo {
    font-size: 1.15rem;
  }

  .brand-logo i {
    font-size: 1.3rem;
  }

  .search-box {
    flex: 1;
    max-width: 200px;
    height: 36px;
    padding: 0 10px;
  }

  .search-box input {
    font-size: 0.8rem;
  }

  .nav-controls {
    gap: 6px;
  }

  .nav-controls .btn-primary {
    padding: 8px 12px;
    font-size: 0.8rem;
    height: 36px;
  }

  /* Main View Container */
  .view-container {
    padding-top: 72px;
    padding-bottom: 2rem;
  }

  /* Hero Banner */
  .hero-banner {
    min-height: 200px;
    height: auto;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
  }

  .hero-content h1 {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .hero-content p {
    font-size: 0.82rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-content .btn-primary {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  /* Category / Filter Bar */
  .genre-filter-bar {
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-chip {
    padding: 5px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  /* Manga Catalog Grid (2 columns on mobile) */
  .manga-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .manga-card {
    border-radius: var(--radius-sm);
  }

  .card-cover {
    aspect-ratio: 3 / 4.2;
  }

  .card-info {
    padding: 10px;
  }

  .card-title {
    font-size: 0.85rem;
    line-height: 1.25;
    height: 2.5em;
  }

  .card-meta {
    font-size: 0.72rem;
    margin-top: 6px;
  }

  /* Manga Detail View Card */
  .detail-header-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
    gap: 1.25rem;
  }

  .detail-cover {
    width: 150px;
    height: 215px;
    flex-shrink: 0;
    margin: 0 auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
  }

  .detail-info h1 {
    font-size: 1.35rem;
  }

  .detail-info .alt-title {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .detail-tags {
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.75rem;
  }

  .detail-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    text-align: justify;
  }

  .detail-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .detail-actions button {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 0.9rem;
  }

  /* Chapter Section */
  .chapter-list-section {
    padding: 1rem;
  }

  .chapter-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .chapter-list-header #btn-add-chapter {
    width: 100%;
    justify-content: center;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chapter-item {
    padding: 10px 12px;
    min-height: 48px;
  }

  .chapter-title-text {
    font-size: 0.85rem;
  }

  .chapter-date {
    font-size: 0.72rem;
  }

  /* Reader Mode Mobile Styling */
  .reader-wrapper {
    flex-direction: column;
  }

  .reader-top-floating {
    top: 10px;
    left: 10px;
  }

  .btn-expand-sidebar {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  /* Reader Sidebar Overlay on Mobile */
  .reader-sidebar {
    width: 85vw;
    max-width: 320px;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1100;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85);
  }

  .reader-wrapper.sidebar-collapsed .reader-sidebar {
    margin-right: -100%;
  }

  /* Modal Popup Base on Mobile */
  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    width: 96%;
    max-height: 92vh;
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .modal-header h2 {
    font-size: 1.15rem;
  }

  /* Form Controls Touch Target Optimization (Prevent iOS Zoom) */
  .form-group input, 
  .form-group textarea, 
  .form-group select {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    padding: 10px 12px;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .app-header {
    padding: 0 8px;
  }

  .brand-logo div {
    font-size: 1rem;
  }

  .search-box {
    max-width: 140px;
  }

  .nav-controls .btn-primary span {
    display: none; /* Hide text, keep plus icon only for ultra-clean header */
  }

  .nav-controls .btn-primary {
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .manga-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card-info {
    padding: 8px;
  }

  .card-title {
    font-size: 0.8rem;
  }
}
