/* Calcolator - Global Styles */
:root {
  --bg: #0b1020;
  --bg-elev: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #22d3ee;
  --primary-600: #06b6d4;
  --accent: #a78bfa;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
}
.adsbygoogle {
  text-align: center;
}
/* Light Theme Variables */
[data-theme="light"] {
  --bg: #fafbfc;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-border: rgba(59, 130, 246, 0.12);
  --card-hover-border: rgba(59, 130, 246, 0.25);
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --primary: #3b82f6;
  --primary-600: #2563eb;
  --primary-light: #dbeafe;
  --accent: #8b5cf6;
  --accent-light: #ede9fe;
  --danger: #ef4444;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --border-light: rgba(148, 163, 184, 0.2);
  --border-medium: rgba(148, 163, 184, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light theme body gradient */
[data-theme="light"] body {
  background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 25%, #e2e8f0 50%, #f8fafc 100%);
  background-attachment: fixed;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: auto; }
.skip-link:focus { left: 12px; top: 12px; background: var(--primary-600); color: #001219; padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header { 
  position: sticky; 
  top: 0; 
  z-index: 50; 
  background: rgba(15,23,42,.95); 
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: all 0.3s ease;
  min-height: 64px;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Header consistency across devices */
.site-header .container {
  padding: 16px 0 16px 0;
}

.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
  padding: 14px 0; 
  flex-wrap: nowrap; 
}

/* Header layout order: Logo | Search | Theme Toggle | Nav Toggle */
.brand { order: 1; }
.search-container { order: 2; }
.header-controls { order: 3; display: flex; align-items: center; gap: 8px; }
.theme-toggle { order: 1; }
.nav { order: 2; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.brand img { filter: drop-shadow(0 4px 10px rgba(34,211,238,.2)); }

/* Theme Toggle Button */
.theme.ad-placeholder { 
  background: var(--muted-bg); 
  border: 2px dashed var(--muted); 
  border-radius: 8px; 
  padding: 20px; 
  text-align: center; 
  color: var(--muted); 
  font-size: 14px; 
  line-height: 1.4; 
  min-height: 90px; 
  height: 100%;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  box-sizing: border-box;
}
.theme-toggle {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 8px;
}
.theme-toggle:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  transform: scale(1.05);
}
[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid var(--border-medium);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .theme-toggle:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}
.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* Header Controls Container */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language Selector */
.language-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.language-selector select {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 80px;
}

.language-selector select:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
}

.language-selector select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

/* Light theme language selector */
[data-theme="light"] .language-selector select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-medium);
  color: var(--text);
}

[data-theme="light"] .language-selector select:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

[data-theme="light"] .language-selector select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Search */
.search-container { flex: 1; max-width: 400px; margin: 0 20px; }

/* Ensure proper header spacing */
@media (min-width: 769px) {
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .brand {
    flex-shrink: 0;
  }
  
  .search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
  }
  
  .header-controls {
    flex-shrink: 0;
  }
}
.search-box { position: relative; display: flex; align-items: center; }
.search-box input { 
  width: 100%; 
  padding: 10px 45px 10px 12px; 
  border-radius: 25px; 
  border: 1px solid rgba(255,255,255,.14); 
  background: rgba(255,255,255,.04); 
  color: var(--text); 
  outline: none; 
  font-size: 14px;
  transition: all 0.2s ease;
}
.search-box input:focus { 
  border-color: rgba(34,211,238,.5); 
  box-shadow: 0 0 0 3px rgba(34,211,238,.15); 
  background: rgba(255,255,255,.08);
}
.search-box button { 
  position: absolute; 
  right: 8px; 
  background: transparent; 
  border: none; 
  color: var(--muted); 
  cursor: pointer; 
  padding: 6px; 
  border-radius: 50%; 
  transition: color 0.2s ease;
}
.search-box button:hover { color: var(--primary); }

/* Light theme search styles */
[data-theme="light"] .search-box input {
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 1);
}
[data-theme="light"] .search-box input::placeholder {
  color: var(--muted);
}
.nav-toggle { display: none; background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 8px 10px; transition: all 0.2s ease; cursor: pointer; }
.nav-list { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; transition: color .2s, background .2s; }
.nav-list a:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* Nav toggle hover effects */
.nav-toggle:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
}

