/* Colors */

:root {
  --green: #029447;
}
.tabulator .tabulator-tableholder::-webkit-scrollbar {
  width: 8px;
}
.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
  background-color: transparent;
}
.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
  background-color: #b6b6b6;
  border-radius: 4px;
}
.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
  background-color: #b6b6b6;
}
.tabulator .tabulator-tableholder {
  scrollbar-width: thin;
  scrollbar-color: #b6b6b6 transparent;
}
.green {
  color: var(--green);
}

/* Body */

html {
  font-size: 16px;
}
body {
  display: flex;
  align-items: flex-start;
}

#calculator {
  display: flex;
}
/* Sidebar */

#calculator aside {
  width: 25vw;
  background-color: #f7f7f7;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 3rem;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-left: 20px solid var(--green);
  display: flex;
  flex-direction: column;
}
#calculator aside svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
#calculator aside h1 {
  text-align: center;
  font-weight: 800;
  font-size: 1.25rem;
  margin: 2rem 0;
}
#calculator form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: auto 0 0;
}
#calculator form .label-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
}
#calculator form .label-container label {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0;
}
#calculator form .label-container label small {
  display: block;
  line-height: 1;
  margin: 0.15rem 0 0;
  font-size: 12px;
  font-weight: 500;
}
#calculator form input {
  line-height: 1.15;
}
#calculator form input[type="text"] {
  background-color: white;
  padding: 0.5rem;
  border-radius: 3px;
  border: 1px solid #d2d2d2;
  font-size: 0.85rem;
  width: 100px;
  outline: none !important;
  text-align: center;
}
#calculator form [type="range"] {
  width: 100%;
}
#calculator input[type="range"] {
  --track-color: rgb(177 180 178 / 25%);
  -webkit-appearance: none;
  width: 100%;
  background-color: transparent;
}
#calculator input[type="range"]:focus {
  outline: none;
}
#calculator input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  cursor: pointer;
  animate: 0.2s;
  box-shadow: 0px 0px 0px #029447;
  background: var(--track-color);
  border-radius: 50px;
  border: 0px solid #029447;
}
#calculator input[type="range"]::-webkit-slider-thumb {
  box-shadow: 0px 0px 0px #000000;
  border: 0px solid #029447;
  height: 25px;
  width: 25px;
  border-radius: 25px;
  background: #029447;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -8px;
}
#calculator input[type="range"]:focus::-webkit-slider-runnable-track {
  background: var(--track-color);
}
#calculator select {
  border-radius: 3px;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-position: calc(100% - 0.5rem) 50%;
  background-repeat: no-repeat;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDZFNDEwNjlGNzFEMTFFMkJEQ0VDRTM1N0RCMzMyMkIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDZFNDEwNkFGNzFEMTFFMkJEQ0VDRTM1N0RCMzMyMkIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0NkU0MTA2N0Y3MUQxMUUyQkRDRUNFMzU3REIzMzIyQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0NkU0MTA2OEY3MUQxMUUyQkRDRUNFMzU3REIzMzIyQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PuGsgwQAAAA5SURBVHjaYvz//z8DOYCJgUxAf42MQIzTk0D/M+KzkRGPoQSdykiKJrBGpOhgJFYTWNEIiEeAAAMAzNENEOH+do8AAAAASUVORK5CYII=);
  padding: 0.75rem;
  padding-right: 1.5em;
  line-height: 1.15;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  outline: none !important;
  font-size: 0.85rem;
  border-color: #d2d2d2;
  color: #000;
}

/* Results */

#calculator main {
  width: 75vw;
  max-width: 100vw;
}
#calculator hr {
  max-width: 75%;
  border-color: rgb(247 247 247 / 22%);
}
#calculator section {
  padding: 0 4rem;
  margin: 3rem 0;
}
#calculator section h1 {
  font-weight: 800;
  font-size: 2.25rem;
  margin: 0;
  line-height: 1;
}
#calculator section h2 {
  margin: 0 0 0.5rem;
}
#calculator section > h4 {
  font-size: 0.85rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.35;
  max-width: 75%;
  margin: 0 0 2rem;
}
#summary {
  font-size: 1.15rem;
  line-height: 1.4;
}

/* Payment Breakdown */

