/* ============================================
   India Tax Calculators - Main Stylesheet
   Light Theme | Mobile-First | AY 2026-27
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - Professional Blue Theme */
  --primary: #1e3a5f;
  --primary-light: #2d5a8b;
  --primary-dark: #0f1f33;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --success: #27ae60;
  --warning: #f1c40f;
  --danger: #e74c3c;
  --info: #3498db;
  
  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Typography */
  --font-display: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Monaco', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 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);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Layout */
  --header-height: 64px;
  --max-width: 1280px;
  --sidebar-width: 280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-900);
}

h1 { font-size: 2rem; margin-bottom: var(--space-lg); }
h2 { font-size: 1.5rem; margin-bottom: var(--space-md); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-sm); }
h4 { font-size: 1.125rem; margin-bottom: var(--space-sm); }

p { margin-bottom: var(--space-md); }

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

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow-md);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-md);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
}

/* Main Navigation */
.main-nav {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  color: var(--gray-700);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--primary);
  background: var(--gray-100);
}

.nav-link[aria-expanded="true"] {
  color: var(--primary);
  background: var(--gray-100);
}

.dropdown-arrow {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.nav-link[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--gray-700);
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
  color: var(--primary);
  background: var(--gray-100);
}

/* Search Box */
.search-box {
  position: relative;
  display: none;
}

.search-input {
  width: 200px;
  padding: var(--space-sm) var(--space-md);
  padding-left: 36px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  background: var(--gray-50);
  transition: all var(--transition-fast);
}

.search-input:focus {
  width: 280px;
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--gray-100);
}

.search-result-item:hover {
  background: var(--gray-50);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-category {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
}

.search-result-name {
  font-weight: 500;
  color: var(--gray-800);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-700);
}

.hamburger {
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: all var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: currentColor;
  left: 0;
  transition: all var(--transition-fast);
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.mobile-menu-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  padding: var(--space-md);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  z-index: 999;
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav-list {
  list-style: none;
}

.mobile-nav-item {
  border-bottom: 1px solid var(--gray-100);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  color: var(--gray-700);
  font-weight: 500;
}

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

.mobile-dropdown {
  display: none;
  padding-left: var(--space-md);
  background: var(--gray-50);
}

.mobile-dropdown.active {
  display: block;
}

.mobile-dropdown a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--gray-600);
  font-size: 0.9375rem;
}

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

.mobile-search {
  padding: var(--space-md);
  border-bottom: 1px solid var(--gray-200);
}

.mobile-search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
  flex: 1;
  padding: var(--space-xl) 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.breadcrumb a {
  color: var(--gray-600);
}

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

.breadcrumb-separator {
  margin: 0 var(--space-xs);
}

.breadcrumb-current {
  color: var(--gray-800);
  font-weight: 500;
}

/* AY Badge */
.ay-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ay-badge:hover {
  background: var(--primary-light);
}

/* Page Hero */
.page-hero {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  margin: calc(-1 * var(--space-xl)) calc(-1 * var(--space-md)) var(--space-xl);
}

.page-hero h1 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.page-hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Hero Search */
.hero-search {
  max-width: 500px;
  margin: var(--space-xl) auto 0;
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  padding-left: 48px;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-search-input:focus {
  outline: none;
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(255,255,255,0.3);
}

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

/* ============================================
   CARDS & COMPONENTS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

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

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

/* Calculator Card */
.calculator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.calculator-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: var(--space-lg);
}

.calculator-header h2 {
  color: var(--white);
  margin: 0;
}

.calculator-body {
  padding: var(--space-lg);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.9375rem;
}

.form-label .required {
  color: var(--danger);
}

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--gray-200);
  border-radius: 50%;
  font-size: 0.75rem;
  color: var(--gray-600);
  cursor: help;
  position: relative;
}

.tooltip-trigger:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 400;
  white-space: nowrap;
  max-width: 250px;
  white-space: normal;
  z-index: 100;
  margin-bottom: var(--space-xs);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input.error {
  border-color: var(--danger);
}

.form-input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.input-group {
  display: flex;
  gap: var(--space-sm);
}

.input-prefix,
.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
}

