/* ==========================================================================
   BEDTIMEY — APP CORE DESIGN SYSTEM & UTILITY CLASSES (app.css)
   Shared layout containers, flex utilities, typography, alerts, and forms.
   ========================================================================== */

/* Mobile Hamburger Menu Toggle Button */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fdfaf6;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  z-index: 1001;
}
.mobile-menu-btn:hover, .mobile-menu-btn:active {
  background: rgba(246, 197, 98, 0.15);
  border-color: rgba(246, 197, 98, 0.4);
  color: var(--gold-primary, #f6c562);
}
.hamburger-icon {
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hamburger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-menu-btn.active .hamburger-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Drawer */
@media (max-width: 860px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .site-header .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(18, 13, 29, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(246, 197, 98, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 24px 28px;
    gap: 12px;
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s;
    z-index: 1000;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .site-header .nav-links.mobile-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-header .nav-links a.nav-link,
  .site-header .nav-links a.nav-link-main,
  .site-header .nav-links a.nav-link-login,
  .site-header .nav-links .btn-nav-cta {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px !important;
    font-size: 16px !important;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #f1f5f9 !important;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
  }

  .site-header .nav-links a.nav-link:hover,
  .site-header .nav-links a.nav-link-main:hover,
  .site-header .nav-links a.nav-link-login:hover {
    background: rgba(246, 197, 98, 0.12);
    border-color: rgba(246, 197, 98, 0.35);
    color: var(--gold-primary, #f6c562) !important;
  }

  .site-header .nav-links .btn-nav-cta {
    justify-content: center;
    margin-top: 6px;
    background: var(--gold-primary, #f6c562) !important;
    color: #1a1528 !important;
    font-weight: 700;
  }
}

/* --------------------------------------------------------------------------
   1. Responsive Containers
   -------------------------------------------------------------------------- */
.container-narrow {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.container-reading {
  max-width: 740px;
  margin-left: auto;
  margin-right: auto;
}

.container-hero {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.container-standard {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.container-wide {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.container-admin {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   2. Flexbox & Grid Helpers
   -------------------------------------------------------------------------- */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-between-baseline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-xs { gap: 6px; }
.gap-sm { gap: 10px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

/* Alignment & Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 36px; }
.mt-xl { margin-top: 48px; }

.mb-xs { margin-bottom: 6px; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 36px; }

/* --------------------------------------------------------------------------
   3. Color & Typography Helpers
   -------------------------------------------------------------------------- */
.text-gold { color: var(--gold-primary, #f6c562); }
.text-gold-light { color: #fef08a; }
.text-cream { color: var(--cream-heading, #fdfaf6); }
.text-slate { color: var(--slate-subtext, #cbd5e1); }
.text-muted { color: var(--slate-muted, #94a3b8); }
.text-amber { color: #d97706; }
.text-emerald { color: #10b981; }
.text-rose { color: #f87171; }

.font-serif { font-family: var(--font-serif, 'Lora', Georgia, serif); }
.font-sans { font-family: var(--font-sans, 'Nunito', -apple-system, sans-serif); }

/* --------------------------------------------------------------------------
   4. Badges & Pills
   -------------------------------------------------------------------------- */
.badge-pill-example {
  display: inline-block;
  background: rgba(246, 197, 98, 0.12);
  border: 1px solid rgba(246, 197, 98, 0.3);
  color: var(--gold-light, #fef08a);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-timeline-night {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  min-width: 84px;
  background: rgba(246, 197, 98, 0.1);
  border: 1px solid rgba(246, 197, 98, 0.25);
  color: var(--gold-light, #fef08a);
  text-align: center;
  margin-top: 1px;
}

.badge-timeline-finale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  min-width: 84px;
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  color: #0b1120;
  text-align: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  margin-top: 1px;
}

.badge-timeline-new-adv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  min-width: 84px;
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
  color: #0b1120;
  text-align: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  margin-top: 1px;
}

.tag-chapter-number {
  font-size: 11.5px;
  color: var(--gold-primary, #f6c562);
  font-weight: 600;
}

.tag-finale-pill {
  font-size: 11.5px;
  color: #0b1120;
  font-weight: 800;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  padding: 4px 10px;
  border-radius: 12px;
}

.tag-new-adv-pill {
  font-size: 11.5px;
  color: #fff;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.5);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(165, 180, 252, 0.4);
}

/* --------------------------------------------------------------------------
   5. Alert Banners & Notice Boxes
   -------------------------------------------------------------------------- */
.notice-box {
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notice-success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  font-weight: 500;
}

.notice-warning {
  background: rgba(246, 197, 98, 0.16);
  border: 1px solid rgba(246, 197, 98, 0.45);
  color: #fde68a;
}

.notice-danger {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   6. Reassurance Callouts
   -------------------------------------------------------------------------- */
.reassurance-callout {
  margin-top: 36px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.reassurance-callout-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.reassurance-callout-body {
  flex: 1;
  min-width: 260px;
}

.reassurance-callout-title {
  color: var(--cream-heading, #fdfaf6);
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.reassurance-callout-desc {
  color: var(--slate-subtext, #cbd5e1);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   7. Auth & Login Components
   -------------------------------------------------------------------------- */
.auth-page-wrapper {
  max-width: 460px;
  margin: 0 auto;
  padding: 72px 20px 100px;
  position: relative;
  z-index: 2;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(246, 197, 98, 0.12);
  border: 1px solid rgba(246, 197, 98, 0.3);
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-avatar-circle span {
  font-size: 32px;
}

.auth-title {
  font-family: var(--font-serif, 'Lora', serif);
  font-size: 32px;
  color: var(--cream-heading, #fdfaf6);
  margin: 0 0 8px;
  font-weight: 600;
}

.auth-subtitle {
  color: var(--slate-muted, #94a3b8);
  font-size: 15px;
  margin: 0;
}

.auth-card-body {
  padding: 36px 32px;
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-group-last {
  margin-bottom: 26px;
}

.auth-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--cream-heading, #fdfaf6);
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 30px;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(246, 197, 98, 0.35);
}

.auth-footer-link {
  text-align: center;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: var(--slate-muted, #94a3b8);
}

.auth-footer-link a {
  color: var(--gold-primary, #f6c562);
  font-weight: 700;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   8. Reader View Components
   -------------------------------------------------------------------------- */
.reader-page-wrapper {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 20px;
}

.reader-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.reader-back-link {
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}

.reader-back-link:hover {
  color: var(--gold-primary, #f6c562);
}

.reader-parchment-sheet {
  background: #ffffff;
  padding: 50px 40px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #eeddc9);
  box-shadow: var(--shadow-warm, 0 4px 20px -2px rgba(45, 35, 20, 0.06));
}

.reader-header-meta {
  text-align: center;
  margin-bottom: 32px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 24px;
}

.reader-eyebrow {
  color: #b45309;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.reader-main-title {
  font-size: 36px;
  color: var(--bg-night, #181f33);
  margin-bottom: 8px;
}

.reader-summary-italic {
  color: #64748b;
  font-style: italic;
  font-size: 16px;
}

.reader-body-prose {
  font-size: 18px;
  line-height: 1.85;
  color: #1e293b;
}

.reader-footer-actions {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   9. Error 404 Components
   -------------------------------------------------------------------------- */
.error-page-wrapper {
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.error-card-night {
  background: linear-gradient(180deg, #17203d 0%, #10162e 100%);
  border: 1px solid rgba(246, 197, 98, 0.35);
  border-radius: 24px;
  padding: 48px 36px;
  max-width: 580px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 40px rgba(246, 197, 98, 0.08);
  position: relative;
  z-index: 2;
}

.error-badge-icon {
  font-size: 54px;
  margin-bottom: 16px;
  line-height: 1;
}

.error-pill-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary, #f6c562);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  background: rgba(246, 197, 98, 0.12);
  padding: 5px 16px;
  border-radius: 20px;
  border: 1px solid rgba(246, 197, 98, 0.3);
}

.error-title {
  font-family: var(--font-serif, 'Lora', serif);
  font-size: clamp(26px, 4vw, 36px);
  color: var(--cream-heading, #fdfaf6);
  margin: 0 0 16px;
  font-weight: 600;
  line-height: 1.3;
}

.error-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--slate-subtext, #cbd5e1);
  margin: 0 auto 32px;
  max-width: 460px;
}

.error-btn-group {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