/* Light theme navigation */
[data-theme="light"] .nav-toggle {
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .nav-toggle:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
[data-theme="light"] .nav-list a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

/* Hero */
.hero { padding: 56px 0; background: radial-gradient(1200px 600px at 70% -20%, rgba(34,211,238,.12), transparent), radial-gradient(900px 500px at 20% -10%, rgba(167,139,250,.12), transparent); overflow: hidden; }

/* Light theme hero */
[data-theme="light"] .hero {
  background: 
    radial-gradient(1200px 600px at 70% -20%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(900px 500px at 20% -10%, rgba(139, 92, 246, 0.06), transparent),
    linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.9) 100%);
}
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 28px; min-height: 400px; }
.hero-copy h1 { font-size: 42px; line-height: 1.15; margin: 0 0 10px; word-wrap: break-word; overflow-wrap: break-word; }
.hero-copy p { color: var(--muted); margin: 0 0 22px; font-size: 18px; word-wrap: break-word; overflow-wrap: break-word; }
.hero-art { max-width: 100%; height: auto; }
.hero-art img { max-width: 100%; height: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px; border-radius: 12px; border: 1px solid transparent; text-decoration: none; cursor: pointer; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #001219; box-shadow: 0 10px 20px rgba(34,211,238,.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(34,211,238,.32); }
.btn-secondary { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: var(--text); }
.btn-secondary:hover { background: rgba(255,255,255,.1); }

/* Light theme buttons */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: white;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--primary-600);
}
[data-theme="light"] .btn-primary:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}
[data-theme="light"] .btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-medium);
  color: var(--text);
  box-shadow: var(--shadow);
}
[data-theme="light"] .btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-600);
}

/* Sections */
.section { padding: 40px 0 64px; }
.section-header h2 { margin: 0 0 6px; font-size: 28px; }
.section-header p { margin: 0 0 20px; color: var(--muted); }

/* Keywords Section */
.keywords-section { margin: 20px 0; padding: 15px; background: rgba(255,255,255,.02); border-radius: 12px; border: 1px solid rgba(255,255,255,.06); }
.keywords-section h3 { margin: 0 0 10px; font-size: 16px; color: var(--muted); }
.keywords-tags { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.keyword-tag { background: rgba(34,211,238,.1); color: var(--primary); padding: 4px 8px; border-radius: 6px; transition: all 0.2s ease; cursor: pointer; }
.keyword-tag:hover { background: rgba(34,211,238,.2); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(34,211,238,.15); }
.keyword-tag:active { transform: translateY(0); }

/* Light theme keywords section */
[data-theme="light"] .keywords-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.9) 100%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}
[data-theme="light"] .keyword-tag {
  background: var(--primary-light);
  color: var(--primary-600);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
[data-theme="light"] .keyword-tag:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Grid */
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { display: block; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.08); padding: 18px; border-radius: 16px; text-decoration: none; color: var(--text); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; position: relative; overflow: hidden; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(34,211,238,.35); }

/* Light theme cards */
[data-theme="light"] .card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
[data-theme="light"] .card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--card-hover-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.95) 100%);
}
[data-theme="light"] .card h3 {
  color: var(--text);
}
[data-theme="light"] .card p {
  color: var(--text-secondary);
}
.card img { display: block; margin-bottom: 10px; }
.card h3 { margin: 6px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Enhanced Ads System */
.ads { 
  display: block; 
  margin: 12px 0 22px; 
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 300px;
}

.ad-placeholder { 
  width: 100%; 
  min-height: 90px; 
  height: 100%;
  border-radius: 12px; 
  border: 1px dashed rgba(255,255,255,.2); 
  background: rgba(255,255,255,.03); 
  color: rgba(255,255,255,.5); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  text-align: center; 
  font-size: 12px; 
  line-height: 1.4; 
  padding: 16px; 
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.ad-placeholder:hover {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.06);
}

/* Light theme ads */
[data-theme="light"] .ad-placeholder {
  border: 1px dashed var(--border-medium);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(248, 250, 252, 0.8) 100%);
  color: var(--muted);
}

[data-theme="light"] .ad-placeholder:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 1) 100%);
  box-shadow: var(--shadow);
}

/* Ad Position Types */
.ads-header { 
  margin: 16px 0; 
  min-height: 90px;
  width: 100%;
  min-width: 300px;
  text-align: center;
}

.ads-top { 
  margin: 24px 0 16px; 
  min-height: 90px;
  width: 100%;
  min-width: 300px;
}

.ads-bottom { 
  margin: 16px 0 24px; 
  min-height: 90px;
  width: 100%;
  min-width: 300px;
}

.ads-inline { 
  margin: 20px 0; 
  min-height: 280px;
  width: 100%;
  min-width: 300px;
}

.ads-sidebar { 
  margin: 16px 0; 
  min-height: 250px;
  width: 100%;
  min-width: 300px;
}

