/* ============================================================
   CALCULATOR PAGE — Triraj Research & Asset Management
   Matches existing green theme (#007f00, gold accents)
   ============================================================ */

/* ── Page wrapper ── */
.calc-page {
  min-height: 100vh;
  padding: 40px 0 60px;
}

/* ── Section heading ── */
.calc-page .section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.calc-page .section-subtitle {
  color: #d4edda;
  font-size: 1rem;
  margin-top: -6px;
}

/* ── Tab pills ── */
.calc-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.calc-tab-btn {
  padding: 10px 36px;
  border-radius: 50px;
  border: 2px solid #ffd700;
  background: transparent;
  color: #ffd700;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .25s ease;
}
.calc-tab-btn.active,
.calc-tab-btn:hover {
  background: #ffd700;
  color: #003300;
}

/* ── Card ── */
.calc-card {
  background: rgba(255,255,255,.97);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  padding: 36px 32px;
  animation: fadeSlideUp .35s ease both;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section hidden/visible ── */
.calc-section { display: none; }
.calc-section.active { display: block; }

/* ── Labels & inputs ── */
.calc-label {
  font-weight: 600;
  color: #1a3c1a;
  font-size: .92rem;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.calc-label .lbl-value {
  font-size: 1rem;
  font-weight: 700;
  color: #007f00;
  background: #e8f5e9;
  padding: 2px 10px;
  border-radius: 20px;
}
.calc-label .lbl-tooltip {
  cursor: help;
  color: #888;
  font-size: .8rem;
  margin-left: 4px;
}

/* Range slider */
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, #007f00 0%, #007f00 var(--pct, 50%), #d0e8d0 var(--pct, 50%), #d0e8d0 100%);
  outline: none;
  cursor: pointer;
  margin: 6px 0 2px;
  transition: background .1s;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007f00;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,128,0,.4);
  cursor: pointer;
  transition: transform .15s;
}
.calc-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.calc-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #007f00;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,128,0,.4);
  cursor: pointer;
}

/* Number input */
.calc-input {
  width: 100%;
  border: 1.5px solid #c8e6c9;
  border-radius: 8px;
  padding: 9px 14px;
  height:48px;
  font-size: 1rem;
  font-weight: 600;
  color: #1a3c1a;
  background: #f9fdf9;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  margin-top: 4px;
}
.calc-input:focus {
  border-color: #007f00;
  box-shadow: 0 0 0 3px rgba(0,127,0,.12);
  background: #fff;
}
.calc-input.error { border-color: #e53935; }

.input-group-text {
  background: #e8f5e9;
  border: 1.5px solid #c8e6c9;
  color: #007f00;
  font-weight: 700;
}

/* ── Result summary cards ── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}
@media (max-width: 576px) {
  .result-grid { grid-template-columns: 1fr; }
}
.result-box {
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: transform .2s;
}
.result-box:hover { transform: translateY(-3px); }
.result-box .rb-label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.result-box .rb-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.rb-invested  { background: #e8f5e9; }
.rb-invested  .rb-label { color: #2e7d32; }
.rb-invested  .rb-value { color: #1b5e20; }

.rb-returns   { background: #fff8e1; }
.rb-returns   .rb-label { color: #f57f17; }
.rb-returns   .rb-value { color: #e65100; }

.rb-total     { background: #e3f2fd; }
.rb-total     .rb-label { color: #1565c0; }
.rb-total     .rb-value { color: #0d47a1; }

/* ── Chart container ── */
.chart-wrap {
  position: relative;
  max-width: 280px;
  margin: 0 auto;
}
.chart-center-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.chart-center-label .ccl-title {
  font-size: .72rem;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
}
.chart-center-label .ccl-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #007f00;
  white-space: nowrap;
}

/* ── Divider ── */
.calc-divider {
  border: none;
  border-top: 1.5px solid #e8f5e9;
  margin: 24px 0;
}

/* ── Download button ── */
.btn-download {
  background: linear-gradient(135deg, #007f00, #00a000);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: all .25s;
  text-transform: uppercase;
  letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(0,127,0,.3);
}
.btn-download:hover {
  background: linear-gradient(135deg, #005c00, #007f00);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,127,0,.4);
  color: #fff;
}

/* ── Tenure toggle ── */
.tenure-toggle {
  display: flex;
  border: 1.5px solid #c8e6c9;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.tenure-toggle button {
  flex: 1;
  padding: 8px;
  border: none;
  background: #f9fdf9;
  color: #555;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: all .2s;
}
.tenure-toggle button.active {
  background: #007f00;
  color: #fff;
}

/* ── Validation message ── */
.val-msg {
  font-size: .78rem;
  color: #e53935;
  margin-top: 3px;
  min-height: 16px;
}

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
  .calc-card { padding: 22px 14px; }
  .calc-page .section-title { font-size: 1.5rem; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .rb-total { grid-column: span 2; }
}
@media (max-width: 400px) {
  .result-grid { grid-template-columns: 1fr; }
  .rb-total { grid-column: span 1; }
}
