/* ============================================================
   main.css — Global design system for forsuccess.today
   Used on every page of the site (calculators, blog, landing, etc.)
   Calculator pages also load assets/calculators.css on top of this.
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  /* Brand colours */
  --primary:  #2563eb;
  --accent:   #1e40af;
  --success:  #16a34a;
  --warning:  #d97706;
  --danger:   #dc2626;

  /* Neutral palette */
  --bg:       #f9fafb;
  --white:    #ffffff;
  --text:     #111827;
  --muted:    #6b7280;
  --subtle:   #374151;
  --border:   #e5e7eb;

  /* Surface / elevation */
  --radius:   12px;
  --radius-sm: 8px;
  --shadow:   0 10px 30px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.10);
}

/* ── Dark Mode — Variable Overrides ─────────────────────── */
[data-theme="dark"] {
  --bg:       #0f172a;
  --white:    #1e293b;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --subtle:   #cbd5e1;
  --border:   #334155;
  --shadow:   0 10px 30px rgba(0,0,0,.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.45);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a   { text-decoration: none; color: var(--primary); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── Layout Utilities ───────────────────────────────────── */
.container     { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section       { padding: 0 20px 56px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.muted         { color: var(--muted); }

/* ── Header ─────────────────────────────────────────────── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo      { font-weight: 800; font-size: 1.2rem; color: var(--primary); }
.logo span { color: var(--text); }
.header-right { display: flex; align-items: center; gap: 20px; }
nav        { display: flex; gap: 20px; }
nav a      { color: var(--subtle); font-size: .875rem; font-weight: 500; transition: color .2s; }
nav a:hover { color: var(--primary); }
nav a.active { color: var(--primary); font-weight: 700; }
.header-controls { display: flex; align-items: center; gap: 12px; }
/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--bg); border-color: var(--primary); }
.menu-toggle-icon--close { display: none; }
.menu-toggle-icon--open  { display: flex; }
header.menu-open .menu-toggle-icon--close { display: flex; }
header.menu-open .menu-toggle-icon--open  { display: none; }

@media (max-width: 600px) {
  .menu-toggle { display: flex; }
  .header-inner { position: relative; }
  .header-right {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .25s ease, opacity .2s ease;
  }
  [data-theme="dark"] .header-right { background: var(--bg); }
  header.menu-open .header-right {
    max-height: 640px;
    opacity: 1;
    overflow: visible;
  }
  nav {
    flex-direction: column;
    gap: 0;
    padding: 8px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }
  nav a {
    padding: 12px 0;
    font-size: 1rem;
  }
  .header-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Theme Toggle Button ────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--text);
  transition: background .2s, border-color .2s, color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.theme-toggle:hover { background: var(--bg); border-color: var(--primary); }
.theme-icon { display: flex; align-items: center; }
/* Light mode → show moon (click to go dark) */
.theme-icon--sun  { display: none; }
.theme-icon--moon { display: flex; }
/* Dark mode → show sun (click to go light) */
[data-theme="dark"] .theme-icon--sun  { display: flex; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 60px 20px 40px;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.hero-icon { font-size: 3.5rem; display: block; margin-bottom: 16px; }
.hero h1   {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.7;
}
.trust-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
}
.trust-bar span::before { content: "✓ "; }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn:hover        { background: var(--accent); color: #fff; }
.btn:active       { transform: scale(.98); }
.btn-full         { width: 100%; padding: 15px; }
.btn-sm           { padding: 9px 18px; font-size: .875rem; }
.btn-outline      { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: #eff6ff; color: var(--accent); }
.btn-white        { background: #fff; color: var(--primary); }
.btn-white:hover  { background: #f0f4ff; color: var(--accent); }
.btn-success      { background: var(--success); }
.btn-success:hover { background: #15803d; }

/* Share / copy-link button */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #f0fdf4;
  color: var(--success);
  border: 1.5px solid #86efac;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  margin-top: 12px;
}
.share-btn:hover { background: #dcfce7; }

/* Global social share menu (FSShare.openMenu) */
.fs-share-menu {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 6px 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.fs-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s;
}
.fs-share-item i {
  font-size: 1rem;
  width: 1.25em;
  text-align: center;
}
.fs-share-item:hover {
  background: var(--bg);
  color: var(--primary);
}
[data-theme="dark"] .fs-share-menu {
  background: var(--white);
  border-color: var(--border);
}
[data-theme="dark"] .fs-share-item:hover {
  background: var(--bg);
}

/* Visible share bar (6 buttons: X, Threads, Telegram, Facebook, Reddit, WhatsApp) */
.fs-share-section { padding-bottom: 32px; }
.fs-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.fs-share-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.fs-share-bar-btn i {
  font-size: 1.125rem;
}
.fs-share-bar-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}
[data-theme="dark"] .fs-share-bar-btn {
  background: var(--white);
  border-color: var(--border);
}
[data-theme="dark"] .fs-share-bar-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── CTA Banner ─────────────────────────────────────────── */
.cta-block {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 64px 20px;
  text-align: center;
}
.cta-block h2 { font-size: 1.75rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.cta-block p  { color: #bfdbfe; font-size: 1rem; max-width: 500px; margin: 0 auto 24px; }

/* ── Nav Tools Dropdown ─────────────────────────────────── */
.nav-tools-dropdown { position: relative; padding-top: 4px; }
.nav-tools-btn {
  background: none;
  border: none;
  color: var(--subtle);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  line-height: 1;
  transition: color .2s;
  text-decoration: none;
}
.nav-tools-btn:hover { color: var(--primary); }
.nav-tools-btn.active { color: var(--primary); font-weight: 700; }
.nav-tools-btn svg { transition: transform .2s; }
.nav-tools-btn.open svg { transform: rotate(180deg); }
.nav-tools-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 170px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 200;
  padding: 6px 0;
  overflow: hidden;
}
.nav-tools-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-tools-menu a {
  display: block;
  padding: 10px 18px;
  font-size: .875rem;
  color: var(--text);
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-tools-menu a:hover { background: var(--bg); color: var(--primary); }
.nav-tools-menu a.active { color: var(--primary); font-weight: 700; }
.nav-tools-menu a + a { border-top: 1px solid var(--border); }
[data-theme="dark"] .nav-tools-menu {
  background: #1e293b;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
[data-theme="dark"] .nav-tools-menu a { color: rgba(255,255,255,.7); }
[data-theme="dark"] .nav-tools-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
[data-theme="dark"] .nav-tools-menu a.active { color: #60a5fa; }
[data-theme="dark"] .nav-tools-menu a + a { border-color: rgba(255,255,255,.08); }
@media (max-width: 600px) {
  .nav-tools-dropdown { width: 100%; }
  .nav-tools-btn {
    padding: 12px 0;
    font-size: 1rem;
    width: 100%;
    justify-content: space-between;
  }
  .nav-tools-menu {
    position: static;
    transform: none !important;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    display: none;
    padding: 0 0 8px 16px;
  }
  .nav-tools-menu.open { display: block; }
  .nav-tools-menu a { padding: 10px 0; font-size: .9375rem; }
  .nav-tools-menu a + a { border: none; }
  [data-theme="dark"] .nav-tools-menu { background: transparent; }
}

/* ── Language Dropdown (header — used on every page) ────── */
.lang-dropdown {
  position: relative;
}
.lang-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--subtle);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
  white-space: nowrap;
}
.lang-dropdown-btn:hover,
.lang-dropdown-btn.open {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}
.lang-dropdown-btn svg:last-child {
  transition: transform .2s ease;
}
.lang-dropdown-btn.open svg:last-child {
  transform: rotate(180deg);
}
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 300;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
}
.lang-dropdown-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.lang-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--subtle);
  transition: background .12s, color .12s;
}
.lang-dropdown-menu a:hover {
  background: var(--bg);
  color: var(--primary);
}
.lang-dropdown-menu a.active {
  color: var(--accent, #2563eb);
  background: #eff6ff;
}
.lang-dropdown-menu a + a {
  border-top: 1px solid var(--border);
}
.lang-code {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  min-width: 22px;
}
.lang-name {
  font-size: .82rem;
  font-weight: 400;
}
[data-theme="dark"] .lang-dropdown-btn {
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.55);
}
[data-theme="dark"] .lang-dropdown-btn:hover,
[data-theme="dark"] .lang-dropdown-btn.open {
  border-color: #60a5fa;
  color: #60a5fa;
}
[data-theme="dark"] .lang-dropdown-menu {
  background: #1e293b;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
[data-theme="dark"] .lang-dropdown-menu a {
  color: rgba(255,255,255,.6);
}
[data-theme="dark"] .lang-dropdown-menu a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
[data-theme="dark"] .lang-dropdown-menu a.active {
  background: #1e3a5f;
  color: #60a5fa;
}
[data-theme="dark"] .lang-dropdown-menu a + a {
  border-color: rgba(255,255,255,.08);
}

/* ── Footer ─────────────────────────────────────────────── */
footer   { background: #111827; padding: 28px 20px; text-align: center; }
footer p { color: #9ca3af; font-size: .825rem; line-height: 1.7; margin-top: 10px; }
footer a { color: #60a5fa; }

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.footer-social-label {
  font-size: .825rem;
  font-weight: 600;
  color: #e5e7eb;
}
.footer-social-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-social-links a {
  font-size: 1.25rem;
  color: #bfdbfe;
  transition: color .15s;
}
.footer-social-links a:hover {
  color: #fff;
}

/* ── Section Typography ─────────────────────────────────── */
.section-heading { font-size: 1.75rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.section-sub     { color: var(--muted); margin-bottom: 28px; }

/* Badge / label pill */
.tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tag-success { background: #f0fdf4; color: var(--success); }
.tag-warning { background: #fffbeb; color: var(--warning); }
.tag-danger  { background: #fef2f2; color: var(--danger); }

/* ── Educational / Rich-text Blocks ────────────────────── */
.edu-text    { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); }
.edu-text h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.edu-text p  { color: var(--subtle); line-height: 1.8; margin-bottom: 12px; font-size: .95rem; }
.edu-text ul { padding-left: 20px; margin-bottom: 12px; }
.edu-text li { color: var(--subtle); font-size: .95rem; line-height: 1.8; margin-bottom: 4px; }

/* ── Responsive Base ────────────────────────────────────── */
@media (max-width: 640px) {
  .hero    { padding: 40px 16px 28px; }
  .section { padding: 0 16px 40px; }
  .card    { padding: 20px; }
}

/* ── Dark Mode — Component Overrides ────────────────────── */
[data-theme="dark"] .hero {
  background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
}
[data-theme="dark"] .btn-outline:hover { background: #1e3a5f; }
[data-theme="dark"] .btn-white         { background: #1e293b; color: #60a5fa; }
[data-theme="dark"] .btn-white:hover   { background: #273449; color: #93c5fd; }
[data-theme="dark"] .share-btn {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #065f46;
}
[data-theme="dark"] .share-btn:hover { background: #065f46; }
[data-theme="dark"] .tag             { background: #1e3a5f; }
[data-theme="dark"] .tag-success     { background: #064e3b; color: #4ade80; }
[data-theme="dark"] .tag-warning     { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .tag-danger      { background: #450a0a; color: #f87171; }
[data-theme="dark"] footer           { background: #020617; }
[data-theme="dark"] footer p         { color: #64748b; }
[data-theme="dark"] footer a         { color: #60a5fa; }
[data-theme="dark"] .cta-block p     { color: #bfdbfe; }