.ads-sticky { 
  position: fixed !important; 
  right: 16px; 
  bottom: 16px; 
  width: 160px !important; 
  height: 120px !important;
  max-width: 160px !important;
  min-width: 160px !important;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
  /* Ensure it doesn't interfere with main content */
  pointer-events: auto;
  opacity: 0.95;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

/* Hover effect for sticky ad */
.ads-sticky:hover {
  opacity: 1;
}

/* Ensure sticky ad is a small compact box */
@media (min-width: 1024px) {
  .ads-sticky {
    right: 20px;
    bottom: 20px;
    width: 160px;
    height: 120px;
    max-width: 160px;
    max-height: 120px;
  }
  
  /* Ensure the ad content fits in the small box */
  .ads-sticky ins {
    width: 100% !important;
    height: 100% !important;
    max-width: 160px !important;
    max-height: 120px !important;
    min-width: 160px !important;
    min-height: 120px !important;
  }
}

/* New Strategic Ad Positions */
.ads-between-cards {
  margin: 30px 0;
  height: 280px;
  max-height: 280px;
  width: 100%;
  min-width: 300px;
  overflow: hidden;
  align-self: start;
}

.ads-mobile-banner {
  display: none;
  margin: 16px 0;
  min-height: 100px;
  width: 100%;
  min-width: 300px;
}

.ads-footer-banner {
  margin: 20px 0 10px;
  min-height: 60px;
  width: 100% !important;
  min-width: 100px !important;
  text-align: right !important;
}

/* AdSense element styling */
.adsbygoogle {
  display: block !important;
  width: 100% !important;
  min-width: 300px !important;
  min-height: 90px !important;
  height: auto !important;
}

/* Ensure ad containers are visible */
.ads ins {
  display: block !important;
  width: 100% !important;
  min-width: 300px !important;
  min-height: 90px !important;
}

/* Force proper dimensions for all ad containers - responsive approach */
.ads {
  width: 100% !important;
  min-width: 320px !important;
  text-align: center !important;
  display: block !important;
}

.ads ins {
  width: 100% !important;
  min-width: 320px !important;
  display: block !important;
}

/* Ensure ads work on all screen sizes */
@media (max-width: 768px) {
  .ads {
    min-width: 300px !important;
    width: 100% !important;
  }
  
  .ads ins {
    min-width: 300px !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .ads {
    min-width: 280px !important;
    width: 100% !important;
  }
  
  .ads ins {
    min-width: 280px !important;
    width: 100% !important;
  }
}

/* Footer */
.site-footer { 
  border-top: 1px solid var(--border-color, rgba(255,255,255,.06)); 
  background: var(--footer-bg, rgba(15,23,42,.6));
  color: var(--text);
  margin-top: auto;
  min-height: 60px;
  transition: all 0.3s ease;
}

/* Light theme footer */
[data-theme="light"] .site-footer {
  --footer-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
  --border-color: var(--border-light);
  backdrop-filter: blur(20px);
  box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.1), 0 -1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Dark theme footer */
[data-theme="dark"] .site-footer {
  --footer-bg: rgba(15, 23, 42, 0.9);
  --border-color: rgba(255,255,255,.06);
}

/* Footer consistency across devices */
.site-footer .container {
  padding: 0 16px;
}

.footer-inner { 
  display: grid; 
  grid-template-columns: 1fr auto auto; 
  align-items: center; 
  gap: 14px; 
  padding: 18px 0; 
}

.footer-brand { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  font-weight: 700; 
  color: var(--text);
}

.site-footer nav a { 
  color: var(--muted); 
  text-decoration: none; 
  margin-right: 12px;
  transition: color 0.2s ease;
}

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

/* Light theme footer links */
[data-theme="light"] .site-footer nav a:hover {
  color: var(--primary-600);
  background: var(--primary-light);
}

[data-theme="light"] .copyright {
  color: var(--text-secondary);
}

/* Ensure dark theme is set by default */
:root {
  --footer-bg: rgba(15, 23, 42, 0.9);
  --border-color: rgba(255,255,255,.06);
}

/* Calculator pages */
.layout { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 24px 0 56px; }
.calc { display: grid; grid-template-columns: 1fr; gap: 18px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.08); padding: 18px; border-radius: 16px; }

/* Light theme calculator pages */
[data-theme="light"] .calc {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.calc h1 { margin: 0; font-size: 26px; }
.calc .desc { color: var(--muted); margin: -6px 0 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-row { display: grid; gap: 8px; }

/* Calculator page responsive */
@media (max-width: 768px) {
  .layout { padding: 16px 0 40px; }
  .calc { padding: 16px; gap: 16px; }
  .calc h1 { font-size: 22px; }
  .calc h2 { font-size: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 560px) {
  .layout { padding: 12px 0 32px; }
  .calc { padding: 14px; gap: 14px; }
  .calc h1 { font-size: 20px; }
  .calc h2 { font-size: 16px; }
  .calc .desc { font-size: 14px; }
  .form-row input, .form-row select, .form-row textarea { padding: 10px; font-size: 14px; }
  .result { padding: 12px; }
  .result h2 { font-size: 16px; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
}
label { font-weight: 600; }
input, select, textarea { 
  width: 100%; 
  padding: 12px 12px; 
  border-radius: 12px; 
  border: 1px solid var(--input-border, rgba(255,255,255,.14)); 
  background: var(--input-bg, rgba(255,255,255,.04)); 
  color: var(--text); 
  outline: none; 
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Light theme inputs */
[data-theme="light"] {
  --input-border: var(--border-medium);
  --input-bg: rgba(255, 255, 255, 0.95);
  --input-focus-border: var(--primary);
  --input-focus-shadow: var(--primary-light);
}

/* Enhanced light theme input styling */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  box-shadow: 0 0 0 3px var(--input-focus-shadow), var(--shadow-lg);
  background: rgba(255, 255, 255, 1);
}

/* Dark theme inputs */
[data-theme="dark"] {
  --input-border: rgba(255, 255, 255, 0.14);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-focus-border: rgba(34, 211, 238, 0.5);
  --input-focus-shadow: rgba(34, 211, 238, 0.15);
}

input:focus, 
select:focus, 
textarea:focus { 
  border-color: var(--input-focus-border); 
  box-shadow: 0 0 0 3px var(--input-focus-shadow); 
}

textarea { 
  min-height: 100px; 
  resize: vertical; 
  line-height: 1.5; 
}
.form-row select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: rgba(255,255,255,.04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a7f3d0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 40px;
  border-color: rgba(255,255,255,.14);
}

/* Light theme select dropdown */
[data-theme="light"] .form-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Dark dropdown list styling where supported */
select option { background-color: var(--bg-elev); color: var(--text); }

/* Hide default arrow in IE */
select::-ms-expand { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result { background: rgba(34,211,238,.06); border: 1px solid rgba(34,211,238,.3); border-radius: 14px; padding: 14px; }

/* Light theme result section */
[data-theme="light"] .result {
  background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.result h2 { margin: 0 0 6px; font-size: 18px; }
.error { color: var(--danger); font-weight: 600; }
.success { color: var(--success); font-weight: 600; }

/* Tables */
table { width: 100%; border-collapse: collapse; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
thead th { background: rgba(255,255,255,.05); font-weight: 700; }
tbody tr:hover { background: rgba(255,255,255,.03); }

/* Light theme tables */
[data-theme="light"] table {
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}
[data-theme="light"] th,
[data-theme="light"] td {
  border-bottom: 1px solid var(--border-light);
}
[data-theme="light"] thead th {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: var(--primary-600);
}
[data-theme="light"] tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}
[data-theme="light"] tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}

/* Responsive */
@media (max-width: 1200px) {
  .container { padding: 0 16px; }
  .search-container { max-width: 350px; margin: 0 16px; }
}

@media (max-width: 960px) {
  .container { padding: 0 16px; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .hero-copy h1 { font-size: 36px; }
  .calc-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .search-container { max-width: 280px; margin: 0 12px; }
  .header-inner { gap: 12px; }
}

@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .site-header .container { padding: 0 12px; }
  .site-footer .container { padding: 0 12px; }
  
  .hero { padding: 40px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; text-align: center; min-height: auto; }
  .hero-content { max-width: none; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 280px; }
  .calc-grid { grid-template-columns: 1fr; gap: 14px; }
  
  /* Mobile Header Layout - Improved consistency */
  .site-header {
    min-height: 56px;
  }
  
  .header-inner { 
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 10px 0;
    align-items: center;
  }
  
  .brand { 
    grid-column: 1;
    grid-row: 1;
    font-size: 18px;
  }
  
  .header-controls {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
    padding-right: 0;
    margin-right: 0;
  }
  
  .search-container {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin: 0;
  }
  
  .nav {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
  }
  
  .keywords-tags { justify-content: center; }
  
  /* Mobile Header Controls - Equal Size & Spacing */
  .header-controls {
    gap: 12px; /* Generous spacing between buttons */
    padding-right: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
  }
  
  /* Make all buttons equal size and height */
  .theme-toggle,
  .nav-toggle,
  .language-selector select {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
  }
  
  /* Language selector specific adjustments */
  .language-selector select {
    text-align: center;
    text-align-last: center;
    appearance: none;
    background-image: none;
  }
  
  /* Nav toggle specific adjustments */
  .nav-toggle {
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease; /* Smooth transition for icon change */
  }
  
  /* Theme toggle specific adjustments - add internal padding */
  .theme-toggle {
    margin-left: 0 !important; /* Override any default margin */
    padding: 8px !important; /* Add internal padding for better icon spacing */
  }
  
}

@media (max-width: 560px) {
  .container { padding: 0 8px; }
  .site-header .container { padding: 0 8px; }
  .site-footer .container { padding: 0 8px; }
  
  .hero { padding: 30px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 20px; text-align: center; min-height: auto; }
  .hero-copy h1 { font-size: 28px; line-height: 1.2; word-break: break-word; }
  .section-header h2 { font-size: 24px; }
  
  /* Mobile Header Layout - Extra small screens */
  .site-header {
    min-height: 52px;
  }
  
  .header-inner { 
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 8px 0;
  }
  
  .brand { 
    grid-column: 1;
    grid-row: 1;
    font-size: 16px;
  }
  
  .header-controls {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .search-container {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin: 0;
  }
  
  .nav {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
  }
  
  .hero-art img { max-width: 200px; }
  .section { padding: 32px 0 48px; }
  .section-header h2 { font-size: 24px; }
  
  .brand { 
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  
  .header-controls { 
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: flex; 
    align-items: center; 
    gap: 6px;
  }
  
  /* Search bar below - full width */
  .search-container { 
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%; 
    margin: 0; 
  }
  
  .nav { 
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%; 
    justify-content: center; 
    margin-top: 4px;
  }
  
  /* Small Mobile Header Controls - Equal Size & Spacing */
  .header-controls {
    gap: 10px; /* Slightly smaller but still generous spacing */
    padding-right: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
  }
  
  /* Make all buttons equal size and height for small screens */
  .theme-toggle,
  .nav-toggle,
  .language-selector select {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    box-sizing: border-box;
  }
  
  /* Language selector specific adjustments for small screens */
  .language-selector select {
    text-align: center;
    text-align-last: center;
    appearance: none;
    background-image: none;
  }
  
  /* Nav toggle specific adjustments for small screens */
  .nav-toggle {
    display: inline-flex;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease; /* Smooth transition for icon change */
  }
  
  /* Theme toggle specific adjustments for small screens - add internal padding */
  .theme-toggle {
    margin-left: 0 !important; /* Override any default margin */
    padding: 6px !important; /* Add internal padding for better icon spacing on small screens */
  }
  .nav-list { 
    display: none; 
    position: absolute; 
    right: 8px; 
    top: 60px; 
    background: rgba(15,23,42,.95); 
    padding: 4px; 
    border-radius: 12px; 
    border: 1px solid rgba(255,255,255,.08); 
    flex-direction: column; 
    min-width: 160px; 
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
  }
  
  /* Light theme mobile navigation */
  [data-theme="light"] .nav-list {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
  }
  
  /* Light theme nav toggle button */
  [data-theme="light"] .nav-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-medium);
    color: var(--text);
  }
  
  /* Light theme mobile navigation links */
  [data-theme="light"] .nav-list a {
    color: var(--text-secondary);
  }
  
  [data-theme="light"] .nav-list a:hover {
    color: var(--primary-600);
    background: var(--primary-light);
  }
  
  [data-theme="light"] .nav-list a[aria-current="page"] {
    color: var(--primary-600);
    background: var(--primary-light);
  }
  .nav-list.open { 
    display: flex; 
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Mobile navigation links - better touch targets */
  .nav-list a {
    display: flex !important; /* Use flexbox for centering */
    align-items: center !important; /* Center text vertically */
    width: 100% !important; /* Full width clickable area */
    padding: 12px 16px !important; /* Generous padding for touch */
    margin: 2px 0 !important; /* Small margin between items */
    text-align: left !important; /* Left align text */
    box-sizing: border-box !important; /* Include padding in width */
    min-height: 44px !important; /* Minimum touch target size */
    border-radius: 8px !important; /* Rounded corners */
    transition: all 0.2s ease !important; /* Smooth hover effects */
  }
  
  .calc-grid { grid-template-columns: 1fr; gap: 12px; }
  .search-box input { font-size: 16px; padding: 12px 45px 12px 12px; }
  .card { padding: 16px; }
  .card h3 { font-size: 16px; }
  .card p { font-size: 13px; }
  .footer-inner { 
    display: flex; 
    flex-direction: column; 
    text-align: center; 
    gap: 12px; 
    align-items: center;
  }
  
  .footer-brand {
    order: 1;
  }
  
  .site-footer nav {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .site-footer nav a {
    margin-right: 0;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
  }
  
  .copyright {
    order: 3;
    margin: 0;
    font-size: 14px;
    color: var(--muted);
  }
  /* Mobile Ad Optimizations */
  .ads-sticky { display: none; }
  
  .ads-mobile-banner { 
    display: block !important; 
    margin: 20px 0;
    min-height: 100px;
    width: 100% !important;
    min-width: 300px !important;
  }
  
  .ads-header .ad-placeholder {
    min-height: 50px;
    font-size: 11px;
  }
  
  /* Ensure all mobile ads are visible */
  .ads-header,
  .ads-top,
  .ads-bottom,
  .ads-between-cards {
    display: block !important;
    width: 100% !important;
    min-width: 300px !important;
  }
  
  .ads-between-cards {
    margin: 25px 0;
    height: 250px;
    max-height: 250px;
    overflow: hidden;
    align-self: start;
  }
  
  .ads-inline {
    margin: 20px 0;
    min-height: 250px;
  }
  
  /* Keyword tags responsive */
  .keywords-section { margin: 16px 0; padding: 12px; }
  .keywords-tags { justify-content: center; gap: 6px; }
  .keyword-tag { font-size: 13px; padding: 3px 6px; }
}

@media (max-width: 400px) {
  .container { padding: 0 6px; }
  
  /* Extra small screen footer adjustments */
  .footer-inner {
    padding: 16px 0;
    gap: 10px;
  }
  
  .footer-brand {
    font-size: 14px;
  }
  
  .footer-brand img {
    width: 24px;
    height: 24px;
  }
  
  .site-footer nav a {
    font-size: 13px;
    padding: 3px 6px;
  }
  
  .copyright {
    font-size: 12px;
  }
  .hero { padding: 20px 0; }
  .hero-copy h1 { font-size: 24px; line-height: 1.1; }
  .hero-copy p { font-size: 14px; }
  .hero-art img { max-width: 150px; }
  .section-header h2 { font-size: 20px; }
  .card { padding: 12px; }
  .search-box input { padding: 10px 40px 10px 10px; font-size: 14px; }
  
  /* Prevent horizontal overflow */
  .hero-copy h1, .hero-copy p, .section-header h2 { 
    word-break: break-word; 
    overflow-wrap: break-word; 
    hyphens: auto;
  }
}

/* Light theme accent enhancements */
[data-theme="light"] .brand img {
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

[data-theme="light"] .skip-link:focus {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-lg);
}

/* Enhanced light theme scrollbar */
[data-theme="light"] ::-webkit-scrollbar {
  width: 8px;
}
[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--bg);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: 4px;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}

/* Light theme selection colors */
[data-theme="light"] ::selection {
  background: var(--primary-light);
  color: var(--primary-600);
}

/* Calculator Guides Page Styling */

/* Table of Contents Section */
.toc-section {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 16px;
  padding: 24px;
  margin: 32px 0;
  position: relative;
  overflow: hidden;
}

.toc-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 16px 16px 0 0;
}

.toc-section h2 {
  margin: 0 0 20px 0;
  color: var(--primary);
  font-size: 24px;
  text-align: center;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.toc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  position: relative;
}

.toc-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);
}

.toc-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.toc-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  display: block;
}

.toc-desc {
  font-size: 14px;
  color: var(--muted);
  display: block;
}

/* Light theme TOC */
[data-theme="light"] .toc-section {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .toc-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

[data-theme="light"] .toc-item:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, var(--primary-light) 100%);
}

[data-theme="light"] .toc-title {
  color: var(--primary-600);
}

[data-theme="light"] .toc-desc {
  color: var(--text-secondary);
}
.guide-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.guide-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 16px 16px 0 0;
}

.guide-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(34, 211, 238, 0.3);
}

