/* MayoCalc Design System v1.0 */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --bg-input: #0d1322;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --accent-secondary: #a78bfa;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #f472b6;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --border-light: #334155;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }

/* Ambient BG */
.ambient-bg { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient-bg .orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .12; animation: float 20s ease-in-out infinite; }
.ambient-bg .orb-1 { width: 600px; height: 600px; top: -200px; right: -100px; }
.ambient-bg .orb-2 { width: 500px; height: 500px; bottom: -150px; left: -100px; animation-delay: -7s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Nav */
nav { position: sticky; top: 0; z-index: 100; background: rgba(10, 15, 26, 0.8); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0 24px; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text-primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-family: var(--font-body); font-weight: 700; color: var(--bg-primary); }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.88rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Page Hero */
.page-hero { padding: 60px 0 40px; text-align: center; }
.page-hero .breadcrumb { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }
.page-hero .breadcrumb a { color: var(--accent); text-decoration: none; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
.page-hero h1 .gradient-text { background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent-green)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 540px; margin: 0 auto; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Hero extras */
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; background: var(--accent-glow); border: 1px solid rgba(56,189,248,0.2); border-radius: 100px; font-size: 0.8rem; color: var(--accent); font-weight: 500; margin-bottom: 24px; animation: fadeInUp 0.6s ease; }

/* Search */
.search-wrap { max-width: 520px; margin: 0 auto 60px; position: relative; animation: fadeInUp 0.6s ease 0.3s both; }
.search-wrap input { width: 100%; padding: 16px 20px 16px 52px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; color: var(--text-primary); font-family: var(--font-body); font-size: 1rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Section labels */
.section-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); font-weight: 600; margin-bottom: 20px; }

/* Category chips */
.categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 60px; }
.cat-chip { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; color: var(--text-primary); font-size: 0.9rem; font-weight: 500; transition: all 0.2s; cursor: pointer; }
.cat-chip:hover { background: var(--bg-card-hover); border-color: var(--border-light); transform: translateY(-2px); }
.cat-chip .cat-icon { font-size: 1.2rem; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; flex-shrink: 0; }

/* Calc card grid */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 80px; }
.calc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-decoration: none; color: var(--text-primary); transition: all 0.25s; display: flex; flex-direction: column; gap: 12px; }
.calc-card:hover { background: var(--bg-card-hover); border-color: var(--border-light); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.calc-card .card-icon { font-size: 1.8rem; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--accent-glow); border-radius: 12px; }
.calc-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.calc-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }
.card-tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; align-self: flex-start; background: rgba(56,189,248,0.08); border: 1px solid rgba(56,189,248,0.15); color: var(--accent); }
.card-tag.health { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.15); color: var(--accent-green); }
.card-tag.math { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.15); color: var(--accent-secondary); }
.card-tag.lifestyle { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.15); color: var(--accent-amber); }

/* Calculator App Container */
.calculator-app { max-width: 900px; margin: 0 auto 60px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.calc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.calc-inputs { padding: 36px; border-right: 1px solid var(--border); }
.calc-results { padding: 36px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
@media (max-width: 700px) { .calc-body { grid-template-columns: 1fr; } .calc-inputs { border-right: none; border-bottom: 1px solid var(--border); } }

/* Inputs */
.input-group { margin-bottom: 24px; }
.input-group:last-child { margin-bottom: 0; }
.input-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.input-row { display: flex; align-items: center; gap: 0; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.2s; }
.input-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-prefix, .input-suffix { padding: 12px 14px; font-size: 0.9rem; color: var(--text-muted); font-weight: 500; background: rgba(255,255,255,0.02); flex-shrink: 0; user-select: none; }
.input-prefix { border-right: 1px solid var(--border); }
.input-suffix { border-left: 1px solid var(--border); }
.input-row input, .input-row select { flex: 1; padding: 12px 14px; background: transparent; border: none; color: var(--text-primary); font-family: var(--font-body); font-size: 1rem; font-weight: 500; outline: none; min-width: 0; }
.input-row select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2394a3b8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-row select option { background: var(--bg-secondary); color: var(--text-primary); }

/* Results */
.result-block { text-align: center; }
.result-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.result-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.result-value.green { color: var(--accent-green); }
.result-value.amber { color: var(--accent-amber); }
.result-value.rose { color: var(--accent-rose); }
.result-breakdown { display: flex; gap: 12px; }
.breakdown-item { flex: 1; padding: 14px; background: var(--bg-input); border-radius: var(--radius-sm); text-align: center; }
.breakdown-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.breakdown-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }

/* Progress bar */
.result-bar-wrap { padding: 0 4px; }
.result-bar { height: 12px; background: var(--bg-input); border-radius: 100px; overflow: hidden; display: flex; }
.bar-legend { display: flex; justify-content: center; gap: 20px; margin-top: 10px; }
.bar-legend span { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Tabs */
.calc-tabs { display: flex; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); }
.calc-tab { flex: 1; padding: 16px; text-align: center; font-size: 0.88rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border: none; border-bottom: 2px solid transparent; transition: all 0.2s; background: none; font-family: var(--font-body); }
.calc-tab:hover { color: var(--text-secondary); }
.calc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 36px; }
.tab-panel.active { display: block; }