#payments {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}
.payment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: rgb(2 148 71 / 14%);
  line-height: 1;
  border-left: 5px solid var(--green);
  width: 25%;
}
.payment:nth-child(4) {
  background-color: rgb(2 148 71 / 2.5%);
}
.payment:nth-child(3) {
  background-color: rgb(2 148 71 / 7.5%);
}
.payment:nth-child(2) {
  background-color: rgb(2 148 71 / 12.5%);
}
.payment:nth-child(1) {
  background-color: rgb(2 148 71 / 17.5%);
}
.payment span.year {
  font-size: 1.35rem;
  font-weight: 600;
  display: block;
  margin: 0 0 0.25rem;
}
.payment span.payment-count {
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1;
}
.payment span.amount {
  padding: 2rem 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--green);
}
.payment span.amount small {
  font-size: 1rem;
  font-weight: 500;
  color: #000000;
}
.payment span.table {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: #000;
  margin-bottom: 0;
}
.payment span.table {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: #000;
  line-height: 1.5;
  font-size: 0.85rem;
}

/* Chart */

#chart-container {
  display: block;
  box-sizing: border-box;
  height: 400px;
  width: 800px;
}

/* Table */

#table-container * {
  color: #000;
}
.tabulator {
  border: 1px solid #d6d6d6 !important;
  background-color: transparent !important;
}
.tabulator .tabulator-header {
  border: none !important;
}
.tabulator-cell,
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 1rem !important;
}
.tabulator .tabulator-header .tabulator-col {
  border-right: 1px solid transparent !important;
  background: #f7f7f7 !important;
}
.tabulator-row {
  border-bottom: 0.5px solid #d6d6d6 !important;
}
.tabulator-row:hover {
  background: #f7f7f7 !important;
}
.tabulator-row.tabulator-row-even {
  background-color: transparent !important;
}
.tabulator-row .tabulator-cell {
  border: none !important;
}
.tabulator-cell[tabulator-field="paymentDate"] {
  font-size: 110%;
  font-weight: 700 !important;
}

/* Mobile */

@media screen and (max-width: 768px) {
  #calculator {
    display: block;
  }
  #calculator html {
    overflow-x: hidden;
  }
  body {
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden;
  }
  #calculator hr {
    max-width: 90%;
  }
  #calculator p {
    margin: 0;
  }
  #calculator aside svg {
    max-width: 250px;
    margin: 0 auto;
  }
  #calculator aside {
    width: 100%;
    height: unset;
    border-left: 0;
    border-top: 8px solid var(--green);
    position: relative;
    top: unset;
    padding: 2rem 20px;
  }
  #calculator aside .top {
    display: none;
    margin-bottom: 3rem;
  }
  #calculator main {
    width: 100%;
  }
  #calculator section {
    width: 100%;
    padding: 0 20px;
    margin: 2rem 0;
  }
  #calculator section h1 {
    font-size: 1.75rem;
  }
  #calculator section h2 {
    font-size: 1.5rem;
    font-weight: bold;
  }
  #calculator section > h4 {
    margin-top: 1.5rem;
    font-size: 1rem;
    max-width: unset;
  }
  #chart-container {
    height: 500px;
    width: 100% !important;
  }
  .chart-wrapper {
    height: 400px;
  }
  #summary {
    margin-top: 2rem;
    font-size: 1.15rem;
  }
  #payments {
    flex-direction: column;
  }
  .payment {
    width: 100%;
    align-items: flex-start;
    padding: 1.5rem;
  }
  .payment span.amount {
    padding: 1.5rem 0;
    font-size: 2rem;
  }
  .payment .table + .table {
    margin-top: 0.5rem;
  }
  #calculator form input[type="text"].wide {
    width: 115px;
  }
  #calculator form input[type="text"] {
    width: 95px;
  }
  #calculator form .label-container label {
    font-size: 1rem;
  }
  .radio-selector {
    display: flex;
    flex-wrap: wrap;
  }
  .selector-button {
    margin: 0 !important;
    width: 50%;
    text-align: center;
  }
  .selector-button:nth-of-type(even) {
    border-left: 0;
  }
}

/* Third Party Switch */

.switch-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 17px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slide {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.switch-slide:before {
  position: absolute;
  content: "";
  height: 13px;
  width: 13px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

#calculator input:checked + .switch-slide {
  background-color: var(--green);
}

#calculator input:focus + .switch-slide {
  box-shadow: 0 0 1px var(--green);
}

#calculator input:checked + .switch-slide:before {
  -webkit-transform: translateX(13px);
  -ms-transform: translateX(13px);
  transform: translateX(13px);
}

.switch-slide.round {
  border-radius: 34px;
}

.switch-slide.round:before {
  border-radius: 50%;
}

.selector-button {
  padding: 10px 20px;
  border: 1px solid #ccc;
  border-bottom: 0;
  background-color: #f8f8f8;
  cursor: pointer;
  display: inline-block;
  margin-right: 5px;
  margin-bottom: 0;
}

#calculator input[type="radio"]:checked + label {
  background-color: #009446;
  color: white;
  border-color: #009446;
}
