/* =====================================================
   FONTLIX — Design System v2.0
   Phase 5 — Full UI/UX Redesign
   Orange #E8620A + White Header + Navy #1B3B6F Footer
   ===================================================== */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Brand Colors */
  --orange:     #E8620A;
  --orange-l:   #FFF1EC;
  --orange-d:   #C4510A;
  --navy:       #1B3B6F;
  --navy-d:     #0D1B35;

  /* Semantic — Light theme */
  --bg:         #F4F4F6;
  --surface:    #FFFFFF;
  --surface-2:  #F9F9FB;
  --border:     #E4E4EA;
  --border-2:   #CFCFD8;

  /* Text */
  --text:       #0C0C14;
  --text-2:     #555566;
  --text-3:     #9595A8;

  /* Primary = Orange */
  --pri:        #E8620A;
  --pri-l:      #FFF1EC;
  --pri-d:      #C4510A;

  /* Shadows */
  --sh:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh-2: 0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --sh-3: 0 12px 40px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  /* Radius */
  --r:   14px;
  --rs:  10px;
  --rx:  8px;
  --rp:  20px;

  /* Spacing */
  --sp-xs: 6px;
  --sp-sm: 12px;
  --sp-md: 20px;
  --sp-lg: 32px;
  --sp-xl: 48px;

  /* Keep legacy vars for backward compat */
  --card: #FFFFFF;
  --green: #059669;
  --green-l: #ecfdf5;
  --purple: #7c3aed;
  --blue: #2563eb;
  --rose: #e11d48;
  --amber: #d97706;
  --cyan: #0891b2;
  --border2: #CFCFD8;
  --text2: #555566;
  --text3: #9595A8;
  --sh2: 0 4px 14px rgba(0,0,0,.08);
  --sh3: 0 12px 40px rgba(0,0,0,.12);
}

/* ── Typography ── */
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  line-height: 1.5;
}

/* ── HEADER — Light White ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,.04);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-word, .logo-word .f, .logo-word .dot { display: none !important; }
.logo-wordmark {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.logo-wordmark .lw-bold { font-weight: 800; }
.logo-wordmark .lw-light { font-weight: 300; }

/* Nav — centered */
nav {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
nav a, .nav-btn {
  text-decoration: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--rx);
  transition: background .15s, color .15s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  white-space: nowrap;
}
nav a:hover, .nav-btn:hover {
  background: var(--bg);
  color: var(--text);
}
nav a.active {
  color: var(--orange);
  background: var(--orange-l);
  font-weight: 600;
}

/* Header Right */
.header-right { display: flex; align-items: center; gap: 10px; }
.all-tools-btn {
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--rx);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  letter-spacing: 0.1px;
}
.all-tools-btn:hover { background: var(--orange-d); transform: translateY(-1px); }

/* ── MAIN LAYOUT ── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 0 60px;
}

/* ── BREADCRUMB ── */
.breadcrumb { padding: 14px 24px 4px; }
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-size: 12px;
  color: var(--text-3);
}
.breadcrumb li::after { content: '/'; margin-left: 6px; opacity: 0.5; }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }

/* ── TOOL PAGE CONTAINER ── */
.tool-page {
  background: var(--surface);
  border-radius: var(--r);
  margin: 8px 16px 16px;
  padding: 24px 0 8px;
  border: 1px solid var(--border);
  box-shadow: var(--sh);
}

/* ── TOOL HEADER ── */
.tool-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0 24px 20px;
}
.tool-icon-large {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  transition: transform .2s;
}
.tool-header h1 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.tool-info {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 10px;
  line-height: 1.5;
}
.tool-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--rp);
  background: var(--orange-l);
  color: var(--orange);
  letter-spacing: 0.2px;
}

/* ── INPUT SECTION ── */
.input-section { padding: 0 24px 16px; }
.input-wrap { position: relative; }
#toolInput {
  width: 100%;
  padding: 14px 44px 14px 16px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#toolInput:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232,98,10,.1);
}
#toolInput::placeholder { color: var(--text-3); }
.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 16px;
  display: none;
  padding: 4px;
  line-height: 1;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.clear-btn:hover { background: var(--bg); color: var(--text); }
.count-row {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.count-row b { color: var(--orange); font-weight: 700; }

/* ── STYLE CARDS GRID ── */
#toolGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 4px 16px 16px;
}
#toolStats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 4px 16px 16px;
}

/* ── OUTPUT CARD (.sc) ── */
.sc {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardIn .3s ease-out both;
}
.sc:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 12px rgba(232,98,10,.12);
  transform: translateY(-1px);
}
.sc.copied {
  border-color: var(--orange);
  background: var(--orange-l);
}
.sc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sc-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex: 1;
}
.sc-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  font-family: inherit;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}
.sc-btn:hover { background: var(--orange-d); }
.sc-prev {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 17px;
  line-height: 1.5;
  word-break: break-all;
  color: var(--text);
  min-height: 28px;
  padding: 2px 0;
}

