:root {
  --primary: #00ff85;
  --primary-dark: #00cc6a;
  --primary-light: #33ff99;
  --secondary: #ffbf00;
  --bg-dark: #0a0a0a;
  --bg-card: rgba(20, 20, 30, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --brand-orange: #e65c00; /* main orange color */ 
  --brand-orange-hover: #ff7a00; /* lighter for hover */ 
  --brand-green: #00cc6a;
  
  /* Highlight colors for active settings (Dark theme) */
  --highlight-1-bg: rgba(0, 255, 133, 0.12);
  --highlight-1-border: #00ff85;
  --highlight-2-bg: rgba(255, 191, 0, 0.12);
  --highlight-2-border: #ffbf00;
  --highlight-3-bg: rgba(0, 204, 255, 0.12);
  --highlight-3-border: #00ccff;
  --highlight-4-bg: rgba(255, 100, 255, 0.12);
  --highlight-4-border: #ff64ff;
  
  /* Settings icon color */
  --settings-icon-color: #00ccff; /* Cyan for dark theme */
}

html.theme-light {
  --primary: #e65c00;        /* 🧡 main dark orange */
  --primary-dark: #b34700;   /* deeper orange for focus/hover */
  --primary-light: #ff944d;  /* lighter orange accent */
  --secondary: #00cc6a;      /* keep Fundulator’s green accent */
  --bg-card: #ffffff;             /* pure white background for crisp cards */
  --bg-glass: rgba(255, 255, 255, 0.8); /* soft glassy overlay */
  --bg-dark: #fafafa;             /* page background stays light gray */
  --text-primary: #222;
  --text-secondary: #4a4a4a;
  --text-muted: #b0b0b0;
  --border: rgba(230, 92, 0, 0.15);
   --shadow: 0 4px 16px rgba(0, 0, 0, 0.08); /* soft subtle shadow */
  --gradient: linear-gradient(135deg, #e65c00, #00cc6a);
  
  /* Highlight colors for active settings (Light theme) */
  --highlight-1-bg: rgba(230, 92, 0, 0.15);
  --highlight-1-border: #e65c00;
  --highlight-2-bg: rgba(255, 193, 7, 0.20);
  --highlight-2-border: #FFA000;
  --highlight-3-bg: rgba(33, 150, 243, 0.15);
  --highlight-3-border: #2196F3;
  --highlight-4-bg: rgba(156, 39, 176, 0.15);
  --highlight-4-border: #9C27B0;
  
  /* Settings icon color */
  --settings-icon-color: #FF6F00; /* Deep orange for light theme */
}


html.theme-dark {
  /* Default dark theme variables above */
}

/* Advanced setting highlight when active - reusable across all calculators */
.advanced-setting-section {
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Settings icon styling - reusable for all calculators */
.settings-icon {
  color: var(--settings-icon-color);
  font-weight: 700;
  filter: brightness(1.2);
  display: inline-block;
  font-size: 1.3em;
}

/* Advanced settings - smaller labels and inputs */
.calculator-box .advanced-settings-container .input-group label,
.calculator-box .advanced-settings-container .label-row label,
.calculator-box .advanced-settings-container input,
.calculator-box .advanced-settings-container select,
.calculator-box .advanced-settings-container .inputs input,
.calculator-box .advanced-settings-container .inputs select {
  font-size: 0.88rem !important;
  font-weight: bold !important;
}

.advanced-setting-section.active.highlight-1 {
  background: var(--highlight-1-bg);
  border-left: 3px solid var(--highlight-1-border);
  padding-left: 12px;
}

.advanced-setting-section.active.highlight-2 {
  background: var(--highlight-2-bg);
  border-left: 3px solid var(--highlight-2-border);
  padding-left: 12px;
}

.advanced-setting-section.active.highlight-3 {
  background: var(--highlight-3-bg);
  border-left: 3px solid var(--highlight-3-border);
  padding-left: 12px;
}

.advanced-setting-section.active.highlight-4 {
  background: var(--highlight-4-bg);
  border-left: 3px solid var(--highlight-4-border);
  padding-left: 12px;
}

/* Theme Switcher Vertical Slider */
.theme-switcher-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-left: 32px;
  position: relative;
  gap: 4px;
}

.theme-label {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1;
}

.theme-slider {
  position: relative;
  height: 36px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-slider input[type="range"] {
  width: 32px;
  height: 36px;
  background: transparent;
  accent-color: var(--primary);
  cursor: pointer;
  border: none;
  outline: none;
}

/* Hide decorative slider span */
.theme-slider .slider {
  display: none;
}

/* You can customize the slider thumb if needed */
.theme-slider input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid var(--secondary);
  box-shadow: 0 0 8px var(--primary-light);
}

.theme-slider input[type="range"]:focus {
  outline: none;
}

/* --- Rest of your styles below (keep unchanged) --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 255, 133, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 191, 0, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Light theme override for body background */
html.theme-light body {
  background:
    radial-gradient(circle at 20% 20%, rgba(30,144,255, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 191, 0, 0.13) 0%, transparent 50%),
    linear-gradient(135deg, #f2f9ff 0%, #f8e1f4 100%);
}

/* Animated background elements */
.bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}
.shape {
  position: absolute;
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  opacity: 0.1;
}
.shape:nth-child(1) {
  width: 300px; height: 300px;
  background: var(--gradient);
  top: 10%; left: -10%;
  animation-delay: 0s;
}
.shape:nth-child(2) {
  width: 200px; height: 200px;
  background: linear-gradient(135deg, var(--secondary), #ff8c00);
  top: 60%; right: -5%;
  animation-delay: 2s;
}
.shape:nth-child(3) {
  width: 150px; height: 150px;
  background: var(--gradient);
  bottom: 20%; left: 20%;
  animation-delay: 4s;
}
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(180deg); }
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: all 0.3s ease;
  margin-bottom: 0;
}
html.theme-light .navbar {
  background: #f7faff !important;             /* same family as card backgrounds */
  border-bottom: 1px solid #dde8ff !important; /* soft blue divider */
  box-shadow: 0 2px 8px rgba(30,144,255,0.08) !important; /* subtle blue shadow */
}
.navbar.scrolled {
  backdrop-filter: none;
  background: rgba(10, 10, 10, 0.96);
  padding: 12px 24px;
  box-shadow: var(--shadow);
}
.navbar h1 {
  font-size: 1.8rem;
  color: var(--primary);
  display: flex;
  align-items: center;
   font-weight: normal;
  letter-spacing: -0.02em;
}

.navbar h1 .logo {
  width: 55px;
  height: 55px;
  margin-right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: none; /* remove old gradient box */
}

.logo-img {
   width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
}
body {
  padding-top: 70px; /* adjust if navbar height changes */
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto; 
  padding: 0 24px;
}


/* --- Super Small Screens Fix (below 400px) --- */
@media (max-width: 450px) {
  .navbar {
    padding: 0 !important;
    height: 55px !important;        /* consistent bar height */
    flex-wrap: nowrap;
    justify-content: space-between;
    overflow: visible;              /* prevents cropping of logo */
  }

  .navbar h1 .logo {
    width: 42px !important;         /* ✅ smaller logo box */
    height: 42px !important;
    margin-right: 4px;
  }

  .logo-img {
    width: 100% !important;         /* ✅ scale logo to fit */
    height: 100% !important;
    object-fit: contain !important;
  }

  /* Theme switcher */
  .theme-switcher-container {
    transform: scale(0.85);          /* ✅ slightly smaller toggle */
    transform-origin: center;
    gap: 2px;
    margin-left: 4px;
  }

  .theme-label {
    font-size: 0.75rem;
  }

  /* Menu icon area */
  .menu-dropdown-container {
    margin-left: 4px;
  }

  .menu-btn {
    padding: 4px 6px;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-icon span {
    width: 15px;
    height: 2px;
  }

  /* Keep title + logo inline */
  .brand-link {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 1.3rem !important;
    letter-spacing: -0.01em;
  }
  .brand-link .rupee {
    font-size: 1.5rem !important; /* keeps ₹ slightly larger */
  }

}

.nav-stats {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Make logo + brand clickable without underline */
.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--brand-orange);
  transition: color 0.3s ease;
  font-size: 1.8rem;
}

.brand-link:hover {
  color: var(--brand-orange-hover);
}

.brand-link .rupee {
  color: var(--brand-green);
  margin-left: 2px;
}

.brand-link .logo {
  margin-right: 12px;
}


/* Hero Section */
.hero {
  text-align: center;
  padding: 0px 20px 0px;
  position: relative;
  margin: 0;
}
.hero h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
  line-height: 1.1;
}
.hero p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  font-weight: 300;
  margin-bottom: 0;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0px;
  margin-top: 32px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

