/* ======================================================
   IPQS SAVINGS ESTIMATOR STYLES (Savings.css)
   Requires Dashboard.css to be linked first for base vars
====================================================== */

.calc-page-section {
  padding: 140px 60px 100px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: radial-gradient(ellipse at bottom right, var(--dark2), var(--dark));
}

.calc-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* --- LEFT SIDE: SLIDESHOW & INSIGHTS --- */
.calc-left {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.calc-image-wrapper {
  width: 100%;
  height: 350px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
}

.calc-slideshow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.calc-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: calcFade 15s infinite;
}

.calc-slide:nth-child(1) { animation-delay: 0s; }
.calc-slide:nth-child(2) { animation-delay: 5s; }
.calc-slide:nth-child(3) { animation-delay: 10s; }

@keyframes calcFade {
  0%   { opacity: 0; transform: scale(1.05); }
  10%  { opacity: 1; transform: scale(1); }
  33%  { opacity: 1; transform: scale(1); }
  43%  { opacity: 0; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.05); }
}

.calc-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,10,20,0.9), rgba(5,10,20,0.3));
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.calc-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--dark3);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: transform 0.3s, border-color 0.3s;
}

.insight-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.insight-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}

/* --- RIGHT SIDE: THE CALCULATOR --- */
.calc-right {
  background: var(--dark2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 40px rgba(0,229,255,0.05);
}

.calc-header {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.calc-segments {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.02);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.c-seg-btn {
  flex: 1;
  min-width: 90px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: none;
  transition: all 0.3s;
}

.c-seg-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.c-seg-btn.active { background: var(--primary); color: var(--dark); font-weight: 700; box-shadow: 0 4px 15px rgba(0,229,255,0.3); }

.calc-input-area {
  margin-bottom: 32px;
  background: var(--dark3);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.input-header label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.calc-currency {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  background: rgba(0,229,255,0.1);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,229,255,0.3);
}

/* Custom Slider */
.custom-calc-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(0,229,255,0.1);
  border-radius: 4px;
  outline: none;
  margin: 10px 0;
}
.custom-calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: none;
  box-shadow: 0 0 15px rgba(0,229,255,0.6);
  transition: transform 0.1s;
}
.custom-calc-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 8px; }

/* Manual Input Box */
.manual-input-box {
  display: flex;
  align-items: center;
  background: var(--dark2);
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 12px;
  padding: 12px 16px;
  transition: box-shadow 0.3s;
}
.manual-input-box:focus-within { box-shadow: 0 0 15px rgba(0,229,255,0.2); }
.manual-input-box span { font-size: 20px; color: var(--primary); margin-right: 12px; font-weight: 700; }
.manual-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 600;
  outline: none;
  cursor: none;
}
.manual-input-box input::placeholder { color: rgba(123,143,166,0.3); }

/* Results Grid */
.calc-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.3s;
}
.result-box:hover { background: rgba(255,255,255,0.04); transform: translateY(-3px); }

.res-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
.res-val { font-family: 'Bebas Neue', sans-serif; font-size: 40px; line-height: 1; color: var(--text); }
.res-val small { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; opacity: 0.7; letter-spacing: 0; }

.primary-box .res-val { color: var(--primary); }
.green-box .res-val { color: var(--green); }
.eco-box .res-val { color: #00B8D4; }

.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 1000px) {
  .calc-container { grid-template-columns: 1fr; gap: 40px; }
  .calc-page-section { padding: 120px 24px 60px; }
  .calc-right { padding: 24px; }
  .calc-image-wrapper { height: 250px; }
  .calc-image-overlay h2 { font-size: 36px !important; }
}

@media (max-width: 600px) {
  .calc-results-grid { grid-template-columns: 1fr; }
  .c-seg-btn { width: 48%; flex: auto; }
  .insight-card { flex-direction: column; text-align: center; align-items: center; }
}