/*
Theme Name: Profit AI Calculator
Theme URI: https://profitaicalculator.com
Author: Profit AI Calculator Team
Author URI: https://profitaicalculator.com
Description: Premium USA-focused Financial & Business Calculators Theme. Clean fintech design, mobile-first responsive, AdSense-friendly, SEO optimized. Supports 10 pillar categories and full calculator engine.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: profitai
Tags: finance, calculator, business, mortgage, tax, responsive, custom-menu, featured-images, theme-options
*/

/* ============================================
   CSS Variables - US Fintech Clean Style
   ============================================ */
:root {
  --primary: #0f766e;          /* Teal */
  --primary-dark: #0d5c56;
  --primary-light: #14b8a6;
  --secondary: #1e3a5f;        /* Deep navy */
  --accent: #f59e0b;           /* Amber */
  --success: #059669;
  --danger: #dc2626;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container: 1200px;
  --header-h: 72px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--secondary); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p { margin-bottom: 1rem; color: var(--text-muted); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1.5rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--secondary);
  white-space: nowrap;
}
.site-logo span { color: var(--primary); }
.site-logo svg { width: 32px; height: 32px; }

.main-nav { display: none; }
.main-nav ul {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.main-nav a {
  padding: 0.5rem 0.85rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}
.main-nav a:hover, .main-nav a.active {
  background: var(--bg-alt);
  color: var(--primary);
}
.header-cta {
  display: none;
  background: var(--primary);
  color: #fff !important;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}
.header-cta:hover { background: var(--primary-dark); }

.mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: 0.3s;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: #fff;
  z-index: 999;
  padding: 1.5rem;
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}
.mobile-menu a:hover { color: var(--primary); background: var(--bg-alt); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f766e 0%, #1e3a5f 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero h1 {
  color: #fff;
  margin-bottom: 0.75rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.hero .subtitle {
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto 2rem;
  color: #e0f2f1;
}
.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  box-shadow: var(--shadow-lg);
  outline: none;
}
.hero-search .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.hero-examples {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.85;
}
.hero-examples a {
  color: #fff;
  text-decoration: underline;
  margin: 0 0.35rem;
}

/* Category Grid - 10 Pillars */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.pillar-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: #ecfdf5;
  color: var(--primary);
}
.pillar-card h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--secondary);
}
.pillar-card p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
}
.pillar-card .count {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

/* Calculator Layout */
.calculator-page {
  padding: 2rem 0 4rem;
}
.calc-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.calc-inputs, .calc-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.calc-inputs h2, .calc-results h2 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.form-group {
  margin-bottom: 1.15rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.btn-calculate {
  width: 100%;
  padding: 0.95rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.btn-calculate:hover { background: var(--primary-dark); }
.btn-reset {
  width: 100%;
  padding: 0.7rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.6rem;
}
.btn-reset:hover { background: var(--bg-alt); }

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.result-item:last-child { border-bottom: none; }
.result-label { color: var(--text-muted); font-size: 0.95rem; }
.result-value {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--secondary);
}
.result-value.highlight {
  color: var(--primary);
  font-size: 1.4rem;
}
.result-breakdown {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.ai-insights {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.ai-insights h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ai-insights ul { padding-left: 1.1rem; list-style: disc; }
.ai-insights li {
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.95rem;
}

/* Content sections after calculator */
.calc-content {
  max-width: 800px;
  margin: 0 auto;
}
.calc-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.calc-content h3 { margin-top: 1.75rem; margin-bottom: 0.6rem; }
.formula-box {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.95rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
}
.faq-item.open .faq-answer {
  padding: 1rem 1.25rem;
  max-height: 500px;
}

/* Related Calculators */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.related-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: all 0.2s;
}
.related-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.related-card h4 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.related-card p { font-size: 0.8rem; margin: 0; }

/* Ad placeholders - clearly separated, AdSense friendly */
.ad-slot {
  background: var(--bg-alt);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 2rem 0;
  text-align: center;
  padding: 1rem;
}
/* Important: Keep ads away from buttons and inputs */

/* Disclaimer */
.disclaimer {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #92400e;
  margin: 2rem 0;
}

/* Footer */
.site-footer {
  background: var(--secondary);
  color: #e2e8f0;
  padding: 3.5rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand h3 {
  color: #fff;
  margin-bottom: 0.75rem;
}
.footer-brand p { color: #94a3b8; font-size: 0.9rem; }
.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.footer-col a {
  display: block;
  color: #94a3b8;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* Trust pages */
.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}
.page-content h1 { margin-bottom: 1.5rem; }

/* Responsive - Tablet */
@media (min-width: 768px) {
  .pillars-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .calc-wrapper {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
  .main-nav { display: block; }
  .header-cta { display: inline-block; }
  .mobile-toggle { display: none; }
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* Desktop */
@media (min-width: 1024px) {
  .pillars-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .hero { padding: 5rem 0 4rem; }
  .calc-wrapper {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }
  .calc-inputs, .calc-results {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

/* Mobile refinements */
@media (max-width: 767px) {
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 2rem; }
  .section { padding: 2.5rem 0; }
  .btn-calculate {
    position: sticky;
    bottom: 1rem;
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .ad-slot, .btn-calculate, .btn-reset { display: none !important; }
}