/* Mode toggle */
.mode-toggle { display: flex; background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 28px; border: 1px solid var(--border); }
.mode-btn { flex: 1; padding: 10px; text-align: center; border-radius: 8px; border: none; background: transparent; color: var(--text-muted); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.mode-btn.active { background: var(--accent-glow); color: var(--accent); }

/* Tip buttons */
.tip-buttons { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tip-btn { flex: 1; min-width: 60px; padding: 10px 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center; }
.tip-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.tip-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

/* Inline calc sentence */
.calc-sentence { font-size: 1.1rem; color: var(--text-secondary); text-align: center; margin-bottom: 32px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.calc-sentence .inline-input { width: 100px; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-family: var(--font-body); font-size: 1.1rem; font-weight: 600; text-align: center; outline: none; transition: border-color 0.2s; }
.calc-sentence .inline-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.calc-sentence .inline-input.wide { width: 130px; }
.big-result { text-align: center; margin-top: 32px; padding: 32px; background: var(--bg-input); border-radius: var(--radius); border: 1px solid var(--border); }

/* Risk meter */
.risk-meter { margin: 16px 0; }
.risk-bar-bg { height: 16px; border-radius: 100px; background: linear-gradient(to right, var(--accent-green), var(--accent-amber), #f97316, var(--accent-rose), #ef4444); position: relative; }
.risk-indicator { position: absolute; top: -4px; width: 4px; height: 24px; background: var(--text-primary); border-radius: 2px; transition: left 0.5s ease; }
.risk-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.72rem; color: var(--text-muted); }
.risk-text { text-align: center; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-top: 12px; }

/* Donut */
.donut-wrap { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); }
.donut-legend-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* SEO Content */
.seo-content { max-width: 760px; margin: 0 auto; padding: 0 0 80px; }
.seo-content h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 16px; margin-top: 48px; }
.seo-content h2:first-child { margin-top: 0; }
.seo-content p { color: var(--text-secondary); font-size: 1rem; line-height: 1.75; margin-bottom: 16px; }
.seo-content strong { color: var(--text-primary); font-weight: 600; }
.formula-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 24px; margin: 20px 0; text-align: center; font-family: 'Courier New', monospace; font-size: 1.1rem; color: var(--accent); letter-spacing: 0.5px; }

/* FAQ */
.faq-section { margin-top: 48px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q { font-weight: 600; color: var(--text-primary); margin-bottom: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); flex-shrink: 0; margin-left: 16px; transition: transform 0.2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-a { max-height: 400px; }

/* Related */
.related-section { padding: 60px 0; border-top: 1px solid var(--border); }
.related-section h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; text-align: center; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; max-width: 900px; margin: 0 auto; }
.related-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; text-decoration: none; color: var(--text-primary); transition: all 0.2s; display: flex; align-items: center; gap: 14px; }
.related-card:hover { background: var(--bg-card-hover); border-color: var(--border-light); transform: translateY(-2px); }
.related-card .rc-icon { font-size: 1.5rem; flex-shrink: 0; }
.related-card h3 { font-size: 0.95rem; font-weight: 600; }
.related-card p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* Disclaimer */
.disclaimer { background: rgba(251,191,36,0.05); border: 1px solid rgba(251,191,36,0.15); border-radius: var(--radius-sm); padding: 16px 20px; margin: 24px 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.disclaimer strong { color: var(--accent-amber); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 40px 24px; text-align: center; }
footer .footer-inner { max-width: 1200px; margin: 0 auto; }
footer p { color: var(--text-muted); font-size: 0.85rem; }
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--text-primary); }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .page-hero { padding: 40px 0 30px; }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .result-breakdown { flex-direction: column; gap: 8px; }
  .calc-inputs, .calc-results { padding: 24px; }
  .result-value { font-size: 1.8rem; }
  .related-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .calc-sentence { font-size: 1rem; }
  .calc-sentence .inline-input { width: 80px; font-size: 1rem; }
}
