/* =====================================================
   Toomics – Main Stylesheet
   CTA: readzy.io/comizy/home
   ===================================================== */

/* ── Reset & Base ─────────────────────────────────── */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #182335;
  color: #eaeaea;
  background-image: url(./assets/body-bg.webp);
  background-repeat: no-repeat;
  background-size: cover;
}

a {
  color: #ff5f5f;
  text-decoration: none;
}

p {
  line-height: 1.7;
  color: #ddd;
  font-size: 17px;
}

ul {
  color: #ccc;
  font-size: 17px;
}

img.aligncenter {
  display: block;
  margin: auto;
  max-width: 100%;
  height: auto;
}

/* ── Header ───────────────────────────────────────── */
header {
  background: #182335;
  border-bottom: 1px solid #1e2c43;
  padding: 12px 20px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: auto;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .12em;
}

.logo a {
  color: #fff;
}

.logo a:hover {
  color: #ff5f5f;
}

nav a {
  margin: 0 10px;
  color: #c6cacf;
  font-size: 17px;
}

nav a:hover {
  color: #fff;
}

.search input {
  background: #d5e1e7;
  border: 1px solid #333;
  color: #1a1a1a;
  padding: 6px 10px;
  border-radius: 4px;
}

/* ── Layout ───────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

/* ── Typography / Sections ────────────────────────── */
.section-title {
  font-size: 24px;
  margin: 25px 0 15px;
  border-left: 4px solid #ff5f5f;
  padding-left: 10px;
}

h1.section-title {
  font-size: 32px;
}

/* ── Manga Grid ───────────────────────────────────── */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.manga-card {
  background: #161616;
  border-radius: 6px;
  overflow: hidden;
  transition: transform .2s;
}

.manga-card:hover {
  transform: translateY(-4px);
}

.manga-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.manga-info {
  padding: 10px;
  font-size: 14px;
}

.manga-info strong {
  display: block;
  margin-bottom: 4px;
}

/* ── CTA Buttons ──────────────────────────────────── */
.cta-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b6b, #ff3b3b);
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(255, 95, 95, 0.35);
  transition: all .2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255, 95, 95, 0.45);
}

.btn-secondary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid #ff5f5f55;
  font-weight: 600;
  transition: all .2s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255, 95, 95, 0.45);
}

/* ── Social Bar ───────────────────────────────────── */
.social-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px 0;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 36px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.social-btn img {
  width: 16px;
  height: 16px;
}

.social-count {
  opacity: .85;
  font-weight: 500;
  font-size: 12px;
}

/* Brand colours */
.sb-facebook  { background: #1877f2; }
.sb-x         { background: #000; }
.sb-messenger { background: #0084ff; }
.sb-reddit    { background: #ff4500; }
.sb-whatsapp  { background: #25d366; }
.sb-telegram  { background: #229ed9; }

.social-btn:hover { opacity: .9; }

/* ShareThis override */
.sharethis-inline-share-buttons { margin: 0; }

/* Hide fallback when ShareThis loads */
.sharethis-loaded .social-fallback { display: none; }

/* ── Footer ───────────────────────────────────────── */
footer {
  background: #111;
  border-top: 1px solid #222;
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #888;
}

/* ── Table ─────────────────────────────────────────── */
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  color: #ddd;
  margin: 16px 0;
}

table th {
  background: #1e2c43;
  padding: 10px 12px;
  text-align: left;
}

table td {
  padding: 8px 12px;
}

table tr:nth-child(even) td {
  background: #1a2436;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  nav { display: none; }
}

@media (max-width: 600px) {
  .cta-group {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ── Manga Detail Modal ───────────────────────────── */
.manga-card { cursor: pointer; }
.manga-card:focus { outline: 2px solid #ff5f5f; outline-offset: 2px; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-overlay.active { display: flex; }

.modal-box {
  background: #1a2536;
  border: 1px solid #2a3a52;
  border-radius: 12px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  animation: modalIn .22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #ff5f5f;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close-btn:hover { background: #e03030; }

.modal-inner {
  display: flex;
  gap: 24px;
  padding: 28px;
}

.modal-left {
  flex: 0 0 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.modal-cover-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.modal-type-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b6b, #ff3b3b);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
}

.modal-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-title {
  font-size: 19px;
  color: #f0f4f8;
  margin: 0;
  line-height: 1.4;
  padding-right: 36px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-rating {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.modal-stars { color: #f59e0b; letter-spacing: 1px; }
.modal-rating strong { color: #fff; font-size: 15px; }

.modal-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .4px;
}
.status-ongoing { background: #16a34a; color: #fff; }
.status-done    { background: #6366f1; color: #fff; }

.modal-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.genre-tag {
  background: #1e2d42;
  color: #ff9999;
  border: 1px solid rgba(255, 95, 95, 0.3);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.modal-desc {
  font-size: 14px;
  line-height: 1.75;
  color: #9fb3c8;
  margin: 0;
}

.modal-chapters-title {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.modal-chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-chapter-list li a {
  display: block;
  padding: 7px 12px;
  background: #1e2d42;
  border-radius: 5px;
  color: #63b3ed;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.modal-chapter-list li a:hover { background: #273d58; color: #fff; }

.modal-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  align-self: flex-start;
  font-size: 14px;
}

@media (max-width: 620px) {
  .modal-inner {
    flex-direction: column;
    padding: 20px 16px 24px;
  }
  .modal-left {
    flex: none;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
  }
  .modal-cover-img { width: 110px; }
  .modal-title { font-size: 16px; padding-right: 0; }
}

/* ── Dynamic Manga Browser ────────────────────────── */

/* Genre filter tabs */
.genre-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.gf-btn {
  background: #1e2d42;
  border: 1px solid #2a3a52;
  color: #9fb3c8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.gf-btn:hover {
  border-color: #ff5f5f;
  color: #fff;
}

.gf-btn.active {
  background: linear-gradient(135deg, #ff6b6b, #ff3b3b);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* Loading spinner */
.dg-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #7a8a9a;
  font-size: 14px;
  padding: 40px 0;
  grid-column: 1 / -1;
}

.dg-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #2a3a52;
  border-top-color: #ff5f5f;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
