/* ==========================================================================
   CalcMaster Tools - Core Design System & Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Light Mode */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --secondary: #7c3aed;
  --secondary-light: #f5f3ff;
  --accent: #06b6d4;
  
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #f1f5f9;
  
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0284c7;
  --info-bg: #e0f2fe;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Layout */
  --container-max: 1200px;
  --header-height: 72px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-dark: #4f46e5;
  --primary-light: #1e1b4b;
  --secondary: #8b5cf6;
  --secondary-light: #2e1065;
  --accent: #22d3ee;
  
  --background: #090d16;
  --surface: #111827;
  --surface-raised: #1e293b;
  --surface-subtle: #1f293d;
  
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --border-focus: #6366f1;
  
  --success: #22c55e;
  --success-bg: #052e16;
  --warning: #f59e0b;
  --warning-bg: #451a03;
  --danger: #ef4444;
  --danger-bg: #450a0a;
  --info: #38bdf8;
  --info-bg: #082f49;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.025em; }
h2 { font-size: 1.75rem; letter-spacing: -0.02em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container-narrow {
  max-width: 900px;
}

/* --------------------------------------------------------------------------
   Global Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
  background-color: rgba(17, 24, 39, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
}

.brand-logo:hover {
  color: var(--primary);
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.brand-text span {
  color: var(--primary);
}

/* Desktop Nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  position: relative;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background-color: var(--surface);
  transition: var(--transition);
}

.header-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: var(--surface-subtle);
}

.header-btn svg {
  width: 18px;
  height: 18px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 999;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Search Modal / Live Search Dropdown
   -------------------------------------------------------------------------- */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1rem 1rem;
}

.search-modal.is-open {
  display: flex;
}

.search-modal-box {
  background-color: var(--surface);
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.search-input-wrap svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  background: transparent;
  color: var(--text);
}

