/* ==========================================================================
   PolicyVani - Modern Financial Calculators Suite Stylesheet (2026)
   ========================================================================== */

/* ── Sticky Quick-Switch Top Bar ────────────────────────────────────────── */
.calc-quick-switch-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0;
  position: sticky;
  top: 60px;
  z-index: 90;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  backdrop-filter: blur(8px);
}

.calc-quick-switch-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.2rem;
  margin: 0;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.calc-quick-switch-list::-webkit-scrollbar {
  height: 4px;
}
.calc-quick-switch-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.calc-quick-switch-item {
  flex-shrink: 0;
  white-space: nowrap;
}

.calc-quick-switch-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.calc-quick-switch-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.calc-quick-switch-link.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

/* ── 2-Column Calculator Workbench Layout ────────────────────────────────── */
.calc-workbench-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}

.calc-workbench-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #0284c7 0%, #0d9488 50%, #f59e0b 100%);
}

.calc-workbench-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .calc-workbench-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ── Left Column: Input Panel ────────────────────────────────────────────── */
.calc-inputs-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calc-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-subtle);
  padding: 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.calc-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.calc-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Synced Number Input */
.calc-num-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-num-prefix {
  position: absolute;
  left: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.9rem;
  pointer-events: none;
}

.calc-num-input {
  width: 140px;
  padding: 0.4rem 0.65rem 0.4rem 1.6rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  text-align: right;
  font-family: inherit;
  transition: all 0.15s ease;
}

.calc-num-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-num-input.no-prefix {
  padding-left: 0.65rem;
}

/* Slider Controls */
.calc-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.2rem;
}

.calc-slider {
  --fill-pct: 0%;
  flex: 1;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: linear-gradient(to right, #0284c7 0%, #0284c7 var(--fill-pct), #e2e8f0 var(--fill-pct), #e2e8f0 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0284c7;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.calc-slider::-webkit-slider-thumb:hover,
.calc-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.6), 0 0 0 4px rgba(2, 132, 199, 0.2);
}

.calc-slider::-moz-range-track {
  height: 8px;
  border-radius: 9999px;
  background: #e2e8f0;
}

.calc-slider::-moz-range-progress {
  height: 8px;
  border-radius: 9999px;
  background: #0284c7;
}

.calc-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
  transition: transform 0.12s ease;
}

.slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-light);
  font-weight: 500;
  margin-top: -0.2rem;
}

/* Quick Presets Buttons */
.calc-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.calc-preset-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calc-preset-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.calc-preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.calc-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.calc-select {
  width: 100%;
  padding: 0.7rem 2.25rem 0.7rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230284c7' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.calc-select:hover {
  border-color: var(--primary);
}

/* ── Right Column: Visual & Results Panel ────────────────────────────────── */
.calc-results-panel {
  background: linear-gradient(145deg, var(--bg-subtle) 0%, var(--bg-surface) 100%);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

/* Hero Primary Result Card */
.calc-hero-res {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 1.35rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.25);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.calc-hero-res::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.calc-hero-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
  display: block;
  margin-bottom: 0.3rem;
}

.calc-hero-val {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: block;
}

@media (max-width: 480px) {
  .calc-hero-val {
    font-size: 1.8rem;
  }
}

/* SVG Chart Box */
.calc-chart-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.calc-svg-container {
  width: 160px;
  height: 160px;
  position: relative;
}

.calc-svg-chart {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.calc-chart-legend {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Secondary Metrics Grid */
.calc-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.calc-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-val.green { color: #059669; }
.metric-val.blue { color: #0284c7; }
.metric-val.amber { color: #d97706; }

/* Formula Note */
.calc-formula-note {
  background: #f0f9ff;
  border-left: 4px solid #0284c7;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #0369a1;
  line-height: 1.55;
}

.calc-formula-note strong {
  color: #0c4a6e;
}

/* Action Toolbar */
.calc-action-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.calc-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
}

.calc-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.calc-action-btn.btn-accent-schedule {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.calc-action-btn.btn-accent-schedule:hover {
  background: var(--primary-dark);
}

/* ── Expandable Year-by-Year Growth Schedule ─────────────────────────────── */
.calc-schedule-container {
  margin-top: 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: none;
  box-shadow: var(--shadow-sm);
}

.calc-schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.calc-schedule-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.calc-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.calc-schedule-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 2px solid var(--border-color);
}

.calc-schedule-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.calc-schedule-table tr:nth-child(even) td {
  background: var(--bg-subtle);
}

.calc-schedule-table td:first-child,
.calc-schedule-table th:first-child {
  text-align: center;
}

/* ── Key Scheme Highlights Summary Cards ─────────────────────────────────── */
.calc-highlights-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.calc-highlights-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 1.25rem;
}

.calc-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.calc-highlight-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.calc-highlight-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.calc-highlight-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.calc-highlight-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calc-highlight-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ── Modern How-It-Works Step Cards ──────────────────────────────────────── */
.how-steps-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.how-steps-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 1.5rem;
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.how-step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.how-step:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.how-step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.how-step-body {
  flex: 1;
}

.how-step-body strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.how-step-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Modern FAQ Accordion Section ───────────────────────────────────────── */
.faq-section-wrapper {
  margin-top: 2rem;
}

.faq-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 1.25rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease;
}

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

.faq-question {
  width: 100%;
  padding: 1.1rem 1.35rem;
  background: var(--bg-surface);
  border: none;
  text-align: left;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.15s ease;
}

.faq-question:hover {
  background: var(--bg-subtle);
}

.faq-icon {
  font-size: 0.85rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}

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

.faq-answer {
  padding: 0 1.35rem 1.25rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.faq-answer p {
  margin: 0;
}

/* ── Calculators Hub Page (`/calculators/index.html`) ───────────────────── */
.calc-hub-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2.5rem;
}

.calc-hub-search-box {
  margin-top: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.calc-hub-search-input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 2.8rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 9999px;
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.calc-hub-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.calc-hub-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Hub Category Tabs */
.calc-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.calc-filter-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-filter-tab:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.calc-filter-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

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

.calc-hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.calc-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.calc-hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calc-hub-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.calc-hub-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: #dcfce7;
  color: #15803d;
  text-transform: uppercase;
}

.calc-hub-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0.5rem 0 0.3rem;
  color: var(--text-main);
  line-height: 1.35;
}

.calc-hub-title a {
  color: inherit;
  text-decoration: none;
}

.calc-hub-title a:hover {
  color: var(--primary);
}

.calc-hub-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.calc-hub-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.calc-hub-actions .btn {
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  flex: 1;
  text-align: center;
  justify-content: center;
}

/* ── Print Media Optimization ───────────────────────────────────────────── */
@media print {
  .site-header, .gov-disclaimer-bar, .site-footer, .calc-quick-switch-wrapper, .calc-action-bar, .calc-presets {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .calc-workbench-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .calc-schedule-container {
    display: block !important;
  }
}