/* Calculator Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 10px 24px 4px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
}
.card {
  background: var(--bg-card);
  border-radius: 4px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}
.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 16px 40px rgba(0, 255, 133, 0.2);
}
.card:hover::before { opacity: 0.1; }
.card.selected {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(0, 255, 133, 0.3);
  transform: translateY(-4px);
}
.card.selected::before { opacity: 0.05; }
.card-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;

  /* 🧹 Remove background + shadows */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0;
  overflow: visible; /* ensures glow from SVG isn't clipped */
}

.card:hover .card-icon { transform: scale(1.1) rotate(5deg); }
.card-title {
  color: var(--text-primary); /* <-- FIXED */
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0px;
}
  .card:hover .card-icon {
      transform: scale(1.25);
      box-shadow: 0 0 16px rgba(0, 255, 133, 0.35);
    }

 .card-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 0;
 display: block;
  background: none;
    }

html.theme-dark .card-icon img {
  filter: brightness(1.2);
}
html.theme-light .card-icon img {
  filter: brightness(0.8);
}


.cards a.card {
  text-decoration: none !important;
  color: inherit;
}

.cards a.card .card-title,
.cards a.card:hover .card-title,
.cards a.card:focus .card-title,
.cards a.card:active .card-title {
  text-decoration: none !important;
  color: var(--text-primary) !important; /* <-- FIXED */
}

/* Remove underline on hover/focus/active too */
.cards a.card:hover,
.cards a.card:focus,
.cards a.card:active {
  text-decoration: none !important;
}

.card-icon.sip-icon {
  background: linear-gradient(135deg, #00ff85, #007fff 90%);
}
.card-icon.ppf-icon {
  background: linear-gradient(135deg, #ffbf00, #ff8c00 90%);
}
.card-icon.fd-icon {
  background: linear-gradient(135deg, #ff6b6b, #ffd700 90%);
}
.card-icon.emi-icon {
  background: linear-gradient(135deg, #00ff85, #e040fb 90%);
}
.card-icon.nps-icon {
  background: linear-gradient(135deg, #20c997, #007bff 90%);
}
.card-icon.epf-icon {
  background: linear-gradient(135deg, #ffbf00, #43cea2 90%);
}
.card-icon.mf-icon {
  background: linear-gradient(135deg, #1e90ff, #f7971e 90%);
}

.calculator-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 24px;

}

/* Category containers — transparent with primary outline */
.calc-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none; /* transparent group */
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 10px;
  transition: all 0.3s ease;
}

.calc-column:hover {
  box-shadow: 0 0 18px rgba(0, 255, 133, 0.25);
  transform: translateY(-10px);
}

.calc-column h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 6px;
  text-align: center;
}

/* Inner grid (2 columns per group) */
.cards.small-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  width: 100%;
}

/* ✅ Cards with background (var(--bg-card)) */
.cards.small-grid .card {
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card); /* restored background */
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Hover effect with glow */
.cards.small-grid .card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 0 10px rgba(0, 255, 133, 0.25);
}



/* ✅ Mobile stacking order (Investment → Loans → Retirement) */
@media (max-width: 900px) {
  .calculator-groups {
    grid-template-columns: 1fr;
    height: auto;
  }

  .calc-column:nth-child(1) { order: 2; } /* Loans second */
  .calc-column:nth-child(2) { order: 1; } /* Investment first */
  .calc-column:nth-child(3) { order: 3; } /* Retirement third */

  .calc-column {
    width: 100%;
  }

  .cards.small-grid {
    grid-template-columns: 1fr 1fr; /* still 2 per row on mobile */
  }
}


/* Calculator Section */
.calculator-section {
  display: flex;
  justify-content: center;
  padding: 0 0px;
  margin-bottom: 20px;
  margin-top: 0 ;
  padding-top: 0 ;
}

/* 🧩 Center results vertically within calculator box */
.calculator-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 16px;
  font-size: 0.97rem;
  min-width: 280px;
  max-width: 750px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: slideUp 0.5s ease-out;
}

/* 🧩 Center results section only */
.calculator-box .results {
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical centering */
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inputs & Results Flex */
.inputs, .results {
  flex: 1 1 50%;
  min-width: 0;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  gap: 4px;
font-size: 0.96rem;
}

/* Input Groups */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.input-group label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
font-size: 0.98rem;
}
.inputs input, .inputs select, .inputs button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-size: 1.1rem;
  background: var(--bg-glass);
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
 font-weight: 500;
}
.inputs input:focus, .inputs select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 133, 0.1);
  transform: translateY(-1px);
}
.inputs input[type="number"] {
  color: var(--text-primary);
  background: var(--bg-glass);
}
.inputs select {
  background-color: var(--bg-glass);
  color: var(--text-primary);
  border: 2px solid var(--border);
}
.inputs select option {
  background-color: #f5faff; /* Light background */
  color: #222; 
}
.inputs button {
  background: var(--gradient);
  color: #000;
  font-weight: 600;
  cursor: pointer;
  border: none;
  margin-top: 8px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}
.inputs button::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}
.inputs button:hover::before { left: 100%; }
.inputs button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 255, 133, 0.3);
}
.inputs button:active { transform: translateY(0); }

