/* YSF Manga & Manhwa — Ultra-Fast Light Mode Stylesheet */
:root {
  --ysf-bg: #f8fafc;
  --ysf-header-bg: #ffffff;
  --ysf-card-bg: #ffffff;
  --ysf-card-hover: #ffffff;
  --ysf-border: #e2e8f0;
  --ysf-purple: #7c3aed;
  --ysf-purple-hover: #6d28d9;
  --ysf-purple-light: #8b5cf6;
  --ysf-amber: #f59e0b;
  --ysf-green: #10b981;
  --ysf-blue: #2563eb;
  --ysf-text: #0f172a;
  --ysf-text-muted: #64748b;
  --ysf-radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body.ysf-manga-light, body {
  margin: 0; padding: 0;
  background-color: var(--ysf-bg);
  color: var(--ysf-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ysf-purple); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ysf-purple-hover); }
img { max-width: 100%; height: auto; }

/* Container */
.ysf-container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Top Announcement Bar */
.top-bar { background: #0f172a; color: #fff; font-size: 13px; padding: 8px 0; }
.top-bar a { color: #cbd5e1; }
.top-bar a:hover { color: #fff; }

/* Header — Light Mode Clean */
.ysf-header {
  background: var(--ysf-header-bg);
  border-bottom: 1px solid var(--ysf-border);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.ysf-header-container {
  max-width: 1240px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ysf-brand-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 800; color: #0f172a; text-transform: uppercase; letter-spacing: 0.5px;
}
.ysf-brand-icon { width: 26px; height: 26px; color: var(--ysf-purple); display: inline-flex; }
.ysf-brand-icon svg { width: 100%; height: 100%; }

.ysf-nav-menu { display: flex; align-items: center; }
.ysf-menu-list {
  display: flex; list-style: none; margin: 0; padding: 0; gap: 20px; align-items: center;
}
.ysf-menu-list a {
  color: #334155; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 6px; transition: all 0.2s;
}
.ysf-menu-list a:hover { color: var(--ysf-purple); background: #f1f5f9; }
.ysf-admin-nav-link {
  background: rgba(124, 58, 237, 0.08) !important; color: var(--ysf-purple) !important;
  border: 1px solid rgba(124, 58, 237, 0.25) !important;
}
.ysf-admin-nav-link:hover { background: var(--ysf-purple) !important; color: #fff !important; }

/* Header Search */
.ysf-header-search { position: relative; }
.ysf-search-form { display: flex; align-items: center; position: relative; }
.ysf-search-icon { position: absolute; left: 12px; color: #94a3b8; font-size: 16px; pointer-events: none; }
.ysf-search-input {
  background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 20px;
  padding: 8px 16px 8px 34px; font-size: 13px; color: #0f172a; outline: none;
  width: 200px; transition: all 0.3s;
}
.ysf-search-input:focus { width: 260px; background: #fff; border-color: var(--ysf-purple); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

/* Featured Hero Slider / Grid */
.ysf-featured-hero { margin: 20px 0 28px; }
.ysf-section-header { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.ysf-section-title {
  font-size: 17px; font-weight: 800; color: #0f172a; margin: 0;
  display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.ysf-section-title span.dashicons { color: var(--ysf-purple); font-size: 20px; }

.ysf-featured-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.ysf-featured-card {
  position: relative; border-radius: var(--ysf-radius); overflow: hidden;
  aspect-ratio: 16 / 9; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: 1px solid var(--ysf-border);
}
.ysf-featured-link { display: block; width: 100%; height: 100%; }
.ysf-featured-card img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease;
}
.ysf-featured-card:hover img { transform: scale(1.04); }
.ysf-featured-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(15,23,42,0.92) 0%, rgba(15,23,42,0.5) 70%, transparent 100%);
  padding: 14px 12px; display: flex; flex-direction: column; justify-content: flex-end;
}
.ysf-featured-title {
  color: #fff; font-size: 14px; font-weight: 700; margin: 6px 0 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Genre Filter Bar */
.ysf-genre-filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; margin-bottom: 20px;
  scrollbar-width: none; align-items: center;
}
.ysf-genre-filter-bar::-webkit-scrollbar { display: none; }
.ysf-filter-label { font-size: 13px; font-weight: 700; color: #64748b; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ysf-filter-pill {
  background: #ffffff; color: #475569; padding: 5px 14px;
  border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--ysf-border);
  white-space: nowrap; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.ysf-filter-pill:hover { background: var(--ysf-purple); color: #fff; border-color: var(--ysf-purple); }

/* Manga Grid — Light Mode Cards */
.ysf-latest-section { margin-bottom: 35px; }
.ysf-manga-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 18px 14px;
}
.ysf-manga-card {
  background: var(--ysf-card-bg); border-radius: var(--ysf-radius); overflow: hidden;
  border: 1px solid var(--ysf-border); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.ysf-manga-card:hover {
  transform: translateY(-4px); border-color: var(--ysf-purple);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.12);
}
.ysf-card-thumb {
  position: relative; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: #e2e8f0;
}
.ysf-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ysf-thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 32px;
}
.ysf-card-type {
  position: absolute; top: 8px; left: 8px; background: rgba(15, 23, 42, 0.85);
  color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; text-transform: uppercase; backdrop-filter: blur(4px);
}
.ysf-card-chapter {
  position: absolute; bottom: 8px; right: 8px; background: var(--ysf-purple);
  color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.ysf-card-info { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.ysf-card-title {
  margin: 0 0 6px; font-size: 13px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ysf-card-title a { color: var(--ysf-text); }
.ysf-card-title a:hover { color: var(--ysf-purple); }
.ysf-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ysf-text-muted); }
.ysf-card-rating { color: var(--ysf-amber); font-weight: 700; }

/* Pagination */
.ysf-pagination { margin: 30px 0; text-align: center; }
.ysf-pagination a, .ysf-pagination span {
  display: inline-block; padding: 7px 13px; margin: 0 3px; border-radius: 6px;
  background: #fff; color: #334155; border: 1px solid var(--ysf-border);
  font-size: 13px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.ysf-pagination span.current { background: var(--ysf-purple); border-color: var(--ysf-purple); color: #fff; }
.ysf-pagination a:hover { background: var(--ysf-purple); border-color: var(--ysf-purple); color: #fff; }

/* Single Manga / Chapter Header */
.ysf-breadcrumb-bar { font-size: 13px; color: var(--ysf-text-muted); margin: 18px auto 14px; }
.ysf-breadcrumb-bar a { color: var(--ysf-purple); font-weight: 600; }
.ysf-manga-hero-card {
  background: #ffffff; border-radius: 12px; padding: 22px;
  border: 1px solid var(--ysf-border); display: flex; gap: 22px; margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.ysf-manga-cover-wrap {
  width: 160px; flex-shrink: 0; position: relative; border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); aspect-ratio: 3 / 4;
}
.ysf-manga-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ysf-type-badge {
  position: absolute; top: 8px; left: 8px; background: var(--ysf-purple); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase;
}
.ysf-badge-manhwa { background: var(--ysf-blue); }
.ysf-badge-manga { background: #ec4899; }
.ysf-badge-manhua { background: var(--ysf-amber); }

.ysf-manga-details { flex: 1; }
.ysf-manga-title { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0 0 10px; line-height: 1.3; }
.ysf-meta-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ysf-pill {
  background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px;
}
.ysf-pill-chapter { background: rgba(124, 58, 237, 0.1); color: var(--ysf-purple); }
.ysf-pill-rating { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.ysf-genre-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.ysf-genre-tag {
  background: #f8fafc; color: var(--ysf-purple); padding: 4px 10px;
  border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid var(--ysf-border);
}
.ysf-genre-tag:hover { background: var(--ysf-purple); color: #fff; }

.ysf-quick-actions { display: flex; gap: 10px; }
.ysf-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 9px 18px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.ysf-btn-primary { background: var(--ysf-purple); color: #fff; }
.ysf-btn-primary:hover { background: var(--ysf-purple-hover); color: #fff; }
.ysf-btn-ghost { background: #f1f5f9; color: #334155; border: 1px solid var(--ysf-border); }
.ysf-btn-ghost:hover { background: #e2e8f0; }

/* Chapter Navigation Toolbar */
.ysf-reader-toolbar {
  background: #ffffff; border-top: 1px solid var(--ysf-border);
  border-bottom: 1px solid var(--ysf-border); padding: 10px 0; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.ysf-toolbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ysf-toolbar-title { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ysf-nav-btn {
  background: var(--ysf-purple); color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;
}
.ysf-nav-btn:hover { background: var(--ysf-purple-hover); color: #fff; }
.ysf-nav-btn.ysf-disabled { background: #e2e8f0; color: #94a3b8; pointer-events: none; }

/* Vertical Webtoon / Manhwa Chapter Reader */
.ysf-content-wrap { max-width: 900px; margin: 0 auto; }
.ysf-manga-synopsis, .ysf-manga-article-text {
  background: #ffffff; border: 1px solid var(--ysf-border); border-radius: 8px;
  padding: 18px 22px; margin-bottom: 22px; color: #334155; font-size: 14px; line-height: 1.8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.ysf-manga-article-text p { margin: 0 0 12px; }
.ysf-manga-article-text em { color: var(--ysf-blue); font-style: italic; font-weight: 600; }
.ysf-chapter-reader { width: 100%; margin: 0 auto; text-align: center; }
.ysf-reader-page { margin: 0 auto; line-height: 0; }
.ysf-chapter-img {
  max-width: 100%; height: auto; display: block; margin: 0 auto;
}



/* Mobile Responsiveness & Speed */
@media (max-width: 768px) {
  .ysf-container { padding: 0 12px; }
  .ysf-menu-list { display: none; }
  .ysf-header-search .ysf-search-input { width: 150px; }
  .ysf-header-search .ysf-search-input:focus { width: 180px; }
  .ysf-manga-hero-card { flex-direction: column; align-items: center; text-align: center; padding: 16px; }
  .ysf-manga-cover-wrap { width: 130px; }
  .ysf-meta-pills, .ysf-genre-tags, .ysf-quick-actions { justify-content: center; }
  .ysf-footer-grid { grid-template-columns: 1fr; gap: 20px; }
  
  /* 2 Columns on Mobile for Manga Grid */
  .ysf-manga-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px 10px !important;
  }
  .ysf-card-title { font-size: 12px; }
  .ysf-card-info { padding: 8px 10px; }
  .ysf-toolbar-title { display: none; }
  
  /* Edge-to-Edge Webtoon Reading on Mobile */
  .ysf-content-wrap { max-width: 100% !important; margin: 0 !important; }
  .ysf-chapter-reader { width: 100% !important; }
  .ysf-chapter-img { width: 100% !important; border-radius: 0 !important; }
}

/* YSF Manga Notice Box (Release dates, spoilers & announcements) */
.ysf-manga-notice-box {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  border-left: 4px solid #16a34a !important;
  border-radius: 8px !important;
  padding: 14px 18px !important;
  margin: 16px 0 20px !important;
  color: #166534 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}
.ysf-manga-notice-box p {
  margin: 0 !important;
  font-weight: 600 !important;
  color: #166534 !important;
}
.ysf-manga-notice-box em {
  font-style: normal !important;
  font-weight: 700 !important;
  color: #15803d !important;
}


/* Footer — Clean Light Mode (Matches Homepage Design & Colors) */
.ysf-footer {
  background: #ffffff !important;
  border-top: 1px solid var(--ysf-border, #e2e8f0) !important;
  padding: 48px 0 24px !important;
  color: var(--ysf-text-muted, #64748b) !important;
  font-size: 13px !important;
  margin-top: 50px !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02) !important;
}
.ysf-footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}
.ysf-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}
.ysf-footer-title {
  color: var(--ysf-text, #0f172a) !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  margin: 0 0 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.ysf-footer-desc {
  margin: 0 !important;
  line-height: 1.75 !important;
  color: var(--ysf-text-muted, #64748b) !important;
  max-width: 440px;
}
.ysf-footer-subtitle {
  color: var(--ysf-text, #0f172a) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  margin: 0 0 14px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.ysf-footer-links {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 2.1 !important;
}
.ysf-footer-links a {
  color: #475569 !important;
  font-weight: 500 !important;
  transition: all 0.2s ease;
}
.ysf-footer-links a:hover {
  color: var(--ysf-purple, #7c3aed) !important;
  padding-left: 3px;
}
.ysf-footer-bottom {
  border-top: 1px solid var(--ysf-border, #e2e8f0) !important;
  padding-top: 20px !important;
  text-align: center !important;
  font-size: 12px !important;
  color: #94a3b8 !important;
}
.ysf-footer-bottom strong {
  color: #334155 !important;
}
