/* =========================================================
   CalculatorFox Global Stylesheet
   Shared across all pages (calculators, legal, homepage)
   ========================================================= */

:root {
  --bg: #ffffff;
  --panel: #f8fafc;
  --accent: #DB8121;        /* primary fox orange */
  --accent-light: #F2A24A;  /* lighter fox orange (generated highlight) */
  --text: #111827;
  --muted: #6b7280;
  --radius: 16px;
}

/* ---------------------------
   Base Layout & Typography
---------------------------- */
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.7;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--text);
}

h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

h3 {
  font-size: 20px;
  margin-top: 30px;
  margin-bottom: 8px;
}

p, ul, li {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
  color: var(--accent-light);
}

/* ---------------------------
   Header & Navbar
   (Layout handled by #site-header / .header-inner — no overrides needed)
---------------------------- */
header {
  margin: 0;
  padding: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px !important;
  text-decoration: none;
  color: var(--text);
}

.brand-link {
  text-decoration: none !important;
  color: inherit;
}

.brand-link:hover,
.brand-link:focus,
.brand-link:active {
  text-decoration: none !important;
}

/* Clean logo box */
.logo {
  width: 64px !important;
  height: 64px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: none;
  flex-shrink: 0;
}

.logo img,
.logo svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text h1 {
  font-size: 22px;
  margin: 0 0 2px 0;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.brand-text small {
  font-size: 13px;
  color: var(--muted);
  margin-top: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: 40px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
nav a:hover {
  color: var(--accent);
}

/* Nav search styles handled in header.njk */

/* ---------------------------
   Global Containers
---------------------------- */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
}

/* ---------------------------
   Panels & Cards
---------------------------- */
.panel, .info-section, .related-box {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 12px;
}

.info-section {
  padding-top: 20px;
}

.info-section *:not(h1):not(h2):not(h3):not(pre):not(code) {
  color: var(--muted) !important;
}

.related-box h3 {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-top: 0;
}

.related-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-links a {
  font-weight: 500;
  text-decoration: none;
}
.related-links a:hover {
  text-decoration: none !important;
}

/* ---------------------------
   Related Calculators — Clean List
---------------------------- */
.related-calc-box {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
}

.related-calc-heading {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  margin: 0;
  padding: 13px 16px 11px;
  border-bottom: 1px solid #f1f5f9;
}

.related-calc-list {
  display: flex;
  flex-direction: column;
}

.related-calc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f8f9fb;
  text-decoration: none;
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.14s ease, color 0.14s ease, padding-left 0.14s ease;
}

.related-calc-card:last-child {
  border-bottom: none;
}

.related-calc-card:hover {
  background: #faf9f7;
  color: #DB8121;
  padding-left: 20px;
  text-decoration: none !important;
}

.related-calc-name {
  flex: 1;
  min-width: 0;
}

.related-calc-arrow {
  font-size: 11px;
  color: #d1d5db;
  margin-left: 8px;
  transition: transform 0.14s ease, color 0.14s ease;
  flex-shrink: 0;
}

.related-calc-card:hover .related-calc-arrow {
  transform: translateX(3px);
  color: #DB8121;
}

/* ---------------------------
   Breadcrumb
---------------------------- */
.bc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  font-size: 12.5px;
  margin-bottom: 12px;
  padding: 2px 0;
  line-height: 1.4;
}

.bc-link {
  color: #9ca3af;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.18s ease;
}

.bc-link:hover {
  color: #DB8121;
  text-decoration: none !important;
}

.bc-sep {
  color: #d1d5db;
  font-size: 11px;
  user-select: none;
  line-height: 1;
}

.bc-current {
  color: #374151;
  font-weight: 500;
}

@media (max-width: 560px) {
  .bc { font-size: 11.5px; gap: 2px 4px; }
  .bc-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    display: inline-block;
    vertical-align: middle;
  }
}