/* Tabs */
.sip-tab, .fd-tab {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sip-tab.selected, .fd-tab.selected {
  background: var(--bg-card);
  border-color: var(--primary-light);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 255, 133, 0.3);
  transform: translateY(-4px);
  font-weight: 700;
  outline: 2px solid var(--primary);
  outline-offset: 0px;
}
.sip-tab:not(.selected), .fd-tab:not(.selected){
  background: transparent;
  border-color: var(--primary);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(0, 255, 133, 0.12);
  transform: translateY(-2px);
}
.sip-tab:not(.selected):hover, .fd-tab:not(.selected):hover {
  border-color: var(--primary-light);
  background: var(--bg-glass);
  color: var(--primary);
}

/* --- Result Row Layout --- */
.result-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}

/* Label: left-aligned, fixed column width */
.result-item > span:first-child {
  flex: 0 0 48%;          /* fixed label width */
  text-align: left;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;

  /* 🧩 Added breathing space */
  padding: 6px 10px 6px 4px; /* top, right, bottom, left */
  margin-right: 6px;          /* subtle gap before value */

  box-sizing: border-box;
  line-height: 1.4;
}

/* Value: right-aligned, fills rest of the row */
.result-item > span:last-child {
  flex: 1;
  text-align: left;
  color: var(--text-primary);
  font-weight: 950;
  font-size: 0.95rem;
  white-space: normal;      /* 👈 allow wrapping */
  word-break: break-word;   /* 👈 handle long words gracefully */
  line-height: 1.4;
}

/* --- Highlighted rows (EMI, Total Payment, Interest Saved, etc.) --- */
.result-item.highlight {
  display: flex;
  flex-direction: column;      /* 👈 stack label above value */
  align-items: center;         /* 👈 center horizontally */
  text-align: center;          /* 👈 center text */
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
}

/* Label (top text) */
.result-item.highlight > span:first-child {
  flex: none;
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* Value (below, larger, colored) */
.result-item.highlight > span:last-child {
  flex: none;
  width: 100%;
  text-align: center;
  font-size: 2rem !important;
  font-weight: 1000 !important;
  color: var(--text-primary) !important;
  line-height: 1.25;
}

/* Smaller variant */
.result-item.small > span {
  font-size: 0.95rem;
  font-weight: 500;
}



/* Chart Container */
.chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 220px;        /* Fixed height prevents shifting */
  min-height: 220px;
  max-height: 220px;    /* Optional if you want to ensure no overflow */
  background: var(--bg-glass);
  border-radius: 6px;
  padding: 4px;
  margin-top: 14px;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.chart-container canvas {
  margin: 0 auto;
  display: block;
}

/* Error Messages */
.error-msg {
  color: #ff6b6b;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 107, 0.2);
}


/* --- FAQ Section Styles --- */
.faq-section {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 16px 18px;
  max-width: 950px;
  margin: 24px auto;
  color: var(--text-primary);
  font-size: 1rem;
}
.faq-section h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 700;
}
.faq-section details {
  margin-bottom: 8px;
}
.faq-section summary {
  font-size: 1.1rem;
font-weight: 600;
  cursor: pointer;
  color: var(--primary);
}

/* 📱 Responsive tweak for small screens (≤500px) */
@media (max-width: 500px) {
  .faq-section {
    padding: 12px 14px;
    margin: 16px auto;
    font-size: 0.95rem;
  }

  .faq-section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .faq-section summary {
    font-size: 0.9rem;
  }

  .faq-section details {
    margin-bottom: 6px;
  }
}

/* --- Two-Column Centered Footer --- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--primary);
  padding: 20px 12px 18px  ;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 40px;
}

.footer-content {
  max-width: 950px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Two-column grid centered */
.footer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  justify-content: center;
  width: 100%;
  max-width: 700px;
}

/* Column sections */
.footer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-section h4 {
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Info links (single column) */
.footer-links.vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

/* Calculator links (two columns) */
.footer-links.two-col {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px 24px;
  justify-content: center;
}

/* Link styling */
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Branding & Disclaimer */
.footer-note {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

.footer-disclaimer {
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 700px;
  opacity: 0.9;
  text-align: center;
}

/* 🧩 Keep footer two-column even on small screens */
@media (max-width: 768px) {
  .footer-columns {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
    text-align: left !important;
    justify-items: center !important;
  }

  .footer-links.vertical {
    align-items: flex-start !important;
  }

  .footer-links.two-col {
    justify-items: center !important;
  }
}


/* --- Scroll to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #000;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 0 10px var(--primary);
  transition: transform 0.3s, opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  z-index: 9999; /* stays above everything */
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 18px var(--primary-light);
}


/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive Design */
@media (max-width: 1023px) {
  .calculator-layout {
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    gap: 16px;
    padding: 0;
  }

  .calculator-box {
    display: flex;
    flex-direction: column;   /* stack inputs & results */
    width: 100%;
    max-width: 95%;           /* avoids touching edges */
    min-width: 0;
    padding: 20px 16px;
    margin: 0 auto;           /* equal left/right */
    box-sizing: border-box;
  }

  .inputs, 
  .results {
    width: 100%;              /* each takes full width */
    max-width: 100%;
    margin: 0;
  }

  .results {
    margin-top: 20px;         /* gap below inputs */
    min-height: 260px;
  }

.side-info{
    width: 80%;            /* not full width */
    max-width: 480px;      /* optional, keeps it narrow on tablets */
    margin: 0 auto;        /* center horizontally */
}
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 16px 8px 20px;
  }
  .card { padding: 20px 16px; }
  .hero { padding: 40px 16px 32px; }
  .hero-stats { gap: 16px; }

  .nav-stats { display: none; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .hero h2 { font-size: 2rem; }
}

/* Input group flex row for NPS etc */
.input-group.flex-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: flex-end;
}
.input-group.flex-row > div {
  flex: 1 1 0;
  min-width: 0;
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Stylish sliders for inputs */
.inputs input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 2px;
  margin-top: 12px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
}
.inputs input[type="range"]::-webkit-slider-thumb {
  width: 18px; height: 18px;
  background: var(--primary);
  border: 2px solid var(--secondary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary-light);
  transition: background 0.2s;
}
.inputs input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--primary-dark);
}
.inputs input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--primary);
  border: 2px solid var(--secondary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary-light);
  transition: background 0.2s;
}
.inputs input[type="range"]:hover::-moz-range-thumb {
  background: var(--primary-dark);
}
.inputs input[type="range"]:focus { outline: none; }