/* Stat card */
.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  padding: 16px;
  text-align: center;
}
.stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── AD SLOT ── */
.ad-slot {
  padding: 12px 16px;
  min-height: 90px;
}

/* ── TOOL ARTICLE ── */
.tool-article {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.75;
  padding: 0 16px;
  max-width: 900px;
  margin: 0 auto;
}
.tool-article h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}
.tool-article h2:first-child { margin-top: 20px; }
.tool-article h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}
.tool-article p { margin-bottom: 12px; }
.tool-article ol, .tool-article ul {
  padding-left: 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-article li { line-height: 1.7; }
.tool-article li::marker { color: var(--orange); font-weight: 700; }
.tool-article b, .tool-article strong { color: var(--text); font-weight: 700; }
.tool-article code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--orange);
}

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.faq {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  overflow: hidden;
  transition: border-color .2s;
}
.faq:hover { border-color: var(--border-2); }
.faq summary {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
  line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-3);
  transition: .2s;
  line-height: 24px;
  text-align: center;
}
.faq[open] { border-color: var(--orange); }
.faq[open] summary {
  color: var(--orange);
  background: var(--orange-l);
  border-bottom: 1px solid rgba(232,98,10,.12);
  font-weight: 700;
}
.faq[open] summary::after {
  content: '−';
  background: var(--orange);
  color: #fff;
}
.faq p { padding: 12px 16px 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin: 0; }

/* ── RELATED TOOLS ── */
.related-section { padding: 24px 16px 32px; }
.related-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  text-decoration: none;
  transition: border-color .2s, box-shadow .15s, transform .15s;
  cursor: pointer;
}
.related-card:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 10px rgba(232,98,10,.1);
  transform: translateY(-1px);
}
.related-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.related-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.related-desc { font-size: 11px; color: var(--text-3); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── FOOTER — Navy ── */
footer {
  background: var(--navy);
  padding: 0;
  margin-top: 48px;
}
.footer-top {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 48px 40px 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  margin-bottom: 14px;
}
.footer-wordmark {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
}
.footer-wordmark span { font-weight: 300; }
.footer-tagline {
  font-size: 12px;
  color: rgba(255,255,255,.35);
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 220px;
}
.footer-stats { display: flex; gap: 18px; }
.footer-stats .stat-n {
  font-size: 18px;
  font-weight: 800;
  color: var(--orange);
  display: block;
  line-height: 1;
  font-family: 'DM Sans', sans-serif;
}
.footer-stats .stat-l {
  font-size: 10px;
  color: rgba(255,255,255,.25);
  letter-spacing: 0.5px;
  display: block;
  margin-top: 3px;
}
.footer-col { display: flex; flex-direction: column; gap: 0; }
.footer-col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin-bottom: 14px;
}
.footer-col a {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .15s;
  padding: 4px 0;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy { font-size: 12px; color: rgba(255,255,255,.2); }
.footer-copy strong { color: var(--orange); font-weight: 600; }
.footer-badges { display: flex; gap: 8px; }
.footer-badges span {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.25);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ── Platform Counter ── */
.platform-counter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.counter-platform { color: var(--text-3); font-weight: 500; }
.counter-num {
  font-weight: 700;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.counter-num.warn { color: #d97706; }
.counter-num.over { color: #dc2626; }
.counter-over { color: #dc2626; font-size: 11px; }

/* ── Blog CTA ── */
.tool-cta-blog {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--orange-l);
  border: 1.5px solid var(--orange);
  border-radius: var(--rs);
  padding: 14px 18px;
  margin: 24px 0;
}
.tool-cta-text { font-size: 14px; font-weight: 600; color: var(--orange); }
.tool-cta-btn {
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--rx);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.tool-cta-btn:hover { background: var(--orange-d); }

/* ── Animations ── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ci {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  header { padding: 0 16px; height: 58px; }
  nav { display: none; }
  .tool-page { margin: 8px; }
  .tool-header { padding: 0 16px 16px; gap: 12px; }
  .tool-header h1 { font-size: 18px; }
  .tool-icon-large { width: 44px; height: 44px; font-size: 20px; }
  .input-section { padding: 0 16px 12px; }
  #toolGrid { grid-template-columns: 1fr; padding: 4px 12px 12px; gap: 8px; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 20px 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; padding: 18px 20px; }
  .footer-badges { justify-content: center; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .tool-header { flex-direction: column; }
  .tool-icon-large { width: 40px; height: 40px; }
}
