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

:root {
  --font-display: 'Space Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1a1a1a;
  --text: #e8e8e8;
  --text-muted: #888;
  --border: #222;
  --radius: 6px;
  --accent: #3b82f6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

header { border-bottom: 1px solid var(--border); padding: 16px 0; position: sticky; top: 0; background: var(--bg); z-index: 100; }
header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--accent); }
nav { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
nav a:hover { color: var(--text); text-decoration: none; }

.hero { padding: 50px 0 30px; }
.hero h1 { font-family: var(--font-display); font-size: 2.2rem; margin-bottom: 12px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 700px; }

.breadcrumb { font-size: 0.85rem; margin-bottom: 16px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span { color: var(--text-muted); margin: 0 6px; }

/* Explainer Content */
.explainer-section { max-width: 800px; margin: 0 auto; padding: 20px 0; }
.explainer-section h2 { font-family: var(--font-display); font-size: 1.4rem; color: var(--accent); margin: 32px 0 12px; }
.explainer-section h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.explainer-section p { color: var(--text-muted); margin-bottom: 16px; line-height: 1.7; }
.explainer-section ul, .explainer-section ol { color: var(--text-muted); margin: 0 0 16px 24px; }
.explainer-section li { margin-bottom: 6px; line-height: 1.6; }
.explainer-section pre { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; font-family: var(--font-display); font-size: 0.85rem; margin-bottom: 16px; color: var(--text-muted); }
.explainer-section code { font-family: var(--font-display); background: var(--bg-card); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }

/* Tool Card */
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin: 20px 0;
}
.tool-card h3 { margin-bottom: 16px; color: var(--accent); font-family: var(--font-display); font-size: 1rem; }

/* Form Controls */
.control-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.control-group select, .control-group input[type="number"], .control-group input[type="text"] {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 8px 12px; font-family: var(--font-body); font-size: 0.9rem;
}
.control-group select:focus, .control-group input:focus { outline: none; border-color: var(--accent); }
.slider-group { flex: 1; min-width: 200px; }
.slider-group input[type="range"] {
  width: 100%; appearance: none; height: 6px; background: var(--border); border-radius: 3px; outline: none;
}
.slider-group input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; background: var(--accent); border-radius: 50%; cursor: pointer;
}
.slider-value { font-family: var(--font-display); font-size: 0.9rem; color: var(--accent); }

.btn {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius);
  padding: 10px 24px; font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-secondary:hover { background: rgba(59,130,246,0.08); opacity: 1; }

/* Stat Grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center;
}
.stat-card .value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }

/* Results */
.results-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin: 20px 0;
}

/* Canvas container for visualizations */
.viz-container {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 20px 0; overflow: hidden;
}
.viz-container canvas { display: block; width: 100%; }

/* FAQ Section */
.faq-section { margin: 40px 0 0; max-width: 800px; margin-left: auto; margin-right: auto; }
.faq-section h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 20px; }
details { border-bottom: 1px solid var(--border); padding: 16px 0; }
details:first-of-type { border-top: 1px solid var(--border); }
summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: '+'; color: var(--accent); font-size: 1.2rem; }
details[open] summary::after { content: '\2212'; }
details p { color: var(--text-muted); padding-top: 8px; line-height: 1.6; }

/* Last Updated */
.last-updated { font-size: 0.8rem; color: var(--text-muted); margin: 24px 0; max-width: 800px; margin-left: auto; margin-right: auto; }

