/* Investment Comparison Calculator — ic.css */

.page-title {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #9200C5 0%, #A020D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: #555;
  margin-bottom: 25px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

/* ── CARD ─────────────────────────────────────────────────── */
.calc-card {
  background: #fff;
  border: 1px solid #E8E4EC;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.calc-card:hover {
  border-color: #40E0D0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ── INPUT GRID ───────────────────────────────────────────── */
.ic-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.input-group { margin-bottom: 4px; }

.input-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #333;
}

.label-hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #888;
  margin-top: 2px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* text input for comma-formatted amounts */
.input-row input[type="text"] {
  width: 110px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #E8E4EC;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  text-align: right;
  outline: none;
  color: #333;
  transition: all 0.2s ease;
}
.input-row input[type="text"]:focus,
.input-row input[type="text"]:hover {
  border-color: #40E0D0;
  box-shadow: 0 0 0 3px rgba(64,224,208,0.15);
}

/* number inputs */
.input-row input[type="number"] {
  width: 72px;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid #E8E4EC;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  text-align: right;
  outline: none;
  color: #333;
  transition: all 0.2s ease;
}
.input-row input[type="number"]:focus,
.input-row input[type="number"]:hover {
  border-color: #40E0D0;
  box-shadow: 0 0 0 3px rgba(64,224,208,0.15);
}

/* ── SLIDERS ──────────────────────────────────────────────── */
.input-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: #E8E4EC;
  outline: none;
  cursor: pointer;
}
.input-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #40E0D0 0%,
    #40E0D0 calc((var(--val) - var(--min)) / (var(--max) - var(--min)) * 100%),
    #E8E4EC calc((var(--val) - var(--min)) / (var(--max) - var(--min)) * 100%),
    #E8E4EC 100%
  );
}
.input-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  background: linear-gradient(135deg, #40E0D0 0%, #48D4C4 100%);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 2px 6px rgba(64,224,208,0.3);
  transition: all 0.2s ease;
}
.input-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(64,224,208,0.5);
}
.input-row input[type="range"]::-moz-range-track { height:6px; border-radius:4px; background:#E8E4EC; }
.input-row input[type="range"]::-moz-range-progress { height:6px; border-radius:4px; background:#40E0D0; }
.input-row input[type="range"]::-moz-range-thumb {
  width:20px; height:20px;
  background: linear-gradient(135deg,#40E0D0 0%,#48D4C4 100%);
  border-radius:50%; border:none; cursor:pointer;
  box-shadow:0 2px 6px rgba(64,224,208,0.3); transition:all 0.2s ease;
}

/* ── FREQUENCY TOGGLE ─────────────────────────────────────── */
.freq-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.freq-btn {
  border: 1.5px solid #E8E4EC;
  background: #fff;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
  font-family: inherit;
}
.freq-btn:hover { border-color: #40E0D0; color: #40E0D0; }
.freq-btn.active {
  background: linear-gradient(135deg, #9200C5 0%, #A020D0 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(146,0,197,0.25);
}

/* ── SUMMARY CARDS ────────────────────────────────────────── */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.summary-card {
  background: #f9f9f9;
  border: 1px solid #E8E4EC;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
}
.summary-card:hover { border-color: #40E0D0; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.07); }
.summary-card-label { font-size: 12px; color: #666; font-weight: 500; margin-bottom: 6px; }
.summary-card-val {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #9200C5 0%, #A020D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.summary-card.highlight .summary-card-val {
  background: linear-gradient(135deg, #40E0D0 0%, #48D4C4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.summary-card-sub { font-size: 11px; color: #888; margin-top: 3px; }

/* ── RESULTS TABLE ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.ic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 580px;
}
.ic-table th {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-align: left;
  padding: 0 12px 10px;
  border-bottom: 1.5px solid #E8E4EC;
  white-space: nowrap;
}
.ic-table th:not(:first-child) { text-align: right; }
.th-rate { position: relative; }
.th-hint {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #aaa;
  margin-top: 1px;
}
.ic-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0eaf8;
  color: #333;
  vertical-align: middle;
}
.ic-table td:not(:first-child) { text-align: right; }
.ic-table tr:last-child td { border-bottom: none; }
.ic-table tr.winner td { background: rgba(146,0,197,0.04); }
.ic-table tr:hover td { background: rgba(64,224,208,0.04); }

/* option name cell */
.opt-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.opt-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.opt-label { font-weight: 600; color: #222; }
.winner-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  background: #9200C5;
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 4px;
}

/* editable rate cell */
.rate-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.rate-edit {
  width: 42px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1.5px solid #E8E4EC;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  color: #9200C5;
  background: rgba(146,0,197,0.05);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  -moz-appearance: textfield;
}
.rate-edit::-webkit-inner-spin-button,
.rate-edit::-webkit-outer-spin-button { -webkit-appearance: none; }
.rate-edit:focus, .rate-edit:hover {
  border-color: #9200C5;
  background: rgba(146,0,197,0.08);
  box-shadow: 0 0 0 2px rgba(146,0,197,0.12);
}
.rate-pct { font-size: 13px; color: #9200C5; font-weight: 600; }

.ret-pos {
  color: #1D9E75;
  font-weight: 600;
}

/* ── DISCLAIMER ───────────────────────────────────────────── */
.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  background: #fdf9ff;
  border-left: 3px solid #9200C5;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #555;
  line-height: 1.7;
}
.disclaimer svg { flex-shrink: 0; margin-top: 1px; color: #9200C5; }
.disclaimer strong { color: #333; }

/* ── CHARTS ───────────────────────────────────────────────── */
.chart-header { margin-bottom: 16px; }
.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}
.chart-wrap { position: relative; width: 100%; }

.line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #555;
}
.line-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-line {
  width: 14px; height: 2px;
  border-radius: 1px;
  display: inline-block;
}

/* ── SEO SECTIONS ─────────────────────────────────────────── */
section { margin-top: 40px; line-height: 1.7; }
section h2 {
  font-size: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #9200C5 0%, #A020D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
section p { color: #444; margin-bottom: 14px; }
section ul { margin-left: 20px; color: #444; }
section ul li { margin-bottom: 10px; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-section {
  margin-top: 40px;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #E8E4EC;
}
.faq-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, #9200C5 0%, #A020D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── RELATED CALCULATORS ──────────────────────────────────── */
.related-section { margin-top: 50px; margin-bottom: 20px; }
.related-section .section-header { text-align: center; margin-bottom: 28px; }
.related-section .section-title {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #9200C5 0%, #A020D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  display: block;
}
.related-section .section-desc { font-size: 15px; color: #666; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card {
  background: #fff;
  border: 2px solid #E8E4EC;
  border-radius: 12px;
  padding: 28px 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), border-color 0.3s ease, box-shadow 0.3s ease;
  justify-content: center;
}
.related-card:hover {
  transform: translateY(-6px);
  border-color: #40E0D0;
  box-shadow: 0 12px 32px rgba(64,224,208,0.2);
}
.related-section .related-icon { width: 56px; height: 56px; border-radius: 12px; }
.related-section .related-icon svg { width: 28px; height: 28px; }
.related-text h3 { font-size: 15px; font-weight: 700; color: #222; margin: 0 0 4px; line-height: 1.3; }
.related-text p { font-size: 12px; color: #777; margin: 0; line-height: 1.4; }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-title { font-size: 26px; }
  .ic-input-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .calc-card { padding: 18px; }
  .faq-section { padding: 20px; }
  section { margin-top: 30px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .freq-btn { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 480px) {
  .summary-cards { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}