.suggestions {
  position: absolute;
  z-index: 99;
  width: 100%;
  background: #222;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.22);
  max-height: 240px;
  overflow-y: auto;
}
.suggestion-item:hover {
  background: #333;
  color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  vertical-align: middle;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(128, 128, 128, 0.3);
  border: 2px solid rgba(128, 128, 128, 0.6);
  border-radius: 30px;
  transition: all 0.3s ease;
}
.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 14px; width: 14px;
  left: 3px; 
  top: 3px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .slider {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(0,255,133,0.3);
}
.toggle-switch input:checked + .slider:before {
  transform: translateX(18px);
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* --- LIGHT THEME CARD STYLES --- */
html.theme-light .card {
  background: linear-gradient(120deg, #e3f2fd 70%, #fffbe6 100%, #f8e1f4 120%);
  box-shadow: 0 6px 24px rgba(30,144,255,0.08), 0 2px 8px #ffbf0033;
  border: 2px solid var(--primary-light);
}
html.theme-light .card-icon {
  background: linear-gradient(135deg, #1e90ff 50%, #ffbf00 100%);
}
html.theme-light .card-icon.sip-icon {
  background: linear-gradient(135deg, #1e90ff 60%, #00ff85 100%);
}
html.theme-light .card-icon.ppf-icon {
  background: linear-gradient(135deg, #ffbf00 60%, #ff6b6b 100%);
}
html.theme-light .card-icon.fd-icon {
  background: linear-gradient(135deg, #ffd700 60%, #ff6b6b 100%);
}
html.theme-light .card-icon.emi-icon {
  background: linear-gradient(135deg, #ff8c00 60%, #1e90ff 100%);
}
html.theme-light .card-icon.nps-icon {
  background: linear-gradient(135deg, #007bff 60%, #43cea2 100%);
}
html.theme-light .card-icon.epf-icon {
  background: linear-gradient(135deg, #43cea2 60%, #ffbf00 100%);
}
html.theme-light .card-icon.mf-icon {
  background: linear-gradient(135deg, #f7971e 60%, #1e90ff 100%);
}
html.theme-light .card:hover {
  border-color: #1565c0;
  box-shadow: 0 16px 40px rgba(21,101,192,0.18), 0 2px 8px #1565c0;
}
html.theme-light .card:hover::before {
  opacity: 0.20;
  background: linear-gradient(135deg, #1565c0 85%, #1e90ff 100%);
}

/* Highlight calculator box and inputs in light theme */
html.theme-light .calculator-box {
  background: #fff;
  box-shadow: 0 4px 24px rgba(30,144,255,0.07), 0 2px 8px #1e90ff22;
  border: 2px solid #dde8ff;
}

html.theme-light .results {
  background: #f7fcff;
  border: 2px solid #dde8ff;
}

/* Make SIP calculator inputs & grid lines stand out in light theme */
html.theme-light .calculator-box {
  background: #fff;
  box-shadow: 0 8px 32px rgba(30,144,255,0.08); /* More prominent shadow */
  border: 2px solid #b8d3fe; /* Stronger border */
}

.menu-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 0px;
}

.menu-btn {
  background: var(--bg-card);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: background 0.2s;
}

.menu-btn:hover {
  background: var(--primary-light);
  color: #222;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-icon span {
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  display: block;
}

.menu-text {
  font-weight: 600;
}

.menu-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  background: var(--bg-dark);
  border-radius: 10px;
  padding: 12px 0 8px 0;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  z-index: 9999;
}

.menu-section {
  padding: 0 16px;
}

.menu-section-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 2px;
}

.menu-section-toggle .arrow {
  margin-left: 8px;
  font-size: 1rem;
  transition: transform 0.2s;
}

.menu-section-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0 2px 0;
}

.menu-section-list a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.97rem;
  padding: 4px 0;
  transition: color 0.2s;
  border-radius: 4px;
}

.menu-section-list a:hover {
  color: var(--primary);
  background: var(--bg-glass);
}

.menu-btn:hover .menu-icon span {
  background: #222;
}

html.theme-light .menu-btn:hover .menu-icon span {
  background: #fff;
}

/* Make dropdown links match footer link style */
.menu-dropdown a {
  text-decoration: none !important;
  color: var(--text-primary) !important;
}

.menu-dropdown a:hover {
  color: var(--primary) !important;
}


.result-item.inflation-red span {
  color: #ff4136 !important;
  font-weight: 700;
}
.result-item.inflation-red span:last-child {
  color: #ff4136 !important;
  font-size: 1.4rem;
  font-weight: 800;
}


html.theme-light .sip-tab,
html.theme-light .fd-tab {
  background: #f2f8ff;         /* Light blue background */
  border: 0px solid #b8d3fe;   /* Soft blue border */
  color: #222;              /* Blue text */
  box-shadow: 0 1px 4px #dde8ff;
}


.calculator-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  margin-top: 0px;
  position: relative;
}

.side-info {
  flex: 0 0 300px;
  max-width: 300px;
  min-width: 200px;
  background: var(--bg-card); 
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
  border: 1.5px solid var(--border);
  padding: 18px 14px;
  color: var(--text-primary);
  font-size: 0.97rem;
  position: relative;
  top: 36px; /* Push a bit below the calculator, like shoulder height */
  max-height: 400px; /* Limit height to calculator box */
  overflow-y: auto;
  scrollbar-width: thin;
}

.side-info h3 {
  font-size: 1.07rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.side-info details {
  margin-bottom: 8px;
}

.side-info summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.side-info ul {
  margin-left: 18px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.side-info p {
  margin-bottom: 6px;
}

/* Make calculator box a bit higher than side boxes */
.calculator-layout .calculator-box {
  align-self: flex-start;
  margin-top: 0;
  z-index: 1;
}



/* Left-Box and Right-Box formatting */

html.theme-dark .side-info-left h3 {
  color: #00ff85;
  font-weight: 800;
}

html.theme-dark .side-info-left summary {
  color: #ffbf00;
}

html.theme-dark .side-info-left ul li a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
html.theme-dark .side-info-left ul li a:hover {
  color: #ffbf00;
  text-decoration: underline;
}

html.theme-dark .side-info-left details[open] > summary {
  color: #ffbf00;
  font-weight: 700;
}

@media (min-width: 1025px) {
.calculator-section {
    padding-left: 0 !important;  /* Remove left padding */
    margin-left: 0 !important;   /* Remove left margin */
  }
  .side-info-left {
    max-width: 200px;
    min-width: 200px;
    flex: 0 0 200px;
    padding-left: 0px;
    padding-right: 0px;
    margin-left: 25px;
  }
  .calculator-box {
    flex: 0 0 700px;
    min-width: 700px;
    max-width: 700px;
    margin-left: 0;
  }

 .calculator-layout#homeLoanLayout {
    justify-content: flex-start;   /* align children to left */
    margin-left: 0;                /* remove auto-centering */
    margin-right: auto;            /* let calculator take remaining space */
    width: 100%;                   /* stretch full width */
    max-width: 100%;               /* no centering cap */
  }

  .calculator-layout#homeLoanLayout .side-info-left {
    margin-left: 0 !important;     /* stick to left border */
  }

  #homeLoanBox.calculator-box {
    /* flex: 0 0 1050px; */
    /* min-width: 1050px; */
    max-width: 1050px;
    width: 100%;         /* but shrink if screen is smaller */
    box-sizing: border-box;
    margin-left: 40px;   /* move box slightly left */
    margin-right: 40px;  /* keep flexible on right side */
  }

 #homeLoanBox .inputs,
  #homeLoanBox .results {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  .side-info-right {
    flex: 0 0 300px;
    min-width: 300px;
    max-width: 300px;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .calculator-layout {
    justify-content: flex-start;
    gap: 32px; /* More space between left box and calculator */
  }
.inputs {
    flex: 0 0 55%;
    min-width: 0;
    max-width: 55%;
  }
  .results {
    flex: 0 0 45%;
    min-width: 0;
    max-width: 45%;
  }
}

/* ✅ Modern responsive layout for label-row + input */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
}

.label-row select,
.label-row .month-year-picker-wrapper {
  display: block;
  margin: 0 auto;              /* ✅ centers the box horizontally */
  text-align-last: center;     /* ✅ centers selected text in select */
}

/* optional – if you want both aligned in the same style */
.label-row .month-year-picker-wrapper {
  text-align: center;
}
.label-row label {
  flex: 0 0 40%; /* label takes ~40% width */
  text-align: left;
  font-weight: 700; /* make label bold */
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.label-row input.compact-input {
  flex: 1;
  width: 100%;
  max-width: 60%;
  text-align: center;
  padding: 8px 10px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;

  /* Default (light theme look) — soft neutral black border */
  border: 1.8px solid rgba(0, 0, 0, 0.25);

  background: var(--bg-glass);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 🌙 Dark theme: lighter white border for contrast */
html.theme-dark .label-row input.compact-input {
  border: 1.8px solid rgba(255, 255, 255, 0.35);
}
html.theme-dark .label-row input.compact-input:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}


/* Focus/hover styling */
.label-row input.compact-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 4px var(--primary);
  outline: none;
}


@media (max-width: 500px) {
  .label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px; /* reduce overall spacing */
  }

  .label-row label {
    width: 100%;
    text-align: left;
    margin-bottom: 2px; /* was 4px — reduce to tighten gap */
  }

  .label-row input.compact-input {
    width: 100%;
    max-width: 100%;
    text-align: center;
    padding: 6px 8px; /* reduce vertical padding slightly */
  }

}

.month-year-picker-wrapper {
  flex-shrink: 0;      /* don’t let picker shrink */
  display: inline-flex; /* ✅ prevents full-width block */
  width: auto !important; /* ✅ fixes the wrapping */
}

.compact-input {
  width: 135px;         /* fixed width instead of % */
  min-width: 135px;     /* safeguard for very small screens */
  max-width: 215px;
  text-align: left;     /* text inside input is left aligned */
  padding: 6px 8px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-family: inherit;
}

.input-group input[type="range"] {
  width: 100%;
  margin-top: 6px;
}

.breadcrumb {
  font-size: 0.98rem;
  color: var(--text-secondary);
  padding: 0px 24px 0 24px;
  margin: 0 auto;
  max-width: 1200px;
  letter-spacing: 0.01em;
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.breadcrumb span {
  color: var(--text-secondary);
  font-weight: 500;
}
@media (max-width: 900px) {
  .breadcrumb {
    padding: 8px 16px 0 16px;
    font-size: 0.92rem;
  }
}

/* --- Compact SIP Calculator Overrides --- */

/* Calculator Box */

.input-group {
  gap: 0;
}


/* Compact input fields */
.compact-input {
  width: 90px;
  font-size: 0.92rem;
  padding: 4px 6px;
}

/* Sliders smaller */
.inputs input[type="range"] {
  margin-top: 4px;
  margin-bottom: 4px;
  height: 3px;
}
.inputs input[type="range"]::-webkit-slider-thumb {
  width: 14px; height: 14px;
}
.inputs input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
}


/* Chart smaller */
.chart-container {
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  margin-top: 8px;
}

/* Prevent horizontal scroll on mobile */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Ensure calculator and side boxes don’t overflow */
.calculator-box,
.calculator-layout,
.side-info {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Highlight calculator box in dark mode */
html.theme-dark .calculator-box {
  background: #111; /* keeps dark box */
  border: 2px solid #00ff85;
  box-shadow: 0 0 16px rgba(0, 255, 133, 0.4);
}

/* Highlight calculator box in light mode */
html.theme-light .calculator-box {
  background: #fdfdfd !important;
  border: 2px solid var(--primary) !important;
  box-shadow: 0 0 16px rgba(30, 144, 255, 0.4) !important;
}


#fdBox select#fdPeriodYears,
#fdBox select#fdPeriodMonths,
#fdBox select#fdPeriodDays {
  width: 70px;
  min-width: 60px;
  max-width: 60px;
  font-size: 1.0rem;
  padding: 2px 4px;
}

#fdBox label[for="fdPeriodYears"],
#fdBox label[for="fdPeriodMonths"],
#fdBox label[for="fdPeriodDays"] {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

#fdBox select#fdPayout {
  font-family: 'Arial', sans-serif;   /* Change font here */
  font-size: 1.05rem;                /* (optional) Change size */
  font-weight: 600;                  /* (optional) Make bold */
}


.hlPrepayEnable {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  margin: 0;
  vertical-align: middle;
}

.amortization-box {
  margin: 28px auto 0 auto;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  max-width: 900px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.amortization-scroll {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 6px;
}
#hlAmortTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.99rem;
}
#hlAmortTable th, #hlAmortTable td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: right;
}
#hlAmortTable th {
  background: var(--card-bg);
  color: var(--primary);
  position: sticky;
  top: 0;
}
#hlAmortTable td:first-child, #hlAmortTable th:first-child {
  text-align: center;
}