.input-prefix {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-prefix + .form-input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: var(--space-xs);
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-item:hover,
.checkbox-item:hover {
  border-color: var(--primary);
}

.radio-item input,
.checkbox-item input {
  accent-color: var(--primary);
}

.radio-item.selected,
.checkbox-item.selected {
  background: rgba(30, 58, 95, 0.05);
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-300);
}

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

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

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover:not(:disabled) {
  background: #219a52;
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Results Display */
.results-card {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.results-card.has-results {
  border-color: var(--success);
  background: rgba(39, 174, 96, 0.05);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.results-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.results-table th {
  font-weight: 500;
  color: var(--gray-600);
  font-size: 0.875rem;
}

.results-table td {
  color: var(--gray-800);
}

.results-table .amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.results-table tr.total {
  background: var(--primary);
  color: var(--white);
}

.results-table tr.total td {
  font-weight: 600;
  font-size: 1.125rem;
  border-bottom: none;
}

.results-table tr.subtotal {
  background: var(--gray-100);
}

.results-table tr.subtotal td {
  font-weight: 500;
}

.result-highlight {
  text-align: center;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.result-highlight-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: var(--space-xs);
}

.result-highlight-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Results Actions */
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   SECTIONS
   ============================================ */

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.category-tile {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

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

.category-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.category-tile h3 {
  margin-bottom: var(--space-sm);
}

.category-tile p {
  color: var(--gray-600);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.category-links a {
  font-size: 0.875rem;
  color: var(--gray-600);
  padding: var(--space-xs) 0;
}

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

/* Calculator Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.calculator-tile {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

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

.calculator-tile-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.calculator-tile-icon {
  width: 40px;
  height: 40px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.calculator-tile h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--gray-900);
}

.calculator-tile p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
  flex-grow: 1;
}

.calculator-tile-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calculator-tile-category {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calculator-tile-arrow {
  color: var(--primary);
  transition: transform var(--transition-fast);
}

.calculator-tile:hover .calculator-tile-arrow {
  transform: translateX(4px);
}

/* How It Works Section */
.how-it-works {
  margin-top: var(--space-2xl);
}

.how-it-works h2 {
  margin-bottom: var(--space-lg);
}

.formula-box {
  background: var(--gray-800);
  color: var(--gray-100);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

.formula-list {
  list-style: none;
  margin: var(--space-md) 0;
}

.formula-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: var(--space-md);
}

.formula-list li:last-child {
  border-bottom: none;
}

.formula-list .label {
  min-width: 150px;
  font-weight: 500;
  color: var(--gray-700);
}

.formula-list .value {
  color: var(--gray-600);
}

/* Examples Section */
.examples-section {
  margin-top: var(--space-2xl);
}

.example-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--primary);
}

.example-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.example-number {
  background: var(--primary);
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.example-title {
  font-weight: 600;
  color: var(--gray-800);
}

.example-inputs,
.example-calculation,
.example-result {
  margin-bottom: var(--space-md);
}

.example-inputs h4,
.example-calculation h4,
.example-result h4 {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xs);
}

.example-result {
  background: var(--gray-50);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

.example-result .amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* FAQs Accordion */
.faqs-section {
  margin-top: var(--space-2xl);
}

.faq-accordion {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

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

.faq-question {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background: var(--gray-50);
}

.faq-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

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

.faq-answer {
  padding: 0 var(--space-lg);
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.faq-item.active .faq-answer {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  max-height: 1000px;
}

.faq-answer p {
  color: var(--gray-600);
  margin: 0;
}

/* Related Calculators */
.related-section {
  margin-top: var(--space-2xl);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

.related-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.related-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.related-card h4 {
  font-size: 0.9375rem;
  margin-bottom: var(--space-xs);
  color: var(--gray-800);
}

.related-card p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0;
}

/* Disclaimer */
.disclaimer {
  background: #fff8e6;
  border: 1px solid #f1c40f;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.disclaimer-icon {
  margin-right: var(--space-sm);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-3xl) 0 var(--space-lg);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.footer-section h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--space-sm);
}

.footer-section a {
  color: var(--gray-400);
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--white);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-md);
}

.footer-description {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.footer-bottom {
  border-top: 1px solid var(--gray-700);
  padding-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer-legal {
  display: flex;
  gap: var(--space-lg);
}

.footer-legal a {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer-legal a:hover {
  color: var(--white);
}

.footer-updated {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  
  .page-hero {
    padding: var(--space-3xl) var(--space-xl);
    margin: calc(-1 * var(--space-xl)) 0 var(--space-xl);
    border-radius: var(--radius-lg);
  }
  
  .page-hero h1 {
    font-size: 3rem;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .main-nav {
    display: block;
  }
  
  .search-box {
    display: block;
  }
  
  .mobile-nav {
    display: none !important;
  }
  
  .calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  
  .input-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  
  .input-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }
  
  .calculator-layout {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .site-header,
  .site-footer,
  .main-nav,
  .mobile-nav,
  .mobile-menu-toggle,
  .search-box,
  .btn-group,
  .results-actions,
  .related-section,
  .faqs-section {
    display: none !important;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .calculator-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .results-card {
    border: 2px solid #000;
    page-break-inside: avoid;
  }
  
  .results-table th,
  .results-table td {
    border: 1px solid #ccc;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  .disclaimer {
    border: 1px solid #000;
    background: #f5f5f5 !important;
  }
  
  a[href]::after {
    content: none;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Live Region for Accessibility */
[aria-live] {
  position: relative;
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary);
  color: var(--white);
}

/* All Tools Grid */
.all-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.tools-column h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  font-size: 1rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

.tools-column h4:first-child {
  margin-top: 0;
}

.tools-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tools-column li {
  margin: 0.5rem 0;
}

.tools-column a {
  color: var(--text);
  text-decoration: none;
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.tools-column a:hover {
  background-color: var(--gray-100);
  color: var(--primary);
}