.search-close-btn {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  color: var(--muted);
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.75rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.search-result-item:hover, .search-result-item:focus {
  background-color: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .search-result-item:hover {
  background-color: var(--surface-subtle);
}

.search-result-item .calc-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  color: var(--muted);
  margin-left: auto;
}

.search-no-result {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   AdSense-Ready Ad Containers
   -------------------------------------------------------------------------- */
.ad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  margin: 2rem 0;
  text-align: center;
  min-height: 100px;
  position: relative;
  overflow: hidden;
}

.ad-container .ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.ad-container .ad-placeholder-text {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.ad-top {
  margin-top: 1rem;
  margin-bottom: 2rem;
  min-height: 90px;
}

.ad-middle {
  margin: 2.5rem 0;
  min-height: 120px;
}

.ad-bottom {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  min-height: 100px;
}

.ad-sidebar {
  min-height: 250px;
  margin: 1.5rem 0;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .hero-tag {
  background-color: var(--surface-raised);
  color: var(--accent);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-search-box {
  position: relative;
  max-width: 540px;
  margin-bottom: 1.75rem;
}

.hero-search-input {
  width: 100%;
  padding: 1.1rem 1.25rem 1.1rem 3.25rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.hero-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.hero-search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 20px;
  height: 20px;
}

.hero-quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.hero-quick-tags span {
  color: var(--muted);
}

.quick-tag-pill {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: var(--transition);
}

.quick-tag-pill:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Hero Illustration */
.hero-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-calc-mockup {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.mockup-display {
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: right;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.mockup-subtext {
  font-size: 0.8rem;
  color: var(--muted);
}

.mockup-maintext {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
}

.mockup-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.mockup-key {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background-color: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  border: 1px solid var(--border);
}

.mockup-key.accent {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.mockup-key.op {
  background: var(--secondary-light);
  color: var(--secondary);
}

/* --------------------------------------------------------------------------
   Section Headers & Common Layout
   -------------------------------------------------------------------------- */
.section-wrapper {
  padding: 4rem 0;
}

.section-alt {
  background-color: var(--surface-subtle);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-header .section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Calculator Cards Grid
   -------------------------------------------------------------------------- */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.calculator-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

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

.calc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

[data-theme="dark"] .calc-card-icon {
  background: var(--surface-raised);
}

.calculator-card:hover .calc-card-icon {
  background: var(--primary);
  color: #ffffff;
}

.calc-card-icon svg {
  width: 24px;
  height: 24px;
}

.calc-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.calc-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  flex: 1;
  line-height: 1.5;
}

.calc-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.calc-card-action svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.calculator-card:hover .calc-card-action svg {
  transform: translateX(4px);
}

/* Category Tabs / Filtering */
.category-block {
  margin-bottom: 3.5rem;
}

.category-block:last-child {
  margin-bottom: 0;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.category-title svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Features & Steps
   -------------------------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

[data-theme="dark"] .feature-icon {
  background-color: var(--surface-raised);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.step-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.step-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   SEO Content & Article Sections
   -------------------------------------------------------------------------- */
.seo-content-block {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.seo-content-block h2 {
  font-size: 1.85rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

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

.seo-content-block h3 {
  font-size: 1.35rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.seo-content-block p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.seo-content-block ul, .seo-content-block ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.seo-content-block li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.seo-content-block ul {
  list-style: disc;
}

.seo-content-block ol {
  list-style: decimal;
}

/* --------------------------------------------------------------------------
   Accordion / FAQ
   -------------------------------------------------------------------------- */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--border-focus);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  gap: 1rem;
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item.is-active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
}

.faq-item.is-active .faq-answer {
  max-height: 800px;
  padding-bottom: 1.25rem;
}

.faq-answer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb-nav {
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.breadcrumb-item a {
  color: var(--muted);
}

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

.breadcrumb-separator {
  color: var(--border);
}

.breadcrumb-item.active {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Calculator Page Layout & Components
   -------------------------------------------------------------------------- */
.calculator-page-header {
  margin-bottom: 2rem;
}

.calculator-page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.calculator-page-header .calc-intro {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 800px;
}

.calculator-container-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .calculator-container-layout {
    grid-template-columns: 1fr;
  }
}

/* Calculator Form Box */
.calc-card-main {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.calc-card-header h2 {
  font-size: 1.35rem;
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-control-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background-color: var(--background);
  color: var(--text);
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.input-affix {
  position: absolute;
  right: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
}

.form-input.has-affix {
  padding-right: 3rem;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.form-error-msg {
  display: none;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.35rem;
  font-weight: 500;
}

.form-group.has-error .form-input,
.form-group.has-error .form-select {
  border-color: var(--danger);
}

.form-group.has-error .form-error-msg {
  display: block;
}

/* Radio Pill Group */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-label {
  position: relative;
  cursor: pointer;
}

.pill-label input[type="radio"],
.pill-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.pill-label input:checked + .pill-btn {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Form Action Buttons */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.95rem;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background-color: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--border);
  color: var(--text);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Result Box
   -------------------------------------------------------------------------- */
.result-card-main {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.result-card-header h2 {
  font-size: 1.35rem;
  margin-bottom: 0;
}

.result-highlight-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(124, 58, 237, 0.08));
  border: 1.5px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .result-highlight-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(124, 58, 237, 0.15));
}

.result-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.result-value-big {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  line-height: 1.1;
  word-break: break-word;
}

.result-sub-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); }
.badge-info { background-color: var(--info-bg); color: var(--info); }

.result-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-title {
  color: var(--text-secondary);
}

.breakdown-val {
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-mono);
}

/* Action Toolbar for Result */
.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.result-toolbar .btn {
  flex: 1;
  min-width: 120px;
}

/* Toast Message */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--text);
  color: var(--background);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 3000;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Social Share Bar */
.share-section {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.share-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  color: #ffffff;
  transition: var(--transition);
}

.share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-btn.fb { background-color: #1877f2; }
.share-btn.x { background-color: #000000; }
[data-theme="dark"] .share-btn.x { background-color: #ffffff; color: #000; }
.share-btn.wa { background-color: #25d366; }
.share-btn.li { background-color: #0a66c2; }
.share-btn.copy { background-color: var(--muted); }

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Canvas Container */
.chart-container {
  margin: 1.5rem 0;
  width: 100%;
  height: 240px;
  position: relative;
  background-color: var(--surface-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  border: 1px solid var(--border);
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --------------------------------------------------------------------------
   Global Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr) 1.2fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.footer-desc {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  max-width: 280px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.social-icon-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.social-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Print Stylesheet
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  .site-header,
  .site-footer,
  .ad-container,
  .share-section,
  .form-actions,
  .result-toolbar,
  .breadcrumb-nav,
  .faq-accordion,
  .section-alt,
  .search-modal,
  .copy-toast {
    display: none !important;
  }

  .calculator-container-layout {
    display: block !important;
  }

  .calc-card-main, .result-card-main {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    margin-bottom: 20pt;
    page-break-inside: avoid;
  }

  .result-value-big {
    color: #000000 !important;
  }

  .print-header {
    display: block !important;
    margin-bottom: 20pt;
    border-bottom: 2px solid #000;
    padding-bottom: 10pt;
  }
}

.print-header {
  display: none;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-illustration {
    display: none;
  }
  .hero-title {
    font-size: 2.4rem;
  }
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .hero-title {
    font-size: 2rem;
  }
  .section-header h2 {
    font-size: 1.75rem;
  }
  .seo-content-block {
    padding: 1.75rem;
  }
}
