/*
 * MangaHe Child Theme — Main CSS
 * Replaces all inline <style> blocks from original footer.php (800+ lines)
 * and manga-single-reading.php.
 *
 * Organised into sections:
 *   1. CSS Custom Properties (design tokens)
 *   2. Modal System
 *   3. Floating Action Button (FAB)
 *   4. Support Popup
 *   5. Reading Page Notice
 *   6. Wallet / Donate UI
 *   7. General Utility
 *   8. Mobile Overrides
 */

/* ════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES
   ════════════════════════════════════════════════════════════ */
:root {
  --mh-primary:      #ff3fa0;
  --mh-primary-dark: #cc2d7a;
  --mh-primary-glow: rgba(255, 63, 160, 0.4);
  --mh-bg-dark:      #0a1f2b;
  --mh-bg-modal:     #0d1b2a;
  --mh-border:       rgba(255, 63, 160, 0.35);
  --mh-text:         #e0e0e0;
  --mh-text-muted:   #a0a0a0;
  --mh-radius:       14px;
  --mh-radius-sm:    8px;
  --mh-shadow:       0 4px 30px rgba(0,0,0,.5), 0 0 20px var(--mh-primary-glow);
  --mh-z-modal:      9000;
  --mh-z-fab:        8000;
  --mh-z-popup:      8500;
  --mh-transition:   .22s ease;
}

/* ════════════════════════════════════════════════════════════
   2. MODAL SYSTEM
   (Report, Feedback, Donate)
   ════════════════════════════════════════════════════════════ */
.mangahe-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--mh-z-modal);
  padding: 16px;
  /* hidden via HTML `hidden` attribute; JS removes it */
}

.mangahe-modal[hidden] { display: none; }

.mangahe-modal__box {
  background: var(--mh-bg-modal);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  box-shadow: var(--mh-shadow);
  color: var(--mh-text);
  font-family: 'Segoe UI', Roboto, sans-serif;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  position: relative;
  animation: mh-modal-in .2s ease;
}

@keyframes mh-modal-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mangahe-modal__box h3 {
  margin: 0 0 18px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mh-primary);
  text-align: center;
}

.mangahe-modal__box h4 {
  margin: 16px 0 8px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--mh-text);
}

.mangahe-modal__box label {
  display: block;
  font-size: .82rem;
  color: var(--mh-text-muted);
  margin: 12px 0 4px;
}

.mangahe-modal__box input[type="text"],
.mangahe-modal__box textarea,
.mangahe-modal__box select {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-sm);
  color: var(--mh-text);
  font-size: .9rem;
  padding: 9px 12px;
  box-sizing: border-box;
  transition: border-color var(--mh-transition);
}

.mangahe-modal__box input:focus,
.mangahe-modal__box textarea:focus,
.mangahe-modal__box select:focus {
  outline: none;
  border-color: var(--mh-primary);
}

.mangahe-modal__box textarea {
  min-height: 90px;
  resize: vertical;
}

.mangahe-modal__box select option {
  background: #0d1b2a;
}

.mangahe-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--mh-text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 50%;
  transition: color var(--mh-transition), background var(--mh-transition);
}
.mangahe-modal__close:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.mangahe-modal__msg {
  font-size: .82rem;
  min-height: 1.2em;
  margin: 10px 0 0;
  text-align: center;
  color: var(--mh-primary);
}

.mangahe-modal__note {
  font-size: .78rem;
  color: var(--mh-text-muted);
  margin: 6px 0 0;
}

/* ── Buttons ── */
.mangahe-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px 16px;
  background: var(--mh-primary);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--mh-radius-sm);
  cursor: pointer;
  transition: background var(--mh-transition), transform var(--mh-transition);
  text-align: center;
}
.mangahe-btn:hover  { background: var(--mh-primary-dark); transform: translateY(-1px); }
.mangahe-btn:active { transform: translateY(0); }

.mangahe-btn--small {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 6px 14px;
  font-size: .82rem;
}

.mangahe-btn--share {
  background: rgba(255,255,255,.1);
  color: var(--mh-text);
  border: 1px solid var(--mh-border);
}
.mangahe-btn--share:hover { background: rgba(255,255,255,.18); }

/* ── Wallet display ── */
.mangahe-donate-block { margin-top: 18px; }
.mangahe-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius-sm);
  padding: 8px 12px;
  flex-wrap: wrap;
}
.mangahe-wallet code {
  flex: 1;
  font-size: .8rem;
  word-break: break-all;
  color: var(--mh-primary);
}

/* ════════════════════════════════════════════════════════════
   3. FLOATING ACTION BUTTON (FAB)
   Consolidates the 3 original separate floating buttons
   ════════════════════════════════════════════════════════════ */
#mangahe-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: var(--mh-z-fab);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}