.guide-section h3 {
  color: var(--primary);
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-section h3::before {
  content: '📊';
  font-size: 18px;
}

.guide-section p {
  margin: 12px 0;
  line-height: 1.6;
}

.guide-section ul {
  margin: 16px 0;
  padding-left: 0;
  list-style: none;
}

.guide-section li {
  padding: 8px 0 8px 24px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.guide-section li:last-child {
  border-bottom: none;
}

.guide-section li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--success);
  font-weight: bold;
  font-size: 14px;
}

.guide-section a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.1);
  transition: all 0.2s ease;
  margin-top: 12px;
}

.guide-section a:hover {
  background: var(--primary);
  color: white;
  transform: translateX(4px);
}

/* Light theme guide sections */
[data-theme="light"] .guide-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .guide-section::before {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

[data-theme="light"] .guide-section:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--card-hover-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.95) 100%);
}

[data-theme="light"] .guide-section h3 {
  color: var(--primary-600);
}

[data-theme="light"] .guide-section li {
  border-bottom: 1px solid var(--border-light);
}

[data-theme="light"] .guide-section li::before {
  color: var(--success);
}

[data-theme="light"] .guide-section a {
  background: var(--primary-light);
  color: var(--primary-600);
}

[data-theme="light"] .guide-section a:hover {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

/* Section headers styling */
#financial-guides h2,
#health-guides h2,
#academic-guides h2,
#calculator-tips h2 {
  font-size: 28px;
  margin: 40px 0 24px 0;
  padding: 16px 0;
  border-bottom: 2px solid var(--primary);
  position: relative;
  color: var(--text);
}

