/* Custom overrides for Financial Calculator */

:root {
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  cursor: pointer;
}

/* Tab active state */
.tab-btn.active {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.tab-btn:not(.active):hover {
  background-color: #f1f5f9;
}

a.tab-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.calc-nav-link.active {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 9999px;
  transition: background-color 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Ad slot compliance – hidden until live ad units are configured */
.ad-slot {
  display: none !important;
}

/* Results cards */
.result-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

/* FAQ accordion */
details summary {
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] summary .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.2s ease;
}

/* Conditional fields animation */
.conditional-field {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.conditional-field.hidden-field {
  max-height: 0;
  opacity: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: none;
}

.conditional-field.visible-field {
  max-height: 200px;
  opacity: 1;
}

/* Chart container */
#chart-container {
  position: relative;
  height: 320px;
}

@media (min-width: 768px) {
  #chart-container {
    height: 380px;
  }
}

/* PDF export target */
#pdf-export-area {
  background: #fff;
}

/* Sticky results on larger screens */
@media (min-width: 1024px) {
  .results-sticky {
    position: sticky;
    top: 1rem;
  }
}

/* Number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* Goal preset buttons */
.goal-preset-btn {
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
  white-space: nowrap;
}

.goal-preset-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.goal-preset-btn:active {
  transform: translateY(0);
}

/* Language switcher */
.lang-switch {
  letter-spacing: 0.02em;
}

/* SEO tables */
.seo-table {
  border-collapse: collapse;
  min-width: 100%;
}

.seo-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.seo-table th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.seo-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  white-space: nowrap;
}

.seo-table tbody tr:hover {
  background: #f8fafc;
}

.seo-table tbody tr:last-child td {
  border-bottom: none;
}

/* Hindi font support */
html[lang="hi"] body {
  font-family: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
}
