/* ==========================================================================
   Compound Wealth Pro - Modern Financial Stylesheet
   Crafted for Maximum AdSense Viewability & High Dwell Time
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(16, 185, 129, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --emerald: #10b981;
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --amber: #f59e0b;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 5px;
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(16, 185, 129, 0.6);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 60%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.35rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--emerald-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.brand-badge {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

/* Ad Placements */
.ad-slot-header {
  margin: 18px 0 10px 0;
  display: flex;
  justify-content: center;
}

.ad-container {
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 0;
  display: block;
}

.ad-leaderboard {
  width: 728px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-mock-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 24px;
  gap: 16px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(139, 92, 246, 0.08));
}

.ad-mock-badge {
  background: var(--emerald);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.ad-mock-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  flex: 1;
}

.ad-mock-btn {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
}

/* Hero */
.hero {
  text-align: center;
  padding: 12px 0 8px 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--emerald);
  margin-bottom: 6px;
}

.hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.hero-title span {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
  font-size: 0.85rem;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  align-items: start;
  margin-bottom: 24px;
}

.calc-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calc-split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Form inputs */
.input-group {
  margin-bottom: 12px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.input-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-stepper-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 14px;
  transition: var(--transition);
}

.input-stepper-box:focus-within {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.prefix, .suffix {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
}

.num-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  padding: 8px;
  width: 100%;
}

.range-slider {
  width: 100%;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin-top: 8px;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  background: var(--emerald);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chips {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.preset-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* Results panel */
.results-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.primary-result-card {
  text-align: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.primary-result-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 6px;
}

.primary-result-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.primary-result-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-box {
  position: relative;
  height: 220px;
  width: 100%;
  margin-bottom: 16px;
}

/* Milestone Cards */
.milestones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.milestone-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.milestone-target {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.milestone-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--emerald);
  margin: 4px 0;
}

.milestone-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Actions */
.action-btn-group {
  display: flex;
  gap: 10px;
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-primary {
  background: var(--emerald-gradient);
  color: #fff;
  border: none;
}

/* Sidebar Sticky Skyscraper */
.sidebar-sticky-rail {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-skyscraper {
  width: 300px;
  min-height: 600px;
  margin: 0 auto;
}

.ad-mock-skyscraper {
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-radius: var(--radius-md);
}

/* Amortization Table */
.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-height: 440px;
  overflow-y: auto;
}

.amort-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.amort-table th:first-child, .amort-table td:first-child {
  text-align: left;
}

.amort-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

/* SEO Content & FAQ */
.seo-section {
  margin: 50px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.faq-answer {
  padding: 0 20px 18px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}

.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 40px 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--emerald);
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-sticky-rail {
    display: none;
  }
  .calc-split-pane {
    grid-template-columns: 1fr;
  }
}

/* Print Statement Header & Footer Defaults (Hidden on screen) */
.print-statement-header, .print-statement-footer {
  display: none;
}

/* Executive Print Stylesheet for A4 Portrait PDF - Pure Monochrome Black & White */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 15mm 15mm 15mm;
  }

  /* Universal monochrome reset: force all text to solid black and kill dark backgrounds */
  *, *::before, *::after {
    color: #000000 !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  }

  .navbar, .hero, .ad-slot-header, .sidebar-sticky-rail, .footer,
  .action-btn-group, .preset-chips, .range-slider, .seo-section,
  .modal-overlay, .calc-split-pane > div:first-child, .chart-box, button, input, select {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .main-grid, .calc-split-pane {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .calc-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Formal Header */
  .print-statement-header {
    display: block !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid #000000 !important;
    padding-bottom: 10px !important;
  }

  .print-header-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
  }

  .print-title {
    font-size: 16pt !important;
    font-weight: 800 !important;
    color: #000000 !important;
    margin: 0 0 3px 0 !important;
    letter-spacing: -0.02em !important;
  }

  .print-subtitle {
    font-size: 8.5pt !important;
    color: #333333 !important;
  }

  .print-meta-info {
    text-align: right !important;
    font-size: 8pt !important;
    color: #000000 !important;
    line-height: 1.4 !important;
  }

  /* Parameters Summary Card */
  .print-params-card {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    background: #f4f4f4 !important;
    border: 1px solid #000000 !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
    margin: 12px 0 16px 0 !important;
    gap: 8px !important;
  }

  .print-param-item {
    font-size: 8.5pt !important;
  }

  .param-lbl {
    display: block !important;
    font-size: 6.5pt !important;
    color: #333333 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
  }

  .param-val {
    font-family: monospace !important;
    font-weight: 700 !important;
    color: #000000 !important;
    font-size: 8.5pt !important;
  }

  /* Results Card */
  .primary-result-card {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 4px !important;
    padding: 10px 16px !important;
    margin-bottom: 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .primary-result-label {
    font-size: 8.5pt !important;
    color: #333333 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
  }

  .primary-result-value {
    color: #000000 !important;
    font-size: 20pt !important;
    font-weight: 800 !important;
    font-family: monospace !important;
    line-height: 1 !important;
  }

  .primary-result-subtext {
    display: none !important;
  }

  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .kpi-card {
    background: #ffffff !important;
    border: 1px solid #888888 !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
  }

  .kpi-label {
    font-size: 6.5pt !important;
    color: #333333 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
  }

  .kpi-value {
    color: #000000 !important;
    font-size: 10.5pt !important;
    font-weight: 800 !important;
    font-family: monospace !important;
  }

  .milestones-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .milestone-card {
    background: #f4f4f4 !important;
    border: 1px solid #888888 !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
  }

  .milestone-target {
    font-size: 7.5pt !important;
    color: #333333 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
  }

  .milestone-year {
    font-size: 12pt !important;
    color: #000000 !important;
    font-weight: 800 !important;
    font-family: monospace !important;
  }

  .milestone-desc {
    font-size: 7pt !important;
    color: #333333 !important;
  }

  /* Table: Pure Black and White */
  .table-wrapper {
    max-height: none !important;
    overflow: visible !important;
    border: 1.5px solid #000000 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
  }

  .amort-table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto !important;
    background: #ffffff !important;
  }

  .amort-table tr {
    page-break-inside: avoid !important;
    background: #ffffff !important;
  }

  .amort-table th {
    background: #eeeeee !important;
    color: #000000 !important;
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 6px 8px !important;
    border: 1px solid #000000 !important;
    border-bottom: 2px solid #000000 !important;
  }

  .amort-table td {
    color: #000000 !important;
    font-size: 8pt !important;
    padding: 5px 8px !important;
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
  }

  /* Footer */
  .print-statement-footer {
    display: block !important;
    margin-top: 18px !important;
    padding-top: 10px !important;
    border-top: 1px solid #000000 !important;
    font-size: 7.5pt !important;
    color: #333333 !important;
    line-height: 1.35 !important;
  }
}

