/* ==========================================================================
   SellerMath Design System & Styling
   Clean, modern, high-conversion SaaS aesthetic for e-commerce tools
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #6366f1;

  /* Brand Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;

  /* Status / Money Colors */
  --profit: #10b981;
  --profit-dark: #047857;
  --profit-light: #ecfdf5;

  --fee: #f43f5e;
  --fee-light: #fff1f2;

  --cost: #f59e0b;
  --cost-light: #fffbeb;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  font-size: 1.4rem;
}

.badge-tag {
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 6px;
}

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

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 48px 20px 32px;
}

.hero-badge {
  display: inline-block;
  background: #ecfdf5;
  color: var(--profit-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  border: 1px solid #a7f3d0;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

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

/* Presets Bar */
.presets-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.preset-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgb(79 70 229 / 0.3);
}

/* Calculator Grid */
.calculator-section {
  padding-bottom: 48px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-pill {
  font-size: 0.75rem;
  background: var(--profit-light);
  color: var(--profit-dark);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--profit);
  border-radius: 50%;
}

/* Forms & Inputs */
.form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: help;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 600;
  pointer-events: none;
}

.num-input {
  width: 100%;
  padding: 10px 14px 10px 32px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.num-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.15);
}

.select-input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
}

.select-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed var(--border);
}

.divider span {
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-main);
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Results Display */
.profit-highlight {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: #ffffff;
  padding: 22px;
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgb(6 78 59 / 0.25);
}

.profit-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a7f3d0;
  font-weight: 700;
}

.profit-value {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 700;
  margin: 4px 0 8px;
  letter-spacing: -0.02em;
}

.profit-sub {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.9rem;
  color: #d1fae5;
}

/* Distribution Bar */
.distribution-block {
  margin-bottom: 24px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dist-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}

.segment {
  height: 100%;
  transition: width 0.3s ease;
}

.profit-seg { background: var(--profit); }
.cost-seg { background: var(--cost); }
.fee-seg { background: var(--fee); }

.legend {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.profit-dot { background: var(--profit); }
.cost-dot { background: var(--cost); }
.fee-dot { background: var(--fee); }

/* Itemized Table */
.itemized-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}

.item-row:last-child {
  border-bottom: none;
}

.header-row {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.fee-sub-row {
  color: var(--text-muted);
  font-size: 0.83rem;
  background: #fafafa;
}

.total-fees-row {
  background: var(--fee-light);
}

.total-costs-row {
  background: var(--cost-light);
}

.mono-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.fee-text { color: #e11d48; }
.cost-text { color: #d97706; }

.calc-tip {
  font-size: 0.84rem;
  color: #475569;
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Ad Placeholder Container */
.ad-banner-wrapper {
  margin: 16px auto 48px;
}

.ad-placeholder {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  text-align: center;
  position: relative;
}

.ad-tag {
  position: absolute;
  top: -9px;
  left: 20px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ad-slot-mock {
  font-size: 0.95rem;
  color: #334155;
}

/* Educational & Guide Prose Section */
.guide-section {
  padding-bottom: 64px;
}

.prose-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.prose-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 32px 0 14px;
  letter-spacing: -0.02em;
}

.prose-content h2:first-child {
  margin-top: 0;
}

.prose-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 24px 0 10px;
}

.prose-content p {
  color: #334155;
  margin-bottom: 16px;
  font-size: 1rem;
}

/* Table */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.styled-table th {
  background: #f1f5f9;
  color: var(--text-main);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
}

.styled-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: #334155;
}

.code-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.6;
}

.tips-list {
  margin: 16px 0 24px 24px;
  color: #334155;
}

.tips-list li {
  margin-bottom: 10px;
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

.faq-item summary {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  cursor: pointer;
  background: #f8fafc;
  list-style: none;
  position: relative;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.faq-answer p {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand .logo-text {
  color: #ffffff;
  font-size: 1.3rem;
}

.footer-desc {
  max-width: 380px;
  font-size: 0.88rem;
  margin-top: 8px;
  line-height: 1.5;
}

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

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 24px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

/* Responsive */
@media (max-width: 860px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2rem;
  }
  .prose-content {
    padding: 24px;
  }
}
