/*
Theme Name: OmniCalc Ultra Math Pro Suite v5
Theme URI: https://omnicalc.example.com/math-pro-v5
Author: OmniCalc Engineering Team
Author URI: https://omnicalc.example.com/
Description: Complete Enterprise WordPress Theme for Mathematics Calculators with 79 dedicated Math Solvers mapped to /calculators/math/{slug}, live validation, worked examples, action buttons (Copy, Print, Download PDF, Share), JSON-LD Schemas, and WCAG AA compliance.
Version: 5.0.0
License: GNU General Public License v2 or later
Text Domain: omnicalc-math-pro-v5
Tags: mathematics, calculators, algebra, calculus, geometry, statistics, dark-mode
*/

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-secondary: #7c3aed;
  --brand-accent: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  
  --border-light: #e2e8f0;
  --border-focus: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #141b2d;
  --bg-card-hover: #1e293b;
  --bg-glass: rgba(20, 27, 45, 0.85);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-secondary: #8b5cf6;
  --brand-accent: #34d399;
  
  --border-light: #1e293b;
  --border-focus: #60a5fa;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: var(--font-sans); background-color: var(--bg-main); color: var(--text-primary); line-height: 1.6; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* Sticky Header Navigation */
.header { position: sticky; top: 0; z-index: 100; background-color: var(--bg-glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light); }
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; height: 4.25rem; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.35rem; color: var(--text-primary); text-decoration: none; }
.logo-icon { width: 2.25rem; height: 2.25rem; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: #fff; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-link { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-link:hover { color: var(--brand-primary); }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.search-trigger { display: flex; align-items: center; gap: 0.75rem; background-color: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-muted); padding: 0.5rem 1rem; border-radius: var(--radius-md); cursor: pointer; font-size: 0.9rem; }
.search-trigger:hover { border-color: var(--brand-primary); color: var(--text-primary); }
.kbd-shortcut { background-color: var(--bg-main); border: 1px solid var(--border-light); border-radius: 4px; padding: 0.15rem 0.4rem; font-size: 0.75rem; font-family: var(--font-mono); }
.theme-btn { background: none; border: 1px solid var(--border-light); color: var(--text-secondary); width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Hero Section */
.hero { padding: 4rem 0 2.5rem 0; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; background: rgba(37, 99, 235, 0.1); border: 1px solid rgba(37, 99, 235, 0.2); border-radius: 9999px; color: var(--brand-primary); font-weight: 600; font-size: 0.875rem; margin-bottom: 1.5rem; }
.hero-title { font-size: 3.25rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 1.25rem; }
.hero-subtitle { font-size: 1.2rem; color: var(--text-secondary); max-width: 44rem; margin: 0 auto 2.5rem auto; }

/* Calculator Grid */
.calculator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.calc-card { background-color: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 1.75rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; cursor: pointer; transition: all var(--transition-normal); }
.calc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(37, 99, 235, 0.3); }
.calc-card-icon { width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md); background: rgba(37, 99, 235, 0.1); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; }
.calc-card-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.calc-card-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 1.25rem; flex-grow: 1; }
.calc-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border-light); padding-top: 0.75rem; }
.category-tag { background-color: var(--bg-main); padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); font-weight: 600; color: var(--brand-primary); }

/* Workspace */
.calc-workspace { background-color: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 2.5rem; margin-bottom: 3rem; }
.calc-title { font-size: 2.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.calc-desc { color: var(--text-secondary); font-size: 1.05rem; }
.calc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 900px) { .calc-form-grid { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.form-input, .form-select { width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); background-color: var(--bg-main); color: var(--text-primary); font-size: 1rem; }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* Results Card */
.results-box { background: rgba(37, 99, 235, 0.03); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 2rem; }
.result-card { background-color: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1rem; }
.result-card.highlight { border-left: 4px solid var(--brand-primary); box-shadow: var(--shadow-md); }
.result-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.result-val { font-size: 1.85rem; font-weight: 800; color: var(--text-primary); }

.action-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.25rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.9rem; cursor: pointer; border: 1px solid transparent; transition: all var(--transition-fast); text-decoration: none; }
.btn-primary { background-color: var(--brand-primary); color: #fff; }
.btn-primary:hover { background-color: var(--brand-primary-hover); }
.btn-outline { background-color: var(--bg-card); border-color: var(--border-light); color: var(--text-primary); }
.btn-outline:hover { background-color: var(--bg-card-hover); }

/* Steps */
.steps-container { margin-top: 2rem; background-color: var(--bg-main); border-radius: var(--radius-md); padding: 1.5rem; }
.steps-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.step-item { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-secondary); padding: 0.4rem 0; }

/* Modals */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--transition-fast); }
.modal-backdrop.active { opacity: 1; pointer-events: auto; }
.modal-content { background-color: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); width: 90%; max-width: 720px; max-height: 85vh; overflow-y: auto; padding: 2.5rem; box-shadow: var(--shadow-lg); position: relative; }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

/* Footer */
.footer { background-color: var(--bg-card); border-top: 1px solid var(--border-light); padding: 4rem 0 2rem 0; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 3rem; margin-bottom: 3rem; }
@media (max-width: 992px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text-primary); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.65rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--brand-primary); }
.footer-bottom { border-top: 1px solid var(--border-light); padding-top: 2rem; display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 0.85rem; }

@media print {
  .header, .footer, .nav-actions, .action-bar { display: none !important; }
  body { background-color: #fff !important; color: #000 !important; }
  .calc-workspace { box-shadow: none !important; border: none !important; padding: 0 !important; }
}
