@import "../../components/mtf-combobox/mtf-combobox.css";
@import "../../components/slider-input-negative/slider-input-negative.css";

/* Greyed out until a stock is picked. */
.calc-results.is-disabled {
  filter: contrast(1) grayscale(90%);
}

/*
 * Two equal-height rows (costs, then totals). Each row is a subgrid, so both
 * rows share the parent's three columns.
 */
.mtf-results-grid {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.mtf-results-row {
  display: grid;
  grid-template-columns: subgrid;

  @media (min-width: 768px) {
    grid-column: span 3 / span 3;
  }
}

.mtf-results-row--costs {
  border-bottom: 1px solid #e7e7e7;
  padding-bottom: 1rem;
}

.mtf-results-row--totals {
  padding-top: 0.5rem;
}

/* Invisible dot that lines the cost row up with the legend row; desktop only. */
.legend-dot-placeholder {
  display: none;

  @media (min-width: 768px) {
    display: block;
  }
}

.calc-result-label.has-info {
  display: flex;
  gap: 0.25rem;
}

.interest-rate-note {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 400;
}

.calc-result-body.is-top-aligned {
  @media (min-width: 768px) {
    justify-content: flex-start;
  }
}

.result-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;

  &.is-reversed-mobile {
    @media (max-width: 767.98px) {
      flex-direction: row-reverse;
    }
  }
}

.pl-change {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 400;

  &.is-gain {
    color: #22c55e;
  }

  &.is-loss {
    color: var(--art-red);
  }
}

.pl-arrow {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

/* Info popover panels (teleported into <body>). */
.interest-breakdown,
.charges-breakdown {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  padding: 1rem;
  background: #f5f5f5;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.interest-breakdown {
  width: 18rem;
  gap: 0.5rem;
}

.charges-breakdown {
  width: 15rem;
  gap: 0.75rem;
}

.breakdown-title {
  font-weight: 500;
  color: var(--z-black);
}

.breakdown-label {
  color: var(--z-light-gray);
}

.breakdown-value {
  font-weight: 500;
}

.breakdown-total {
  border-top: 1px solid rgb(from var(--z-light-gray) r g b / 0.4);
  padding-top: 0.5rem;
}

.charges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;

  &:first-child {
    border-bottom: 1px solid rgb(from var(--z-light-gray) r g b / 0.4);
    padding-bottom: 0.75rem;
  }
}

/* Description */

.examples-heading {
  padding-block: 1.25rem 0.5rem;
  font-weight: 600;
  color: var(--z-black);
}

.example {
  padding: 0 0 1.25rem 0.75rem;
}

.example-title {
  margin-inline-start: -0.75rem;
}

.example-number {
  color: var(--z-black);
}