.month-year-picker-input {
  border: 1px solid #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: inline-block;
  min-width: 120px;
  text-align: center;
}

.theme-light .month-year-picker-input {
  background: #fff;
  border-color: #ccc;
  color: #222;
}

/* Dark theme field */
.theme-dark .month-year-picker-input {
  background: #2a2a2a;
  border-color: #555;
  color: #eee;
}
.myp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.myp-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.myp-cell {
  padding: 6px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
}
/* Light theme hover */
.theme-light .myp-cell:hover {
  background: #f0f0f0;
  color: #000;
}

/* Dark theme hover */
.theme-dark .myp-cell:hover {
  background: #555;   /* lighter than background, darker than selected */
  color: #fff;        /* force text to white for contrast */
}
.myp-cell.selected {
  background: #007bff;
  color: #fff;
}

.month-year-picker-wrapper {
  position: relative;   /* anchor popup here */
  display: inline-block;
  width: 100%;
}

.month-year-popup {
  position: absolute;
  top: 100%;            /* directly below input */
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 1000;
  min-width: 180px;
}
/* Light theme */
.theme-light .month-year-popup {
  background: #fff;
  border-color: #ccc;
  color: #222;
}

/* Dark theme */
.theme-dark .month-year-popup {
  background: #2a2a2a;
  border-color: #555;
  color: #eee;
}

