:root {
  --red: #d42b2b;
  --red-light: #f04040;
  --red-pale: #fff0f0;
  --red-mid: #fddada;
  --dark: #111;
  --gray: #555;
  --border: #e8d0d0;
  --white: #fff;
}

.calculator {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 15px 0 rgba(0, 0, 0, 0.1);
  color: #000;
  font-weight: 500;
  margin-bottom: 20px;
}

.calculator-title {
  font-size: 20px;
  text-transform: capitalize;
  margin-bottom: 8px;
}

.left-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  flex-basis: 50%;

  .reg-btn {
    margin-bottom: 0;
    cursor: pointer;
  }
}

.amount-display {
  font-size: 24px;
  padding: 12px;
  border-radius: 2px;
  border: 1px solid #fee4df;
  background: #fffaf9;
  box-shadow: 0 8px 15px 0 rgba(208, 32, 1, 0.1);
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  color: #38414e;
  text-align: justify;
  font-size: 16px;
  text-transform: capitalize;
  margin-top: 8px;
}

input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 15px;
  outline: none;
  cursor: pointer;

  &::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 6px solid #d02001;
    cursor: pointer;
    transition: transform 0.15s;

    &:hover {
      transform: scale(1.15);
    }
  }

  &::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--red);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--red);
    cursor: pointer;
  }
}

#amountSlider {
  border-radius: 15px;
  background: linear-gradient(
    270deg,
    rgba(249, 250, 250, 0) 0%,
    #ffdad3 19%,
    #d02001 100%
  );
}
#daysSlider {
  border-radius: 15px;
  background: linear-gradient(
    270deg,
    rgba(249, 250, 250, 0) 0%,
    #ffdad3 19%,
    #d02001 100%
  );
}

.select-wrap {
  position: relative;

  select {
    width: 100%;
    padding: 12px;
    font-size: 20px;
    border-radius: 2px;
    border: 1px solid #fee4df;
    background: #fffaf9 url('/img/arrow.svg') right 10px center / 20px no-repeat;
    box-shadow: 0 8px 15px 0 rgba(208, 32, 1, 0.1);
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;

    &:focus {
      border-color: var(--red);
    }
  }
}

.right-panel {
  border-radius: 4px;
  background: #d02001;
  box-shadow: 0 0 7px 0 rgba(255, 255, 255, 0.15) inset;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  padding: 12px;
  flex-basis: 50%;
}
.revenue-area {
  background-color: #fff;
  padding: 10px 10px 0 10px;
  border-radius: 4px;
}
.revenue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.revenue-label {
  font-size: 16px;
  line-height: 1.3;
}
.badge {
  border-radius: 8px;
  border: 0.132px solid #d3d3d3;
  background: #d02001;
  box-shadow: 0 0 7px 0 rgba(255, 255, 255, 0.15) inset;
  color: #fff;
  padding: 6px;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  transition: opacity 0.3s;
}
.revenue-amount {
  font-size: 31px;
  margin-bottom: 8px;
  transition: opacity 0.3s;
}
.days-badge {
  display: inline-block;
  width: fit-content;
  border-radius: 2px;
  background: #ce2002;
  box-shadow: 0 1px 4px 0 rgba(255, 255, 255, 0.25) inset;
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

/* CHART */
.chart-area {
  position: relative;
  height: 237px;
  border-bottom: 1px solid #d02001;
}
canvas#chart {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-x-labels {
  display: flex;
  justify-content: space-between;
  padding-block: 9px 10px;
  color: #3a3a3a;
  font-size: 11px;
  font-weight: 400;
}

/* TABS */
.tab-bar {
  display: flex;
  justify-content: space-between;
  border-radius: 4px;
  border: 1px solid #feeeeb;
  padding: 5px;
  background: #fff;
  box-shadow:
    0 5.419px 10.161px 0 rgba(0, 50, 172, 0.1),
    0 0 8px 0 rgba(254, 238, 235, 0.1) inset;
  overflow: hidden;
}

.tab {
  width: fit-content;
  padding: 6px 13px;
  font-size: 18px;
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  border: none;
  background: none;

  &.active {
    color: #fff;
    background: #cf2203;
    box-shadow: 0 2px 9px 0 rgba(255, 255, 255, 0.15) inset;
  }

  &:not(.active):hover {
    background: var(--red-pale);
    color: var(--red);
  }
}

.counting {
  animation: pulse 0.3s ease;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (width < 768px) {
  .calculator {
    flex-direction: column-reverse;
  }
  .right-panel {
    padding: 10px;
    border-radius: 14px;
  }
  .revenue-area {
    border-radius: 10px;
  }
  .revenue-label {
    font-size: 14px;
    line-height: 1;
  }
  .badge {
    font-size: 12px;
  }
  .revenue-amount {
    font-size: 22px;
  }
  .chart-x-labels {
    font-size: 8px;
    padding-block: 4px;
  }
  .tab {
    font-size: 15px;
    padding: 5px 9px;
  }
  .left-panel {
    gap: 14px;
  }
  .calculator-title {
    font-size: 16px;
    margin-bottom: 6px;
  }
  .amount-display {
    padding: 8px;
    font-size: 16px;
  }
  input[type='range'] {
    height: 8px;

    & &::-webkit-slider-thumb {
      width: 16px;
      height: 16px;
    }
  }
  .slider-labels {
    margin-top: 6px;
    font-size: 14px;
  }

  .select-wrap {
    select {
      padding: 8px;
      font-size: 16px;
    }
  }
}
