:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-hover: #1d4ed8;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 26px;
}

.logo-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 14px;
  outline: none;
  background-color: var(--bg);
  transition: border-color 0.2s, background-color 0.2s;
}

.header-search input:focus {
  border-color: var(--primary-light);
  background-color: var(--surface);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.nav-link:hover {
  color: var(--primary-light);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs span.separator {
  color: #cbd5e1;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 992px) {
  .layout-grid {
    grid-template-columns: 1fr 320px;
  }
}

.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: white;
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
}

.hero-banner h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.25;
}

.hero-banner p {
  font-size: 17px;
  color: #bfdbfe;
  max-width: 700px;
  margin: 0 auto 24px auto;
}

/* AdSense Slot Styles */
.adsense-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  background-color: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  min-height: 100px;
  text-align: center;
  padding: 12px;
}

.adsense-slot.top-banner {
  min-height: 90px;
  margin: 16px 0 24px 0;
}

.adsense-slot.in-content {
  min-height: 250px;
  margin: 32px 0;
}

.adsense-slot.sidebar-ad {
  min-height: 600px;
  margin: 0 0 24px 0;
}

.adsense-slot.footer-ad {
  min-height: 90px;
  margin: 32px 0;
}

.ad-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Calculator Form Styles */
.calculator-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.calculator-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.input-with-unit {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--surface);
}

.input-with-unit input, .input-with-unit select {
  border: none;
  outline: none;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
}

.input-with-unit input {
  flex: 1;
  width: 100%;
}

.input-with-unit select {
  background-color: #f1f5f9;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.calc-btn {
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.calc-btn:hover {
  background-color: var(--accent-hover);
}

.calc-btn:active {
  transform: scale(0.99);
}

.result-container {
  margin-top: 28px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.result-main-val {
  font-size: 38px;
  font-weight: 800;
  color: var(--primary);
  margin: 8px 0;
}

.result-sub {
  font-size: 15px;
  color: #1e40af;
  font-weight: 500;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #bfdbfe;
}

.detail-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e0f2fe;
}

.detail-item .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detail-item .val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* SEO Content Typography */
.content-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.content-article h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin: 28px 0 16px 0;
  line-height: 1.3;
}

.content-article h2:first-child {
  margin-top: 0;
}

.content-article h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 12px 0;
}

.content-article p {
  margin-bottom: 16px;
  color: #334155;
  font-size: 16px;
  line-height: 1.7;
}

.content-article ul, .content-article ol {
  margin: 0 0 20px 24px;
  color: #334155;
}

.content-article li {
  margin-bottom: 8px;
}

.formula-box {
  background-color: #f1f5f9;
  border-left: 4px solid var(--primary-light);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-family: monospace, sans-serif;
  font-size: 15px;
  color: var(--primary);
}

/* Tools Directory Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.tool-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.tool-card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.tool-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* FAQ Accordion */
.faq-section {
  margin: 32px 0;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-question::after {
  content: "＋";
  font-size: 18px;
  color: var(--primary-light);
}

.faq-item.open .faq-question::after {
  content: "－";
}

.faq-answer {
  display: none;
  padding: 0 20px 20px 20px;
  color: #475569;
  font-size: 15px;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Footer */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 60px 0 30px 0;
  margin-top: 60px;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: white;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #94a3b8;
  font-size: 14px;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #1e293b;
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 768px) {
  .hero-banner {
    padding: 28px 16px;
  }
  .hero-banner h1 {
    font-size: 24px;
  }
  .calculator-card, .content-article {
    padding: 20px;
  }
  .header-search {
    display: none;
  }
}