#financial-guides h2::before {
  content: '💰';
  margin-right: 12px;
}

#health-guides h2::before {
  content: '🏥';
  margin-right: 12px;
}

#academic-guides h2::before {
  content: '🎓';
  margin-right: 12px;
}

#calculator-tips h2::before {
  content: '💡';
  margin-right: 12px;
}

/* Formula highlighting */
.guide-section p strong {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

[data-theme="light"] .guide-section p strong {
  color: var(--accent);
  background: var(--accent-light);
}

/* Enhanced Example boxes */
.example-box {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.example-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--success));
}

.example-box p {
  margin: 0 0 16px 0;
  font-weight: 600;
  color: var(--primary);
}

.calculation-steps {
  display: grid;
  gap: 8px;
}

.calc-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-step.result-step {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(34, 211, 238, 0.1) 100%);
  border-color: var(--success);
  font-weight: 600;
}

.step-label {
  color: var(--muted);
  font-size: 14px;
}

.step-value {
  color: var(--text);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.result-step .step-value {
  color: var(--success);
  font-size: 16px;
}

/* Light theme example boxes */
[data-theme="light"] .example-box {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--success-light) 100%);
  border: 1px solid var(--primary);
  box-shadow: var(--shadow);
}

[data-theme="light"] .calc-step {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light);
}