.myp-header button {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  color: inherit;  /* matches theme text */
}
.myp-header button:hover {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}
.myp-year-label {
  font-weight: 600;
  cursor: pointer;
}

#hlEarlyRow {
  background-color: #00ff8520 !important; /* Light green background */
  border-radius: 6px;
  margin: 4px 0;
}

#hlInterestSavedRow {
  background-color: #00ff8520 !important; /* Light green background */
  border-radius: 6px;
  margin: 4px 0;
}

#hlEarlyRow .result-value,
#hlInterestSavedRow .result-value {
  font-size: 1.1rem !important;
  font-weight: bold !important;
}


#ucDisbursementTable .ucDel {
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #d32f2f;   /* red */
  cursor: pointer;
  padding: 0;
}
#ucDisbursementTable .ucDel:hover {
  color: #b71c1c;
}

/* UC Loan Box */
.uc-loan-box {
  background: var(--bg-glass);
  border: 2px dashed var(--primary);
  padding: 4px;
  margin-top: 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

html.theme-light .uc-loan-box {
  background: #f7fcff;
  border-color: var(--primary);
}

html.theme-dark .uc-loan-box {
  background: #111;
  border-color: #00ff85;
}

/* Force full-width stacked layout on tablets and iPads */
@media (max-width: 1023px) {
  .calculator-layout {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding: 0 0px !important;
    gap: 16px !important;
    margin: 0 !important;
  }

  .calculator-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    order: 1 !important;
  }

  .side-info-right {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 40px auto !important;
    order: 2 !important;
  }

  .side-info-left {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 40px auto !important;
    order: 3 !important;
  }

  .inputs,
  .results {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    margin: 0 !important;
  }

  .results {
    margin-top: 16px !important;
  }
}


/* Laptops and larger screens */
@media (min-width: 1025px) {
  .calculator-layout {
    justify-content: center;      /* center the box horizontally */
  }

  .calculator-box {
    flex: 1 1 auto;               /* allow flexible growth */
    width: 100% !important;
    max-width: 1100px !important; /* wider cap for desktops */
    margin: 0 auto !important;    /* center it */
  }
}

.calculator-box .inputs label,
.calculator-box .inputs input,
.calculator-box .inputs select,
.calculator-box .inputs button,
.calculator-box .results,
.calculator-box .result-item {
  font-size: 1rem !important;
}

.calculator-box .result-value {
  font-size: 1rem !important;  /* make EMI/Interest numbers bigger */
  font-weight: 700;
}


/* Full edge-to-edge calculator on mobile */
@media (max-width: 500px) {
.calculator-section {
padding: 0 !important; /* kill side padding */
margin: 0 !important;
width: 100% !important;
}

.calculator-layout {
padding: 0 !important;
margin: 0 !important;
width: 100% !important;
}

.calculator-box {
width: 100% !important;
max-width: 100% !important; /* remove 95% cap */
margin: 0 !important; /* no auto-centering */
border-radius: 0 !important; /* optional: flush edges */
box-sizing: border-box !important;
}

.calculator-box .inputs label,
.calculator-box .inputs input,
.calculator-box .inputs select,
.calculator-box .inputs button {
font-size: 1rem !important;
}

.calculator-box .results,
.calculator-box .result-item {
font-size: 0.9rem !important;
}

.result-item.highlight {
font-size: 1.1rem !important;
}
.result-item.highlight span:last-child {
font-size: 1.5rem !important;
}

.result-item span.highlight {
  font-size: 1.1rem !important;
  font-weight: 700;
  color: var(--primary);
}
}

.download-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.download-btn {
  background: var(--gradient);
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px; /* spacing between icon and text */
  transition: all 0.2s;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 133, 0.3);
}

#hlMonthYearPicker {
  float: center;
}

.result-item span.highlight {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Outstanding Chart Styling */
:root.theme-light {
  --card-bg: #fff;
  --grid-line: rgba(0,0,0,0.1);
}

:root.theme-dark {
  --card-bg: #1e1e1e;
  --grid-line: rgba(255,255,255,0.2);
}


#outstandingChartContainer,
.chart-container {
  background: var(--card-bg);
  color: var(--text-primary);
}


#outstandingChartContainer {
  width: 100%;
  max-width: 900px;   /* match amort table width */
  margin: 0 auto 16px auto;
  height: 450px;       /* bigger height */
  padding: 12px;
  background: var(--card-bg); 
  border-radius: 8px;
  color: var(--text-primary);
}
#outstandingChart {
  width: 100% !important;
  height: 100% !important;
}

/* --- Compact Overrides for UC & Prepay Tables (stronger specificity) --- */
#homeLoanBox #ucDisbursementTable input {
  font-size: 0.8rem !important;
  padding: 1px 2px !important;
  height: 24px !important;
  line-height: 1.2 !important;
}

#homeLoanBox #hlPrepayTable input,
#homeLoanBox #hlPrepayTable select {
  font-size: 0.8rem !important;
  padding: 1px 1px !important;
  height: 24px !important;
  line-height: 1.2 !important;
}

#homeLoanBox #ucDisbursementTable th,
#homeLoanBox #ucDisbursementTable td,
#homeLoanBox #hlPrepayTable th,
#homeLoanBox #hlPrepayTable td {
  font-size: 0.8rem !important;
  padding: 1px 1px !important;
}

/* --- Final Compact Overrides for Add buttons --- */
#homeLoanBox #ucAddBtnSmall,
#homeLoanBox #ucFillFinalBtn,
#homeLoanBox #hlPrepayAddBtn {
  width: auto !important;
  display: inline-block !important;
  font-size: 0.9rem !important;
  padding: 3px 8px !important;
  height: 24px !important;
  line-height: 1 !important;
  border-radius: 4px !important;
  margin: 4px 2px !important;
}

#homeLoanBox #ucAddBtnSmall,
#homeLoanBox #ucFillFinalBtn,
#homeLoanBox #hlPrepayAddBtn {
  display: block !important;
  margin: 6px auto !important;
}

/* ✅ Unified compact radio styling for UC + Prepayment */
/* ✅ Centered UC + Prepay radio rows */
.uc-radio-row,
.prepay-radio-row {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 2px !important;
  margin-top: 2px !important;
  margin-bottom: 2px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  text-align: center !important;
}

.uc-radio-row input[type="radio"],
.prepay-radio-row input[type="radio"] {
  width: 15px !important;
  height: 15px !important;
  accent-color: var(--primary) !important;
  margin-right: 4px !important;
  cursor: pointer !important;
}

.uc-radio-row label,
.prepay-radio-row label {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  margin-right: 8px !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
}

.uc-radio-row input[type="radio"]:checked + label,
.prepay-radio-row input[type="radio"]:checked + label {
  color: var(--primary) !important;
  font-weight: 600 !important;
}