.mangahe-fab__main {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mh-primary);
  border: none;
  box-shadow: 0 4px 16px var(--mh-primary-glow);
  cursor: pointer;
  font-size: 1.3rem;
  color: #fff;
  transition: transform var(--mh-transition), box-shadow var(--mh-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mangahe-fab__main:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px var(--mh-primary-glow);
}

.mangahe-fab__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.mangahe-fab__menu[hidden] { display: none; }

.mangahe-fab__item {
  background: var(--mh-bg-dark);
  border: 1px solid var(--mh-border);
  color: var(--mh-text);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  transition: background var(--mh-transition), color var(--mh-transition);
}
.mangahe-fab__item:hover {
  background: var(--mh-primary);
  color: #fff;
  border-color: var(--mh-primary);
}

/* Small dismiss X button next to FAB */
.mangahe-fab__close {
  background: rgba(255,255,255,.08);
  border: none;
  color: var(--mh-text-muted);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  transition: background var(--mh-transition);
}
.mangahe-fab__close:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ════════════════════════════════════════════════════════════
   4. SUPPORT POPUP
   ════════════════════════════════════════════════════════════ */
.mangahe-support-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--mh-z-popup);
  padding: 16px;
}
.mangahe-support-overlay[hidden] { display: none; }

.mangahe-support-box {
  background: var(--mh-bg-dark);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  box-shadow: var(--mh-shadow);
  color: var(--mh-text);
  font-family: 'Segoe UI', Roboto, sans-serif;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px 24px;
  position: relative;
  animation: mh-modal-in .25s ease;
  text-align: center;
}

.mangahe-support-box h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mh-primary);
  margin: 0 0 12px;
}

.mangahe-support-box p {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--mh-text);
  margin: 0 0 16px;
}

/* Goal progress bar */
.mangahe-goal { margin: 18px 0; text-align: left; }
.mangahe-goal__label { font-size: .82rem; color: var(--mh-text-muted); margin-bottom: 6px; }
.mangahe-goal__bar {
  height: 10px;
  background: rgba(255,255,255,.1);
  border-radius: 99px;
  overflow: hidden;
}
.mangahe-goal__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mh-primary), #ff7fc0);
  border-radius: 99px;
  width: 0;
  transition: width .8s ease;
}
.mangahe-goal__text { font-size: .8rem; color: var(--mh-text-muted); margin-top: 5px; }

/* ════════════════════════════════════════════════════════════
   5. READING PAGE NOTICE
   Replaces 100+ lines of inline CSS in manga-single-reading.php
   ════════════════════════════════════════════════════════════ */
.mh-reading-notice {
  background: var(--mh-bg-dark);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  box-shadow: 0 0 20px var(--mh-primary-glow), 0 8px 30px rgba(0,0,0,.3);
  color: #fff;
  font-family: 'Segoe UI', Roboto, sans-serif;
  margin: 24px auto;
  max-width: 760px;
  padding: 20px 24px;
  text-align: center;
  transition: transform var(--mh-transition), box-shadow var(--mh-transition);
}
.mh-reading-notice:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 26px var(--mh-primary-glow), 0 12px 36px rgba(0,0,0,.35);
}
.mh-reading-notice__title {
  animation: mh-glow 2s ease-in-out infinite;
  color: #ff7fc0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .4px;
  margin: 0 0 10px;
  text-transform: uppercase;
}
@keyframes mh-glow {
  0%, 100% { text-shadow: 0 0 6px #ff7fc0, 0 0 15px rgba(255,127,192,.4); }
  50%       { text-shadow: 0 0 12px #ff7fc0, 0 0 28px rgba(255,127,192,.55); }
}
.mh-reading-notice__body {
  color: #e0e0e0;
  font-size: .95rem;
  line-height: 1.7;
  margin: 0 0 10px;
}
.mh-reading-notice__highlight { color: var(--mh-primary); font-weight: 700; }
.mh-reading-notice__thank     { color: #d5d5d5; font-size: 1.05rem; margin: 0; }

/* ════════════════════════════════════════════════════════════
   6. GENERAL UTILITY
   ════════════════════════════════════════════════════════════ */

/* Scrollbar for modal boxes */
.mangahe-modal__box::-webkit-scrollbar,
.mangahe-support-box::-webkit-scrollbar { width: 5px; }
.mangahe-modal__box::-webkit-scrollbar-thumb,
.mangahe-support-box::-webkit-scrollbar-thumb {
  background: var(--mh-primary);
  border-radius: 99px;
}

/* ════════════════════════════════════════════════════════════
   7. MOBILE OVERRIDES
   ════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .mangahe-modal__box,
  .mangahe-support-box { padding: 22px 16px 18px; }

  .mangahe-modal__box h3  { font-size: 1.05rem; }
  .mangahe-support-box h2 { font-size: 1.15rem; }

  #mangahe-fab { bottom: 16px; right: 12px; }
  .mangahe-fab__main { width: 46px; height: 46px; font-size: 1.1rem; }

  .mh-reading-notice { margin: 14px 8px; padding: 16px; }
}