[data-theme="light"] .calc-step.result-step {
  background: linear-gradient(135deg, var(--success-light) 0%, var(--primary-light) 100%);
  border-color: var(--success);
}

[data-theme="light"] .step-label {
  color: var(--text-secondary);
}

[data-theme="light"] .step-value {
  color: var(--text);
}

[data-theme="light"] .result-step .step-value {
  color: var(--success);
}

/* Responsive adjustments for guides */
@media (max-width: 768px) {
  .toc-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .toc-item {
    padding: 16px 12px;
  }
  
  .toc-icon {
    font-size: 28px;
  }
  
  .toc-title {
    font-size: 15px;
  }
  
  .toc-desc {
    font-size: 13px;
  }
  
  .guide-section {
    padding: 16px;
    margin: 16px 0;
  }
  
  .guide-section h3 {
    font-size: 18px;
  }
  
  .example-box {
    padding: 16px;
    margin: 16px 0;
  }
  
  .calc-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .step-value {
    font-size: 14px;
  }
  
  #financial-guides h2,
  #health-guides h2,
  #academic-guides h2,
  #calculator-tips h2 {
    font-size: 24px;
    margin: 32px 0 16px 0;
  }
}

@media (max-width: 560px) {
  .toc-section {
    padding: 16px;
    margin: 24px 0;
  }
  
  .toc-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .toc-item {
    padding: 12px;
  }
  
  .toc-icon {
    font-size: 24px;
  }
  
  .toc-title {
    font-size: 14px;
  }
  
  .toc-desc {
    font-size: 12px;
  }
  
  .guide-section {
    padding: 12px;
    margin: 12px 0;
  }
  
  .guide-section h3 {
    font-size: 16px;
  }
  
  .guide-section li {
    padding: 6px 0 6px 20px;
  }
  
  .example-box {
    padding: 12px;
    margin: 12px 0;
  }
  
  .calc-step {
    padding: 6px 8px;
  }
  
  .step-label {
    font-size: 13px;
  }
  
  .step-value {
    font-size: 13px;
  }
  
  .result-step .step-value {
    font-size: 14px;
  }
  
  #financial-guides h2,
  #health-guides h2,
  #academic-guides h2,
  #calculator-tips h2 {
    font-size: 20px;
    margin: 24px 0 12px 0;
  }
}