/* Smaller, lighter UC + Regular phase results */
#resultsBox .result-item.phase-results span,
#resultsBox .result-item.phase-results {
  font-size: 0.82rem !important;
  color: var(--text-secondary, #777) !important;
}

/* --- FINAL FIX: side-info moves below chart + amort table below 1200px --- */
@media (max-width: 1200px) {
  /* Make layout stack naturally */
  #homeLoanLayout {
    display: block !important;
    position: relative;
  }

  /* Calculator full width */
  #homeLoanBox {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto 24px auto !important;
  }

  /* Outstanding Chart */
  #outstandingChartContainer {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto 24px auto !important;
  }

  /* Amortization Table */
  .amortization-box {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto 24px auto !important;
  }

  /* ⬇️ Force Left Info Box BELOW amortization visually */
  .side-info-left {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 24px auto !important;
    display: block !important;

    /* move it AFTER amortization by DOM anchoring trick */
  }


  /* Use flex reorder only for visual hint; actual position handled by JS below */
}

/* --- Results stacking below 1100px --- */
@media (max-width: 1100px) {
  #homeLoanBox .inputs {
    order: 1 !important;
  }
  #homeLoanBox .results {
    order: 2 !important;
    margin-top: 16px !important;
  }
}


/* Center calculator box with outstanding chart + amort table */
@media (min-width: 1200px) {
  .calculator-layout#homeLoanLayout {
    display: grid !important;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1050px);
    justify-content: center !important;
    gap: 32px;
  }

  .side-info-left {
    grid-column: 1;
    max-width: 220px;
    margin: 0;
    position: relative;
    top: 36px;
  }

  #homeLoanBox.calculator-box {
    grid-column: 2;
    margin: 0 auto !important;    /* true center */
    max-width: 950px !important;
    width: 100% !important;
    padding: 10 10px;
  }

  /* Align chart + amortization with calculator column */
  #outstandingChartContainer,
  .amortization-box {
    max-width: 950px !important;
    margin: 24px auto !important; /* same centering as calculator */
  }
}

/* --- INFO SECTION (replaces Tips Section) --- */
.info-section {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 950px;
  margin: 24px auto;
  color: var(--text-primary);
  font-size: 0.9rem;           /* slightly smaller than FAQ */
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Headings */
.info-section h3 {
  color: var(--text-primary);
  font-size: 1.25rem;           /* smaller heading */
  margin-bottom: 10px;
  font-weight: 700;
}

/* Subheadings (summary titles) */
.info-section details summary {
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  transition: color 0.25s ease;
}

.info-section details[open] summary {
  text-decoration: underline;
  color: var(--primary-light);
}

/* Inner content */
.info-section ul {
  margin-top: 6px;
  margin-left: 18px;
  line-height: 1.6;
  color: var(--text-primary);
}

.info-section li {
  margin-bottom: 4px;
}

/* --- LINKS SECTION (for "Other Calculators") --- */
.links-section {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 950px;
  margin: 24px auto;
  color: var(--text-primary);
  font-size: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Heading same style as info-section (default text color) */
.links-section h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-bottom: 10px;
  font-weight: 700;
}

/* List styling */
.links-section ul {
  list-style: none;
  padding-left: 10px;
  margin: 6px 0 0 0;
  line-height: 1.7;
}

.links-section li {
  margin: 4px 0;
}

/* ✅ Themed link styles (underline + hover) */
.links-section a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;     /* always underlined */
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.links-section a:hover {
  color: var(--primary-light);
  text-decoration-color: var(--primary-light);
}

/* Right-align contribution field + dropdown together */
.contribution-wrapper {
  display: flex;
  justify-content: flex-end;  /* ✅ move the group to right edge */
  align-items: center;
  gap: 8px;                   /* spacing between input & dropdown */
  width: 100%;
}

/* Centered contribution wrapper for calculators that need centered layout */
.contribution-wrapper-centered {
  display: flex;
  justify-content: center;  /* ✅ center the group */
  align-items: center;
  gap: 8px;                   /* spacing between input & dropdown */
  width: 100%;
}

.contribution-wrapper input {
  width: 120px;               /* consistent width like others */
}

.contribution-wrapper select {
  width: 110px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 500;
  height: 38px; /* match input height */
  line-height: 36px;
}


/* ---- Optimizing ---- */
.chart-container-large {
width: 100%;
max-width: 950px;
height: 450px;
margin: 24px auto;
background: var(--bg-card);
border-radius: 10px;
border: 1px solid var(--border);
box-shadow: var(--shadow);
padding: 10px;
}

/* ---- NPS specific layout tuning ---- */

@media (min-width: 1025px) {
.calculator-section,
.calculator-layout,
  #npsBox.calculator-box {
    flex: 1 1 auto !important;               /* allow flexible growth */
    flex-basis: auto !important;   
    width: 100% !important;
    max-width: 1100px !important; /* wider cap for desktops */
    margin: 0 auto !important;    /* center it */
  }
.calculator-layout{
justify-content: center !important;
}
}
/* ✅ Consistent vertical gap between input sections */
.inputs .input-group {
  margin-bottom: 15px !important; /* default for desktop/tablet */
}

/* Slightly tighter on mobile screens */
@media (max-width: 500px) {
  .inputs .input-group {
    margin-bottom: 12px !important; /* keep it airy but compact */
  }
}


/* ✅ Compact quick-amount buttons (applies globally) */
.quick-amount-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px !important; /* tighter spacing between buttons */
  margin-top: 4px !important;
  flex-wrap: nowrap;
}

.quick-amount-buttons button {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 3px 6px !important;  /* smaller padding */
  font-size: 0.75rem !important; /* smaller font */
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 42px !important; /* slightly smaller width */
  max-width: 65px !important;
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}

.calculator-box .inputs .quick-amount-buttons button {
font-size: 0.8rem !important;
 margin-top: 3px !important;     /* slightly larger gap below the input */
  margin-bottom: 2px !important;  /* keep compact gap below buttons */
  justify-content: center !important;
}

.quick-amount-buttons button:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ✅ Red "Clear" button special style */
.quick-amount-buttons button[data-inc="clear"] {
  color: #ff4d4d !important;
  border-color: #ff4d4d !important;
  background: transparent;
  min-width: 42px !important;
}
.quick-amount-buttons button[data-inc="clear"]:hover {
  background: #ff4d4d;
  color: #000;
}

/* --- Chart & Theme Colors --- */
:root {
  --clr-green:  #00cc6a;   
  --clr-orange: #ff8a00;   
  --clr-blue:   #1e90ff;   
}

/* Theme-specific chart colors */
html.theme-dark {
  --clr-green:  #04eb7b;   /* Material green */
  --clr-orange: #ff9800;   /* Vibrant orange */
  --clr-blue:   #00b0ff;   /* Electric blue */
}

html.theme-light {
  --clr-green:  #00c853;   /* Rich green */
  --clr-orange: #ff6f00;   /* Deep orange */
  --clr-blue:   #0091ea;   /* Deep blue */
}