/* ---------------------------
   Buttons
---------------------------- */
.btn {
  border: none;
  border-radius: 50px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 0px;
  margin-bottom: 16px;
}

/* ---------------------------
   Inputs / Textareas
---------------------------- */
textarea {
  width: 100%;
  min-height: 200px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 14px;
  margin-bottom: 20px;
  resize: vertical;
  box-sizing: border-box;
}

input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-sizing: border-box;
  margin-bottom: 16px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(218, 128, 32, 0.45);
  outline: none;
}

/* ── Custom animated dropdown (replaces native select) ────────────────────
   custom-select.js wraps each <select> in .cs-wrap and builds a custom UI.
   The native select is hidden; .cs-trigger is the visible interactive part.
──────────────────────────────────────────────────────────────────────────── */
.cs-wrap select { display: none !important; }

.cs-wrap {
  position: relative;
  margin-bottom: 16px;
}

label + .cs-wrap { margin-top: 2px; }

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.cs-wrap:hover .cs-trigger {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.cs-wrap.cs-open .cs-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(218, 128, 32, 0.45);
  background-color: #fff;
}

.cs-chevron {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform .2s ease, color .2s ease;
}

.cs-wrap.cs-open .cs-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.cs-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.cs-wrap.cs-open .cs-options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cs-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  transition: background-color .12s ease;
}

.cs-option:hover { background-color: #f8fafc; }

.cs-option.cs-selected {
  color: var(--accent);
  font-weight: 600;
}

label {
  display: block;
  font-weight: 600;
  color: #111827 !important;
  margin-bottom: 6px;
  font-size: 15px;
  letter-spacing: 0.2px;
}

label + input {
  margin-top: 2px;
  margin-bottom: 12px;
}

/* ---------------------------
   KPI Grid
---------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.kpi {
  background: #f1f5f9;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}

.kpi .label {
  font-size: 14px;
  color: var(--muted);
}

.kpi .value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

/* ---------------------------
   Ad Spaces
---------------------------- */

/* Inline ads — between content sections, visible on desktop + mobile */
.inline-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100px;
  margin: 24px 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  position: relative;
}

.inline-ad::before {
  content: 'Advertisement';
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c5cad3;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}

.inline-ad ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}

.ad-space {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f3f4f6;
  position: relative;
}

.ad-space::before {
  content: 'Advertisement';
  position: absolute;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  pointer-events: none;
  z-index: 0;
}

.ad-space ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}

/* ---------------------------
   Footer
---------------------------- */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
}

/* ---------------------------
   Responsive Layout
---------------------------- */
@media (max-width: 800px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
  }
  nav {
    gap: 20px;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ---------------------------
   Code Blocks
---------------------------- */
pre {
  background: #f8fafc;
  color: var(--text);
  font-size: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin: 16px 0;
  white-space: pre-wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  position: relative;
}

pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 10px 0 0 10px;
}

pre strong {
  color: var(--accent);
}
/* =========================================================
   Fix: Prevent calculator results from overflowing boxes
   ========================================================= */
#primaryResult,
#outTotal,
#outCount,
#outIgnored,
.kpi .value,
.calc-output {
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  display: block;
  line-height: 1.4;
}

/* === Dropdown Styling ========================================== */

.currency-input { position: relative; }

.dropdown-list {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-list.show {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-list div {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-list div:hover {
  background: #fff8ee;
  color: #92400e;
}

.dropdown-list div.active {
  background: #fef3e2;
  color: #78350f;
}

/* Codes + Names visually distinct */
.dropdown-list .code { font-weight: 600; }
.dropdown-list .name {
  color: #6b7280;
  font-size: 0.9rem;
  margin-left: 10px;
}

/* Error note */
#unavailable-msg {
  display: none;
  margin-top: 10px;
  color: #b91c1c;
  font-weight: 600;
  text-align: center;
}
/* Creator money calculator field styling */
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
}

input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(219, 129, 33, 0.25);
  outline: none;
}