/* FAQ Page Styling */
.faq-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s ease;
}

.faq-item:hover::before {
  transform: scaleY(1);
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(34, 211, 238, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.faq-item h3 {
  color: var(--primary);
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.faq-item h3::before {
  content: '❓';
  font-size: 16px;
  flex-shrink: 0;
}

.faq-item p {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text);
}

.faq-item ul {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

.faq-item li {
  padding: 6px 0 6px 20px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-item li:last-child {
  border-bottom: none;
}

.faq-item li::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--accent);
  font-size: 10px;
}

/* FAQ Section Headers */
#emi-faq h2,
#loan-faq h2,
#bmi-faq h2,
#tax-faq h2,
#savings-faq h2,
#general-faq h2 {
  font-size: 24px;
  margin: 32px 0 20px 0;
  padding: 12px 0;
  border-bottom: 2px solid var(--primary);
  position: relative;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

#emi-faq h2::before {
  content: '🏠';
}

#loan-faq h2::before {
  content: '💳';
}

#bmi-faq h2::before {
  content: '⚖️';
}

#tax-faq h2::before {
  content: '📊';
}

#savings-faq h2::before {
  content: '💰';
}

#general-faq h2::before {
  content: '❔';
}

/* Light theme FAQ styling */
[data-theme="light"] .faq-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .faq-item:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--card-hover-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.95) 100%);
}