/* --- Light Mode --- */
/* --- Light Theme (vibrant gradients) --- */
:root {
  --color1:  linear-gradient(135deg, #00d9ff 0%, #00b8e6 100%);  /* Bright cyan gradient */ 
  --color2:  linear-gradient(135deg, #ff4d4d 0%, #ff2b2b 100%);  /* Vibrant red gradient */
  --color3:  linear-gradient(135deg, #8fe5ff 0%, #5dc9e8 100%);  /* Sky blue gradient */
  --color4:  linear-gradient(135deg, #ffa5b8 0%, #ff7a93 100%);  /* Coral pink gradient */
  --color5:  linear-gradient(135deg, #bda5ff 0%, #9775ff 100%);  /* Lavender violet gradient */
  --color6:  linear-gradient(135deg, #ffe95c 0%, #ffd700 100%);  /* Golden yellow gradient */
  --color7:  linear-gradient(135deg, #7fd8c6 0%, #5cb5a3 100%);  /* Jade teal gradient */
  --color8:  linear-gradient(135deg, #f5a3ff 0%, #e570ff 100%);  /* Magenta lilac gradient */
  --color9:  linear-gradient(135deg, #8fdfaa 0%, #5fc47e 100%);  /* Mint green gradient */
  --color10: linear-gradient(135deg, #e5c785 0%, #d0a860 100%);  /* Sandstone beige gradient */
}

/* --- Dark Theme (deep premium gradients) --- */
html.theme-dark {
  --color1:  #1EA51D88;
  --color2:  #ff121277;
  --color3:  #0D6CE888;
  --color4:  #A51DA577;
  --color5:  #8E24AA88;
  --color6:  #FFCD0599;
  --color7:  #26A69A77;
  --color8:  #E91E6388;
  --color9:  #4CAF5077;
  --color10: #FF980099;
}



/* per color mapping */
.result-item[data-color="color1"]  { background: var(--color1); }
.result-item[data-color="color2"]  { background: var(--color2); }
.result-item[data-color="color3"]  { background: var(--color3); }
.result-item[data-color="color4"]  { background: var(--color4); }
.result-item[data-color="color5"]  { background: var(--color5); }
.result-item[data-color="color6"]  { background: var(--color6); }
.result-item[data-color="color7"]  { background: var(--color7); }
.result-item[data-color="color8"]  { background: var(--color8); }
.result-item[data-color="color9"]  { background: var(--color9); }
.result-item[data-color="color10"] { background: var(--color10); }


/* --- Unified Info Card Layout --- */
.info-cards {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 950px;
  margin: 28px auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.info-cards h3 {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 6px;
  text-align: center;
}

.info-cards .info-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 16px;
}

.info-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.info-card {
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.info-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-icon {
  font-size: 1.2rem;
  line-height: 1;
  background: var(--primary);
  color: #000;
  border-radius: 6px;
  padding: 6px;
}

.info-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.info-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.info-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

.info-text p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: block;
}

/* --- Soft Background Variants by Color --- */
html.theme-light .info-card[data-color="green"]  { background: #b8f5d6; }
html.theme-light .info-card[data-color="orange"] { background: #ffd9b3; }
html.theme-light .info-card[data-color="blue"]   { background: #c2e3ff; }
html.theme-light .info-card[data-color="red"]    { background: #ffbdbd; }
html.theme-light .info-card[data-color="yellow"] { background: #b3e6e6; }
html.theme-light .info-card[data-color="purple"] { background: #e8d4ff; }

html.theme-dark .info-card[data-color="green"]  { background: rgba(0,255,133,0.08); }
html.theme-dark .info-card[data-color="orange"] { background: rgba(255,138,0,0.10); }
html.theme-dark .info-card[data-color="blue"]   { background: rgba(30,144,255,0.10); }
html.theme-dark .info-card[data-color="red"]    { background: rgba(255,43,43,0.12); }
html.theme-dark .info-card[data-color="yellow"] { background: rgba(0,255,255,0.10); }
html.theme-dark .info-card[data-color="purple"] { background: rgba(238,130,238,0.12); }

.info-card[data-color="green"]  .info-icon { background: #00cc6a; }
.info-card[data-color="orange"] .info-icon { background: #ff8a00; }
.info-card[data-color="blue"]   .info-icon { background: #1e90ff; }
.info-card[data-color="red"]    .info-icon { background: #ff2b2b; }
.info-card[data-color="yellow"] .info-icon { background: #00cccc; }

/* 🌟 Header + Hero appear normally */
.navbar,
.hero {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.5s ease-out forwards;
}

.hero {
  animation-delay: 0.1s;
}

/* 🧩 Calculator groups fade in together */
.calculator-groups {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.7s ease-out forwards;
  animation-delay: 0.3s;
}

/* 🪄 Each card slides up softly, one by one */
.cards .card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; /* smoother easing */
}

/* Gradual stagger for each card */
.cards .card:nth-child(1) { animation-delay: 0.3s; }
.cards .card:nth-child(2) { animation-delay: 0.4s; }
.cards .card:nth-child(3) { animation-delay: 0.5s; }
.cards .card:nth-child(4) { animation-delay: 0.6s; }
.cards .card:nth-child(5) { animation-delay: 0.7s; }

/* ✨ Reusable fade-up animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🌟 Core Calculators Section Animation */
.core-calculators {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.7s ease-out forwards;
  animation-delay: 0.6s; /* comes in after main calculator groups */
}

/* 💎 Each core-card fades in one by one */
.core-card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Gradual stagger for better flow */
.core-card:nth-child(1) { animation-delay: 0.6s; }
.core-card:nth-child(2) { animation-delay: 0.7s; }
.core-card:nth-child(3) { animation-delay: 0.8s; }
.core-card:nth-child(4) { animation-delay: 0.9s; }


/* 📱 Compact cards for small screens */
@media (max-width: 480px) {
  .cards.small-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards per row — efficient layout */
    gap: 6px;
    padding: 0;
  }

  .cards .card {
    padding: 8px 6px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transform: none;
  }

  .card-icon {
    width: 50px;
    height: 50px;
  }

.cards{
margin: 8px 4px 10px;
}
}

.core-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.core-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* ✨ Bolder, colored titles */
.core-title {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.2px;
}
.core-card p {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.45;
}

/* Optional: slight color tint for each card */
.core-card:nth-child(1) { border-top: 3px solid #ff8a00; } /* Orange for Home Loan */
.core-card:nth-child(2) { border-top: 3px solid #00b7ff; } /* Blue for SIP */
.core-card:nth-child(3) { border-top: 3px solid #00cc6a; } /* Green for Retirement */
.core-card:nth-child(4) { border-top: 3px solid #b66dff; } /* Purple for SWP */

@media (max-width: 480px) {
.core-title {
font-size: 0.85rem;
  padding: 5px;
    margin-bottom: 4px;
}
.core-card p {
  font-size: 0.75rem;
}
.core-card {
  border-radius: 12px;
  padding: 6px;
}

}