/* Related Grid */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 16px 0; }
.related-card {
  display: block; padding: 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); transition: border-color 0.2s;
}
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card .related-title { font-weight: 600; margin-bottom: 4px; }
.related-card .related-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Blog list */
.blog-list { list-style: none; }
.blog-list li { border-bottom: 1px solid var(--border); padding: 20px 0; }
.blog-list h3 { margin-bottom: 6px; }
.blog-list h3 a { color: var(--text); }
.blog-list h3 a:hover { color: var(--accent); }
.blog-list .meta { color: var(--text-muted); font-size: 0.85rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; padding: 12px; border-bottom: 2px solid var(--border); color: var(--accent); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: var(--bg-hover); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: rgba(52,211,153,0.12); color: #34D399; }
.badge-blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.badge-orange { background: rgba(251,146,60,0.12); color: #FB923C; }
.badge-red { background: rgba(248,113,113,0.12); color: #F87171; }

/* Checklist */
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: background 0.15s; }
.checklist li:hover { background: var(--bg-hover); }
.checklist li.checked { opacity: 0.6; }
.checklist li.checked .check-icon { color: var(--accent); }
.check-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ============================================
   FOOTER — V14 STANDARDIZED
   Do NOT modify individual properties per site.
   This CSS is identical across all 18 domains.
   ============================================ */
.site-footer {
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    margin-top: 4rem;
    padding: 0;
}
.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    text-align: center;
}
.footer-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #e4e2f0);
    letter-spacing: -0.01em;
}
.footer-tagline {
    font-size: 0.8rem;
    color: var(--text-dim, #666);
    margin-top: 0.3rem;
    margin-bottom: 1.5rem;
}
.footer-cta {
    display: inline-block;
    padding: 0.6rem 1.75rem;
    border: 1.5px solid var(--accent, #3b82f6);
    border-radius: 6px;
    color: var(--accent, #3b82f6);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.footer-cta:hover {
    background: var(--accent, #3b82f6);
    color: #fff;
    text-decoration: none;
}
.footer-copy {
    font-size: 0.7rem;
    color: var(--text-dim, #555);
    margin-top: 1.25rem;
}
.footer-copy a {
    color: inherit;
    text-decoration: none;
}
.footer-copy a:hover {
    text-decoration: underline;
}
.zovo-network {
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    padding: 2rem 2rem 3rem;
    text-align: center;
}
.zovo-network-inner {
    max-width: 720px;
    margin: 0 auto;
}
.zovo-network-title {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text, #e4e2f0);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 1rem;
}
.zovo-network-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.25rem;
}
.zovo-network-links a {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
    line-height: 1.9;
}
.zovo-network-links a:hover {
    color: var(--accent, #3b82f6);
}
@media (max-width: 640px) {
    .footer-inner { padding: 2.5rem 1.5rem 1.5rem; }
    .footer-cta { padding: 0.55rem 1.25rem; font-size: 0.8rem; }
    .zovo-network { padding: 1.5rem 1.5rem 2.5rem; }
    .zovo-network-links { gap: 0.3rem 1rem; }
    .zovo-network-links a { font-size: 0.72rem; }
}

/* === V5: Nav Pro + Zovo Tools === */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
.nav-pro {
  background: var(--accent);
  color: #fff !important;
  padding: 5px 13px;
  border-radius: var(--radius, 6px);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-pro:hover { opacity: 0.85; }
.nav-zovo {
  color: var(--text-muted, #888) !important;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-zovo:hover { color: var(--text, #e8e8e8) !important; }

/* === V5: Pro Nudge === */
.pro-nudge {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(59,130,246,0.06);
  border: 1px solid var(--accent, #3b82f6);
  border-radius: var(--radius, 8px);
  animation: v5-nudge-in 0.3s ease;
}
.pro-nudge-inner { display: flex; align-items: flex-start; gap: 0.75rem; }
.pro-nudge-icon { font-size: 1.15rem; flex-shrink: 0; line-height: 1.4; }
.pro-nudge-text { font-size: 0.88rem; color: var(--text-muted, #888); line-height: 1.55; }
.pro-nudge-text strong { color: var(--text, #e8e8e8); }
.pro-nudge-text a { color: var(--accent); font-weight: 600; text-decoration: underline; }
@keyframes v5-nudge-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Overflow Prevention — V33 Fix */
pre, code, samp, kbd { overflow-x: auto; max-width: 100%; }
table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.output-box, .result-box, .tool-output, .code-block { overflow-x: auto; max-width: 100%; word-break: break-all; }
main, .tool-container, .research-content, .article-content { overflow-x: hidden; max-width: 100%; }

@media (max-width: 768px) {
  body { overflow-x: hidden; }
  .hero h1 { font-size: 1.5rem; }
  .control-row { flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr; }
  nav { gap: 12px; }
  pre, code, samp { white-space: pre-wrap; overflow-x: auto; max-width: 100%; }
  table { font-size: 0.85rem; }
  .output-box, .result-box, .tool-output { font-size: 0.8rem; word-break: break-all; overflow-wrap: break-word; }
}