[data-theme="light"] .faq-item h3 {
  color: var(--primary-600);
}

[data-theme="light"] .faq-item li {
  border-bottom: 1px solid var(--border-light);
}

[data-theme="light"] .faq-item li::before {
  color: var(--accent);
}

/* FAQ Quick Navigation */
.faq-nav {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.faq-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 12px 12px 0 0;
}

.faq-nav h2 {
  margin: 0 0 16px 0;
  color: var(--primary);
  font-size: 20px;
  text-align: center;
}

.faq-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.faq-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.faq-nav-item:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: var(--primary);
  transform: translateX(4px);
}

.faq-nav-item span:first-child {
  font-size: 16px;
}

/* Light theme FAQ navigation */
[data-theme="light"] .faq-nav {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

[data-theme="light"] .faq-nav-item {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light);
}

[data-theme="light"] .faq-nav-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Responsive FAQ styling */
@media (max-width: 768px) {
  .faq-item {
    padding: 16px;
    margin: 12px 0;
  }
  
  .faq-item h3 {
    font-size: 16px;
  }
  
  .faq-nav {
    padding: 16px;
    margin: 20px 0;
  }
  
  .faq-nav-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  #emi-faq h2,
  #loan-faq h2,
  #bmi-faq h2,
  #tax-faq h2,
  #savings-faq h2,
  #general-faq h2 {
    font-size: 20px;
    margin: 24px 0 16px 0;
  }
}

@media (max-width: 560px) {
  .faq-item {
    padding: 12px;
    margin: 10px 0;
  }
  
  .faq-item h3 {
    font-size: 15px;
  }
  
  .faq-item li {
    padding: 4px 0 4px 16px;
  }
  
  .faq-nav {
    padding: 12px;
    margin: 16px 0;
  }
  
  .faq-nav h2 {
    font-size: 18px;
  }
  
  #emi-faq h2,
  #loan-faq h2,
  #bmi-faq h2,
  #tax-faq h2,
  #savings-faq h2,
  #general-faq h2 {
    font-size: 18px;
    margin: 20px 0 12px 0;
  }
}

/* Particles Animation */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.6;
  animation: float 20s infinite linear;
}

.particle.triangle {
  width: 0;
  height: 0;
  border-radius: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 8px solid rgba(34, 211, 238, 0.3);
  animation: floatTriangle 25s infinite linear;
}

.particle.square {
  border-radius: 2px;
  background: rgba(167, 139, 250, 0.3);
  animation: floatSquare 30s infinite linear;
}

.particle.circle {
  background: rgba(34, 211, 238, 0.4);
  animation: floatCircle 22s infinite linear;
}

.particle.diamond {
  width: 8px;
  height: 8px;
  background: rgba(139, 92, 246, 0.3);
  transform: rotate(45deg);
  border-radius: 0;
  animation: floatDiamond 28s infinite linear;
}

/* Particle size variations */
.particle.small { width: 4px; height: 4px; }
.particle.medium { width: 6px; height: 6px; }
.particle.large { width: 8px; height: 8px; }

/* Animation keyframes */
@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100px) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes floatTriangle {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-100px) translateX(-50px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes floatSquare {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-100px) translateX(80px) rotate(180deg);
    opacity: 0;
  }
}

@keyframes floatCircle {
  0% {
    transform: translateY(100vh) translateX(0) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(50vh) translateX(30px) scale(1);
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100px) translateX(-30px) scale(0.5);
    opacity: 0;
  }
}

@keyframes floatDiamond {
  0% {
    transform: translateY(100vh) translateX(0) rotate(45deg);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-100px) translateX(60px) rotate(405deg);
    opacity: 0;
  }
}

/* Light theme particles */
[data-theme="light"] .particle.triangle {
  border-bottom-color: rgba(59, 130, 246, 0.4);
}

[data-theme="light"] .particle.square {
  background: rgba(139, 92, 246, 0.4);
}

[data-theme="light"] .particle.circle {
  background: rgba(59, 130, 246, 0.5);
}

[data-theme="light"] .particle.diamond {
  background: rgba(167, 139, 250, 0.4);
}

/* Responsive particles */
@media (max-width: 768px) {
  .particle {
    opacity: 0.4;
  }
  
  .particle.large {
    width: 6px;
    height: 6px;
  }
  
  .particle.medium {
    width: 4px;
    height: 4px;
  }
  
  .particle.small {
    width: 3px;
    height: 3px;
  }
  
  .particle.triangle {
    border-left-width: 3px;
    border-right-width: 3px;
    border-bottom-width: 6px;
  }
}

@media (max-width: 480px) {
  .particles-container {
    display: none; /* Hide on very small screens for performance */
  }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) { 
  * { transition: none !important; animation: none !important; }
  .particles-container { display: none !important; }
}


