/* ============================================================
   shared.css — CalculatorAha.com
   Common styles used across all pages.
   Import with: <link rel="stylesheet" href="shared.css">
   (use href="../shared.css" from /other/ pages)
   ============================================================ */

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

/* ── CSS VARIABLES (Light mode default) ── */
:root {
  --navy:      #1a3a5c;
  --navy-dark: #122a45;
  --blue:      #1a6fc4;
  --blue-h:    #1558a0;
  --blue-bg:   #e8f0fb;
  --white:     #ffffff;
  --off:       #f5f7fa;
  --border:    #d8dde6;
  --text:      #1a1a2e;
  --text2:     #444444;
  --text3:     #777777;
  --radius:    6px;
  --shadow:    0 1px 4px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);

  /* Category accent colours */
  --math:    #1a6fc4;
  --finance: #1a7c4e;
  --health:  #c4501a;
  --other:   #7c1ac4;

  /* Topbar */
  --topbar-bg: #f6f2e6;

  /* Dark mode toggle button */
  --toggle-bg: rgba(255,255,255,.15);
}

/* ── DARK MODE OVERRIDES ── */
[data-theme="dark"] {
  --navy:      #7eaacc;
  --navy-dark: #5a8ab0;
  --blue:      #5ba4e8;
  --blue-h:    #3d8ed0;
  --blue-bg:   #1a2a3a;
  --white:     #1e1e2e;
  --off:       #121220;
  --border:    #2e3050;
  --text:      #e8eaf0;
  --text2:     #b0b8cc;
  --text3:     #7880a0;
  --shadow:    0 1px 4px rgba(0,0,0,.40);
  --shadow-md: 0 4px 16px rgba(0,0,0,.50);
  --topbar-bg: #1a1a2e;
}

/* ── BASE RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: var(--off);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background .2s, color .2s;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOP BAR ── */
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; min-height: 90px; gap: 16px;
  transition: background .2s;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 80px; width: auto; display: block; }
.logo-text-wrap { display: none; }
.logo-name { font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: -.5px; line-height: 1.1; }
.logo-name span { color: var(--blue); }
.logo-tagline { font-size: 11px; color: var(--text3); margin-top: 2px; font-weight: 400; }
.ad-ph { display: block; min-height: 0; height: 0; overflow: hidden; }

/* ── DARK MODE TOGGLE BUTTON ── */
.theme-toggle {
  background: var(--toggle-bg);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  font-size: 13px;
  color: #dde9f5;
  font-family: 'Open Sans', sans-serif;
  transition: background .2s;
  white-space: nowrap;
}
.theme-toggle:hover { background: rgba(255,255,255,.25); }
.theme-toggle .toggle-icon { font-size: 15px; }

