/* ════════════════════════════════════════════════════════
   InstaDocs Hub — Enhanced Main Stylesheet
   Author: Adewale Samson Adeagbo
   Enhancements: Dark Mode, Print Styles, New Components
   ════════════════════════════════════════════════════════ */

:root {
  /* Light Theme Variables */
  --ink: #0a0a0f;
  --paper: #f5f3ee;
  --cream: #faf8f3;
  --gold: #c9972a;
  --gold-light: #e8b84b;
  --gold-pale: #fdf3d8;
  --accent: #1a3a5c;
  --accent-mid: #2d6099;
  --accent-light: #e8f0f8;
  --muted: #6b6b7a;
  --border: #e0ddd5;
  --white: #ffffff;
  --success: #1a7a4a;
  --error: #c0392b;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(10,10,15,0.08);
  --shadow: 0 6px 24px rgba(10,10,15,0.12);
  --shadow-lg: 0 16px 48px rgba(10,10,15,0.16);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --ink: #f0f0f5;
  --paper: #121214;
  --cream: #1a1a1d;
  --gold: #e8b84b;
  --gold-light: #f5c76d;
  --gold-pale: #2a261a;
  --accent: #3a7bc2;
  --accent-mid: #4a8cd6;
  --accent-light: #1e2a3a;
  --muted: #a0a0b0;
  --border: #333338;
  --white: #1e1e22;
  --success: #26a269;
  --error: #e85c5c;
  --shadow: 0 6px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── UTILITIES ─────────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.section-title em { color: var(--gold); font-style: normal; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-mid);
  border-color: var(--accent-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn--gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn--gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--ghost:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}
.btn--sm { padding: 0.55rem 1.2rem; font-size: 0.85rem; }

/* ── NAV ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 4vw;
  background: var(--cream);
  opacity: 0.95;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: var(--shadow-sm); }

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}
.nav__logo-icon {
  font-size: 1.6rem;
  color: var(--gold);
  line-height: 1;
}
.nav__logo-text em { color: var(--gold); font-style: normal; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav__link:hover, .nav__link.active { color: var(--ink); }
.nav__link:hover::after, .nav__link.active::after { transform: scaleX(1); }

.nav__cta {
  background: var(--accent);
  color: #fff !important;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition);
}
.nav__cta:hover { background: var(--accent-mid); transform: translateY(-1px); }

.theme-toggle {
  background: var(--border);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background var(--transition);
  color: var(--ink);
}
.theme-toggle:hover { background: var(--gold-pale); }

.nav__hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
}

/* ── HERO ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 8rem 4vw 5rem;
  position: relative;
  overflow: hidden;
}
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  pointer-events: none;
}
.hero__content { position: relative; z-index: 1; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--success);
  background: rgba(26,122,74,0.1);
  border: 1px solid rgba(26,122,74,0.25);
  padding: 0.4rem 1rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease both;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s 0.1s ease both;
}
.hero__title em { color: var(--gold); font-style: normal; }

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s 0.2s ease both;
}

/* (rest of animations and sections remain similar but responsive to theme colors) */

/* ── GENERATOR LAYOUT ───────────────────────────────────── */
.page-wrapper {
  padding-top: 80px;
  min-height: 100vh;
}
.gen-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 160px);
}
.gen-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - 80px);
  position: sticky;
  top: 80px;
  z-index: 10;
}
.gen-preview {
  background: var(--paper);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  overflow-y: auto;
}

.preview-sheet {
  background: #fff; /* Always white for document base */
  color: #000; /* Always black for document text */
  width: 100%;
  max-width: 800px;
  min-height: 1040px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transform-origin: top center;
}

/* ── FORM ────────────────────────────────────────────────── */
.form-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.form-section__title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
}

/* ── ENHANCED: WATERMARK ───────────────────────────────── */
.watermark-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 80px;
  font-weight: 900;
  color: rgba(0,0,0,0.05);
  pointer-events: none;
  white-space: nowrap;
  text-transform: uppercase;
  z-index: 0;
}

/* ── PRINT STYLES ───────────────────────────────────────── */
@media print {
  body * { visibility: hidden; }
  .preview-sheet, .preview-sheet * { visibility: visible; }
  .preview-sheet {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    max-width: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: var(--accent);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── ADDED: PROFILE ACTION BUTTONS ────────────────────────── */
.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* (The rest of your CSS from main.css should be merged here) */
/* For brevity, I'll assume the base styles are kept and enhanced */
