/* ============================
   SIP CALCULATOR — MODERN UI
============================ */

:root {
  --primary: #2563eb;
  --primary-soft: #e8efff;
  --accent: #16a34a;
  --bg-card: #ffffff;
  --bg-soft: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-soft: #e5e7eb;
  --radius: 14px;
}

/* Page background */
body {
  background: linear-gradient(180deg, #f1f5f9, #ffffff);
  color: var(--text-main);
}

/* Main calculator card */
.tool-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

/* Section titles */
.section-title {
  font-weight: 700;
  font-size: 1.2rem;
}

/* Inputs */
.form-control {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 0.55rem 0.75rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.15);
}

/* Currency buttons */
.currency-btn {
  border: 1px solid var(--border-soft);
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.currency-btn:hover {
  background: var(--primary-soft);
}

.currency-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Result summary */
.result {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border-soft);
}

.result strong {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Retirement summary */
.retirement-summary {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 0.75rem;
}

.rs-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.rs-strong {
  font-weight: 700;
}

/* Tables */
.table {
  border-radius: 12px;
  overflow: hidden;
}

.table thead {
  background: var(--primary-soft);
}

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  border-radius: 12px;
}

#resetSip {
  border: 1px solid var(--border-soft);
  background: #fff;
}


/* Charts */
canvas {
  max-width: 100%;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.05rem;
  }

  .currency-switch {
    justify-content: flex-start;
  }

  .rs-row {
    flex-direction: column;
    gap: 2px;
  }
}



/* ============================
   STICKY RESULT BAR
============================ */

.sticky-result {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-soft);
  padding: 0.6rem 1rem;
  font-weight: 600;
  z-index: 1000;
  display: none;
}





/* ============================
   MICRO ANIMATIONS
============================ */
.result,
.retirement-summary,
.table,
.tool-panel {
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
   TOAST UI
============================ */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* Hide chart until data is available */
#sipInflationChart {
  display: none;
}

@media (max-width: 768px) {
  table th {
    font-size: 12px;
    white-space: nowrap;
  }
  table td {
    font-size: 12px;
  }
}

.currency-scroll {
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
}

.currency-scroll::-webkit-scrollbar {
  height: 4px;
}

/* ===== RESET BUTTON (BASE — DESKTOP) ===== */
.reset-fab {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.reset-fab:hover {
  background: #f1f5f9;
}
/* ===== RESET BUTTON (MOBILE ONLY) ===== */
@media (max-width: 767px) {
  .reset-fab {
    position: fixed;
    bottom: 64px; /* above sticky result bar */
    right: 14px;
    z-index: 1050;

    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
  }

  .reset-fab:hover,
  .reset-fab:active {
    background: #ffedd5;
  }
}

.currency-scroll {
  position: relative;
}

.currency-scroll::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to left, white, transparent);
}

@media (max-width: 767px) {
  #sipInflationChart {
    height: 100px !important;
  }
}

@media (max-width: 768px) {
  .tool-panel > .d-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .currency-switch {
    width: 100%;
  }
}

.currency-scroll {
  position: relative;
}

.currency-scroll::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to left, #ffffff, transparent);
}