/* ── NAV ── */
nav {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: background .2s;
}
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: stretch; }
.ni { position: relative; }
.ni > a, .ni > span {
  display: flex; align-items: center; gap: 4px;
  color: #dde9f5; font-size: 13px; font-weight: 600;
  padding: 0 15px; height: 44px;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s; letter-spacing: .1px;
}
.ni > a:hover, .ni > span:hover, .ni.act > a {
  background: var(--navy-dark); color: #fff; text-decoration: none;
}
.caret { font-size: 9px; opacity: .7; }
.dd {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  min-width: 200px; z-index: 200;
  transition: background .2s;
}
.ni:hover .dd { display: block; }
.dd a {
  display: block; padding: 8px 16px;
  color: var(--text2); font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.dd a:hover { background: var(--blue-bg); color: var(--blue); text-decoration: none; }
.dd a:last-child { border-bottom: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-right: 12px; }
.nsearch {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px; padding: 5px 10px;
}
.nsearch input {
  background: none; border: none; outline: none;
  color: #fff; font-size: 12px; font-family: 'Open Sans', sans-serif; width: 170px;
}
.nsearch input::placeholder { color: rgba(255,255,255,.45); }
.nsearch button { background: none; border: none; cursor: pointer; color: rgba(255,255,255,.7); font-size: 14px; padding: 0; }

/* ── LAYOUT ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 12px; }

/* ── BREADCRUMB ── */
.breadcrumb { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.breadcrumb a { color: var(--blue); }

/* ── CARD ── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 16px;
  transition: background .2s, border-color .2s;
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.card-title .cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── CALC CARD (homepage grid) ── */
.calc-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .2s, transform .2s, border-color .2s, background .2s;
  cursor: pointer; text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.calc-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--card-accent, var(--blue));
}
.calc-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-2px);
  border-color: var(--card-accent, var(--blue)); text-decoration: none;
}
.calc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.calc-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 8px;
  background: var(--card-bg, var(--blue-bg));
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.calc-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; padding: 2px 6px; border-radius: 100px;
  white-space: nowrap; flex-shrink: 0;
}
.badge-popular { background: #fff3e0; color: #e65100; }
.badge-new     { background: #e8f5e9; color: #2e7d32; }
.badge-top     { background: #e8f0fb; color: var(--blue); }
.calc-name { font-size: 14px; font-weight: 700; color: var(--card-accent, var(--blue)); line-height: 1.2; margin-top: 4px; }
.calc-desc { font-size: 12px; color: var(--text3); line-height: 1.4; flex: 1; }
.calc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.calc-searches { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 3px; }
.calc-arrow { font-size: 16px; color: var(--card-accent, var(--blue)); font-weight: 700; transition: transform .2s; }
.calc-card:hover .calc-arrow { transform: translateX(3px); }

/* ── SECTION HEADER ── */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.sec-head h2 { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sec-head h2 .cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sec-head a { font-size: 12px; color: var(--blue); font-weight: 600; }

/* ── CATEGORY TABS ── */
.cat-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.cat-tab {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 100px; font-size: 12px; font-weight: 700;
  border: 2px solid transparent; cursor: pointer; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.cat-tab:hover { text-decoration: none; transform: translateY(-1px); }
.cat-tab.math    { background: #e8f0fb; color: var(--math);    border-color: #c5d8f0; }
.cat-tab.finance { background: #e8f5ee; color: var(--finance); border-color: #b8dfc8; }
.cat-tab.health  { background: #fdf0e8; color: var(--health);  border-color: #f0cdb0; }
.cat-tab.other   { background: #f3e8fd; color: var(--other);   border-color: #d5b0f0; }
.cat-tab.math:hover    { background: var(--math);    color: #fff; border-color: var(--math); }
.cat-tab.finance:hover { background: var(--finance); color: #fff; border-color: var(--finance); }
.cat-tab.health:hover  { background: var(--health);  color: #fff; border-color: var(--health); }
.cat-tab.other:hover   { background: var(--other);   color: #fff; border-color: var(--other); }

/* ── AD PLACEHOLDER ── */
.ad-rect { display: block; min-height: 0; height: 0; overflow: hidden; margin: 0; }

/* ── WHY CARDS ── */
.why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.why-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px; text-align: center;
  transition: background .2s;
}
.why-icon { font-size: 28px; margin-bottom: 8px; }
.why-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.why-desc { font-size: 12px; color: var(--text3); line-height: 1.4; }

/* ── FOOTER ── */
.footer-bar {
  background: var(--navy); color: #fff;
  padding: 10px 20px; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; margin-top: 32px; flex-wrap: wrap; gap: 10px;
  transition: background .2s;
}
.footer-bar a { color: #a0c4e8; }
footer { background: var(--off); border-top: 1px solid var(--border); transition: background .2s; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px; padding: 28px 12px 20px;
}
.fbrand-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fbrand-name { font-size: 17px; font-weight: 700; color: var(--navy); }
.fbrand-name span { color: var(--blue); }
.fbrand p { font-size: 12px; color: var(--text3); line-height: 1.6; max-width: 280px; margin-top: 6px; }
.fcol h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); margin-bottom: 10px; }
.fcol ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.fcol ul li a { font-size: 12px; color: var(--text2); }
.fcol ul li a:hover { color: var(--blue); }
.fbot {
  border-top: 1px solid var(--border); max-width: 1200px; margin: 0 auto;
  padding: 12px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.fbot p { font-size: 11px; color: var(--text3); }
.fsoc { display: flex; gap: 6px; }
.fsoc a {
  width: 28px; height: 28px; background: var(--navy); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  transition: background .15s;
}
.fsoc a:hover { background: var(--blue); text-decoration: none; }

/* ── PAGE HEADER (inner pages) ── */
.page-header {
  background: linear-gradient(135deg, #1a3a5c 0%, #1a5a9c 100%);
  padding: 24px 20px 28px; position: relative; overflow: hidden;
}
[data-theme="dark"] .calc-name { color: #ffffff; }
[data-theme="dark"] .calc-card:hover .calc-name { color: #ffffff; }

[data-theme="dark"] .page-header {
  background: linear-gradient(135deg, #0e1e30 0%, #122a45 100%);
}
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-header-inner { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
.page-header h1 {
  font-size: 22px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.page-header h1 .icon { background: rgba(255,255,255,.15); border-radius: 8px; padding: 6px 10px; font-size: 20px; }
.page-header p { font-size: 13px; color: rgba(255,255,255,.75); max-width: 600px; }

/* ── SEARCH RESULTS (homepage) ── */
.search-results {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--white); border: 1px solid var(--blue);
  border-top: none; border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 300;
  max-height: 320px; overflow-y: auto;
}
.search-results.open { display: block; }
.sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.sr-item:hover { background: var(--blue-bg); }
.sr-item:last-child { border-bottom: none; }
.sr-icon { font-size: 20px; flex-shrink: 0; }
.sr-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sr-cat  { font-size: 11px; color: var(--text3); }
.sr-empty { padding: 14px 16px; text-align: center; color: var(--text3); font-size: 13px; }
.hero-search-wrap { position: relative; flex: 1; }

/* ── RESPONSIVE ── */
@media(max-width: 960px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media(max-width: 640px) {
  .topbar { flex-wrap: wrap; min-height: auto; }
  .ad-ph { display: block; min-height: 0; height: 0; overflow: hidden; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
}
/* ── HAMBURGER MOBILE MENU ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px; height: 44px;
  background: none; border: none;
  cursor: pointer; padding: 8px 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: #dde9f5; border-radius: 2px;
  transition: all .25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,.1);
  position: absolute; top: 100%; left: 0; right: 0;
  z-index: 500;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.mobile-nav.open {
  display: flex;
  max-height: 600px;
}
.mobile-nav-section {
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-nav-heading {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,.4);
  padding: 10px 18px 4px;
}
.mobile-nav a {
  display: block; padding: 10px 18px;
  color: #dde9f5; font-size: 14px; font-weight: 500;
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.mobile-nav a:hover { background: var(--navy-dark); color: #fff; }
.mobile-nav a:last-child { border-bottom: none; }

@media(max-width: 640px) {
  .hamburger { display: flex; }
  .nav-inner > .ni:not(:first-child):not(.nav-right) { display: none !important; }
  .nav-right { display: none !important; }
  nav { position: sticky; top: 0; }
}