/* Two-column layout for viewers + subs */
.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Grid layout for CPM sliders */
.cpm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Note box under CPM range */
.note {
  margin-top: 4px;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
  background: #fff8ee;
  border-left: 4px solid #DB8121;
  padding: 8px 12px;
  border-radius: 6px;
}

/* Button row – includes spacing above Reset CPM Range */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;             /* 🔥 this is the spacing you’re missing */
}

/* KPI values – prevent squishing and make them slightly larger */
.kpi .value {
  word-break: break-word;
  white-space: normal;
  font-size: 1.15rem;
}
  /* Fix CSV button text color */
  #btnExportCsv {
    color: #ffffff !important;
  }

  /* Add spacing above CSV button area */
  .amort-actions {
    margin-top: 18px !important;
  }

/* ---------------------------
   Mobile — center sidebar cards
---------------------------- */
@media (max-width: 800px) {
  .wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .wrap > aside {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .ad-space,
  .related-box,
  .related-calc-box {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  .related-links {
    width: 100%;
  }
  .related-links a {
    text-align: left !important;
    width: 100% !important;
  }

  /* Mobile top banner ad — flush against navbar, min-height if no ad loads */
  .mobile-top-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    max-height: 60px;
    overflow: hidden;
    margin: 0 0 12px;
    background: #f3f4f6;
    border-radius: 6px;
    position: relative;
  }

  .mobile-top-ad::before {
    content: 'Advertisement';
    position: absolute;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    pointer-events: none;
    z-index: 0;
  }

  .mobile-top-ad ins.adsbygoogle {
    position: relative;
    z-index: 1;
  }
}

@media (min-width: 801px) {
  .mobile-top-ad { display: none; }

  /* Sidebar: flex column so ad units stack and fill height */
  .wrap > aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .wrap > aside .ad-space,
  .wrap > aside .related-box {
    margin-top: 0 !important; /* gap handles spacing */
  }
}

/* Hide extra sidebar ads on mobile to avoid bloat */
/* On mobile: reorder sidebar to Ad #1 → Related → Ad #2 */
@media (max-width: 800px) {
  .sidebar-ad-extra { display: none !important; }
  .wrap > aside > *:nth-child(1) { order: 1; }
  .wrap > aside > *:nth-child(2) { order: 3; }
  .wrap > aside > .related-calc-box { order: 2; }
}

/* ══════════════════════════════════
   INFO SECTION — headings + content
══════════════════════════════════ */
.info-section h2 {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-section h2::before {
  content: "";
  display: block;
  width: 4px;
  min-height: 20px;
  align-self: stretch;
  background: linear-gradient(180deg, #DB8121, #f9a556);
  border-radius: 3px;
  flex-shrink: 0;
}
.info-section h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 26px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #f1f5f9;
}
.info-section p {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
  margin: 0 0 10px;
}
.info-section pre {
  background: #f8fafc;
  border-left: 3px solid #DB8121;
  border-radius: 0 10px 10px 0;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.9;
  color: #1e293b;
  overflow-x: auto;
  margin: 0 0 10px;
}
.info-section ul {
  list-style: none;
  padding: 0; margin: 0 0 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.info-section ul li {
  padding: 2px 0 2px 18px;
  border-left: 2px solid #fde8c0;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}
.info-section ul li strong { color: #0f172a; }

/* ══════════════════════════════════
   FAQ SECTION
══════════════════════════════════ */
.faq-item {
  background: #fff;
  border: 1.5px solid #e8edf3;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item:hover {
  border-color: #fde8c0;
  box-shadow: 0 4px 16px rgba(219,129,33,0.08);
}
.faq-item strong {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}
.faq-item strong::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  min-width: 22px;
  background: linear-gradient(135deg, #DB8121, #f9a556);
  color: #fff;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-top: 1px;
}
.faq-item p { margin: 10px 0 0 32px; font-size: 13.5px; color: #4b5563; line-height: 1.65; }
