/* HOME STYLINGS */
#home-purple {
  position: absolute;
  left: 0;
  top: -400px;
}
#home-green {
  position: absolute;
  right: -3px;
  top: 60px;
}

.sidelinks {
  &:hover {
    color: $blue-purple-400;
  }
  &.active {
    color: $blue-purple-400;
    font-weight: bold;
  }
}

.page-home {
  #home-hero-graphic {
    content: url("../img/home-hero.svg");
    margin-left: auto;
    width: 856px;
    margin-right: auto;
    margin-bottom: 24px;
    max-width: 100%;
  }

  #benefits-list {
    @each $benefit in "public", "streamlined", "performance", "low-cost", "community", "reliability" {
      ##{$benefit} {
        content: url("../img/icons/#{$benefit}.svg");
      }
    }
  }

  #advanced-features {
    $feature-cards: ["pink-purple", "neutral-blue", "light-green", "orange", "purple-blue-2"];
    @for $i from 1 through 5 {
      .card:nth-child(#{$i}) .card-footer {
        background-image: url("../img/cards/3col-#{nth($feature-cards, $i)}.svg");
      }
    }
  }

  #get-started {
    $gs-cards: ["orange-yellow", "magenta-orange", "purple-blue-green", "light-blue", "green-blue"];
    @for $i from 1 through 5 {
      .card:nth-child(#{$i}) .card-footer {
        background-image: url("../img/cards/3col-#{nth($gs-cards, $i)}.svg");
      }
    }
  }
}


.cta {
  position: absolute;
  &-top-left {
    top: 0;
    left: 0;
  }
  &-bottom-right {
    bottom: 0;
    right: 0;
  }
}

// Page backgrounds
.landing-bg {
  opacity: 0.6;
  @include media-breakpoint-up(md) {
    opacity: 1.0;
  }
}

.landing-builtin-bg {
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    // background-image set on the page-* classes
    background-repeat: no-repeat;
    background-position-x: left;
    background-position-y: top;
    opacity: 0.6;
    @include media-breakpoint-up(md) {
      opacity: 1.0;
    }
  }
}

// XRP Overview Page
#xrp-overview-blue {
  position: absolute;
  top: 0;
  left: 0;
}
#xrp-mark-overview {
  @include media-breakpoint-down(sm) {
    height: 40px;
    margin-top: 16px;
  }
}

#wallets {
  @each $wallet in "ledger", "secalot", "trezor", "xumm", "trust", "gatehub" {
    #wallet-#{$wallet} {
      content: url("../img/wallets/#{$wallet}.svg");
    }
  }
}

#top-exchanges {
  // Vector logos
  @each $exchange in "bitstamp", "kraken", "cex-io", "liquid", "lmax", "bitfinex", "etoro" {
    #exch-#{$exchange} {
      content: url("../img/exchanges/#{$exchange}.svg");
    }
  }

  // Raster logos
  @each $exchange in "bittrex", "currency-com", "ftx" {
    #exch-#{$exchange} {
      content: url("../img/exchanges/#{$exchange}.png");
    }
  }
}

// XRPL Overview Page
#xrpl-overview-purple {
  position: absolute;
  top: 40px;
  left: 0;
  @include media-breakpoint-down(sm) {
    top: 0;
    left: -20vw;
  }
}
#xrpl-overview-orange {
  position: absolute;
  top: 80px;
  right: -4px;
}

#use-cases-orange {
  position: absolute;
  top: -480px;
  right: -4px;
}

#use-case-card-grid {
  @include media-breakpoint-up(lg) {
    margin-top: -40px; // offset the 40px margin of the cols
  }
}

#validator-graphic {
  content: url(../img/validators.svg);
}

.page-uses {
  &::before {
    background-image: url(../img/backgrounds/use-cases-blue.svg);
  }
  @each $usecase in "micropayments", "wallets", "exchanges", "stablecoins", "nft", "defi", "cbdc" {
    ##{$usecase} {
      content: url("../img/icons/#{$usecase}.svg");
    }
  }

  @each $company,$card-graphic in (
    "bitgo": "magenta-3",
    "bitpay": "blue-green",
    "coil": "purple-blue",
    "exodus": "green",
    "forte": "light-blue-2",
    "gatehub": "orange-3",
    "ripple": "blue-light-blue",
    "towo": "purple",
    "xrpl-labs": "magenta-2",
    "xrplorer": "green-purple"
  ) {
    ##{$company} {
      .card-footer {
        background-image: url("../img/cards/3col-#{$card-graphic}.svg");
      }
      .biz-logo {
        content: url("../img/uses/#{$company}.svg");
      }
    }
  }
  #raisedinspace {
    .card-footer {
      background-image: url(../img/cards/3col-orange-yellow-2.svg);
    }
    .biz-logo {
      content: url(../img/uses/raised.png);
    }
  }
}

// History Page
#history-orange {
  position: absolute;
  top: 0;
  right: -4px;
}
#history-purple {
  position: absolute;
  top: -480px;
  left: -4px;
}
.hidden-section {
  overflow: hidden;
  visibility: hidden;
  height: 0;
  &.show {
    overflow: auto;
    visibility: visible;
    height: auto;
  }
}

// Impact
#impact-green {
  position: absolute;
  top: 0;
  right: -4px;
}
#impact-orange {
  position: absolute;
  top: 100px;
  left: -4px;
}
#impact-magenta {
  position: absolute;
  top: 100px;
  right: -4px;
}

// Calculator
#calculator-purple {
  position: absolute;
  top: 0px;
  left: 0px;
}
#calculator-green {
  position: absolute;
  top: 160px;
  right: 0px;
}

// Foundation Page
#foundation-magenta {
  position: absolute;
  top: 0px;
  left: 0px;
}
#foundation-orange {
  position: absolute;
  top: 40px;
  right: -4px;
}

// Community Page
#community-magenta {
  position: absolute;
  top: 0px;
  left: 0px;
}
#community-purple {
  position: absolute;
  top: 160px;
  right: 0px;
}

// Events page
.page-events {
  #event-hero-image {
      height: 100%;
      min-height: 209px;
      background: url(../img/events/event-hero1@2x.png);
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
  }
  #events-orange {
    position: absolute;
    top: 0px;
    right: 0px;
  }

  .event-hero {
      color: $gray-100;
      p {
          font-weight: 500;
          font-size: 24px;
          line-height: 32px;
      }
  }
  .event-save-date {
      color: $white;
      font-weight: bold;
      font-size: 20px;
      line-height: 26px;
  }
  .event-small-gray {
      color: $gray-400;
  }

  .event-card {
      max-width: 311px;
      margin: 32px auto;
      transition: all 0.35s ease-out;
      position: relative;
      display: flex;
      flex-direction: column;
      min-width: 0;
      word-wrap: break-word;
      background-clip: border-box;

      background-color: $card-bg;
      box-shadow: 0px 5px 40px $black;

      border: 1px solid rgba(0, 0, 0, 0.125);
      border-radius: 8px;

      font-size: 16px;
      line-height: 24px;
      color: $gray-200;

      .event-card-header {
          position: relative;
          height: 176px;
          background-size: contain !important;
          width: 100%;
          border-radius: 8px 8px 0 0;
      }

      .event-card-title {
          position: absolute;
          bottom: 32px;
          padding: 0 32px;
          color: $gray-100;

          font-weight: bold;
          font-size: 20px;
          line-height: 28px;
      }

      .event-card-body {
          padding: 32px;
      }

      .event-card-footer {
          padding: 0 32px 32px;
      }

      .event-card-footer .icon::before {
          height: 24px;
          width: 24px;
          content: "";
          margin-right: 8px;
          background-size: contain;
          background-repeat: no-repeat;
      }

      .icon-date::before {
          background: url(../img/events/event-date.svg);
      }
      .icon-location::before {
          background: url(../img/events/event-location.svg);
      }
  } //end event card

  @media (min-width: 992px) {
      .event-card {
          max-width: 347px;
          margin: 32px;
      }
      .event-card-header {
          height: 197px !important;
      }
  }

  a.event-card:hover {
      transform: translateY(-16px);
      text-decoration: none;
  }


  label {
    margin: 0;
    padding-left: 8px;
    color: $white;  
  }

  .events-filter h6 {
    font-size: 16px;
  }

  .events-filter {
    height: 20px;
    width: 20px;
  }

  .events-filter[type="checkbox"]::before {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
  
    content: "";
    background: $blue-purple-500;
    border-radius: 4px;

    border-width: 1px;
    border-style: solid;
    border-color: $blue-purple-500;
  }
  
  .events-filter[type="checkbox"]::after {
    position: relative;
    display: block;
  
    top: -20px;
    width: 20px;
    height: 20px;
  
    content: "";
  
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    border-width: 1px;
    border-style: solid;
    border-color: $blue-purple-500;
  }
  
  // .events-filter[type="checkbox"]:disabled::after {
  //   -webkit-filter: opacity(0.4);
  // }
  
  .events-filter[type="checkbox"]:checked::after {
    background-image: url(../img/events/event-check.svg);
    background-repeat: no-repeat;
    background-position: center;
    border-width: 1px;
    border-style: solid;
    border-color: $blue-purple-500;
    border-radius: 4px;
  }
  
  .events-filter[type="checkbox"]:not(:disabled):checked:hover::after {
    background-image: url(../img/events/event-check.svg);
    background-repeat: no-repeat;
    background-position: center;
    border-width: 1px;
    border-style: solid;
    border-color: $blue-purple-500;
    border-radius: 4px;
  }
  
  .events-filter[type="checkbox"]:not(:disabled):hover::after {
    background: $blue-purple-600;
    border-width: 1px;
    border-style: solid;
    border-color: $blue-purple-600;
    border-radius: 4px;
  }
  
  .events-filter[type="checkbox"]:not(:disabled):hover::before {
    background: $blue-purple-600;
    border-width: 1px;
    border-style: solid;
    border-color: $blue-purple-600;
    border-radius: 4px;
  }


}





#find-us-on-platforms .card-deck {
  .card:nth-child(1) .card-footer {
    background-image: url(../img/cards/4col-green-2.svg);
  }
  .card:nth-child(2) .card-footer {
    background-image: url(../img/cards/4col-light-blue-3.svg);
  }
  .card:nth-child(3) .card-footer {
    background-image: url(../img/cards/4col-magenta-3.svg);
  }
  .card:nth-child(4) .card-footer {
    background-image: url(../img/cards/4col-orange-2.svg);
  }
}


.page-faq {
  &::before {
    background-image: url(../img/backgrounds/faq-bg.svg);
    @include media-breakpoint-up(md) {
      background-size: contain;
    }
  }

  .content {
    @include media-breakpoint-up(lg) {
      max-width: 704px;
      margin-left: auto;
      margin-right: auto;
    }
  }

  .content h6:first-of-type {
    color: $green-500;
    margin-bottom: 1rem;
    margin-top: 2.5rem;
    font-size: 1.25rem;
    line-height: 26px;
    text-align: center;

    .hover_anchor {
      display: none;
    }

    @include media-breakpoint-up(lg) {
      margin-top: 6.5rem;
    }
  }
  .content h1:first-of-type {
    font-size: 2.625rem;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 5rem;
    text-align: center;

    .hover_anchor {
      display: none;
    }

    @include media-breakpoint-up(lg) {
      font-size: 3.875rem;
      margin-bottom: 13rem;
    }
  }

  h2 {
    // These divide up sections of questions.
    margin-top: 13rem;
    font-size: 2rem;
    line-height: 2.375rem;
    text-align: center;
    font-weight: 700;
  }
}

.page-faq,
.mini-faq {
  // Includes mini-FAQ used on XRPL overview page

  .q-wrapper {
    background: $gray-800;
    border-radius: $border-radius-sm;
    padding: 2rem;
    padding-right: 3rem; // don't overlap chevron
    // margin-bottom: 1.5rem; // this is enough space when a banner isn't active
    margin-bottom: 3.5rem; // give space so anchor-fix doesn't block clicks
    position: relative;
    z-index: 5;
    width: 100%;

    p a {
      text-decoration: none;
      font-weight: 600;
      color: $link-hover-color;

      &:hover {
        text-decoration: underline;
      }
    }

    h4 {
      font-size: 1.25rem;
      line-height: 1.625rem;
      margin-top: 0;

      &::before {
        display: block;
        content: " ";
        margin-top: -80px;
        height: 80px;
        visibility: hidden;
      }

      > a {
        text-decoration: none;

        &:hover {
          text-decoration: underline;
          color: $white;
        }
      }

      @include media-breakpoint-down(md) {
        font-size: 1rem;
        line-height: 1.5rem;
      }

      .chevron {
        position: absolute;
        top: 40px;
        right: 2rem;
      }
    }

  }
}

.page-docs-index {
  &::before {
    background-image: url(../img/backgrounds/bg-docs.png);
  }

  .center-search {
    .input-group-text {
      height: 56px;
      padding: .75rem .75rem .75rem 1rem;
      line-height: 2rem;
    }
    .ds-input {
      height: 56px;
      padding: .75rem 1rem .75rem .5rem;
    }
  }

  section {
    @include media-breakpoint-down(md) {
      margin-bottom: 2.5rem;
    }

    @include media-breakpoint-up(lg) {
      .row .col-lg-6:first-child {
        padding-right: 40px;
      }
      .row .col-lg-6:last-child {
        padding-left: 40px;
      }
    }
  }

  #software-and-sdks .card-deck {
    .card:nth-child(1) .card-footer {
      background-image: url(../img/cards/4col-green.svg);
    }
    .card:nth-child(2) .card-footer {
      background-image: url(../img/cards/4col-light-blue.svg);
    }
    .card:nth-child(3) .card-footer {
      background-image: url(../img/cards/4col-orange.svg);
    }
    .card:nth-child(4) .card-footer {
      background-image: url(../img/cards/4col-yellow.svg);
    }
  }

  #doc-types .card-deck {
    .card:nth-child(1) .card-footer {
      background-image: url(../img/cards/4col-orange-yellow.svg);
    }
    .card:nth-child(2) .card-footer {
      background-image: url(../img/cards/4col-magenta.svg);
    }
    .card:nth-child(3) .card-footer {
      background-image: url(../img/cards/4col-blue-green.svg);
    }
    .card:nth-child(4) .card-footer {
      background-image: url(../img/cards/4col-light-blue-2.svg);
    }
  }

  #docs-hot-topic .longform {
    margin-top: 2.5rem;
  }
}

.page-docs-index,
.page-community {
  #run-a-network-node .card-deck {
    .card:nth-child(1) .card-footer {
      background-image: url(../img/cards/4col-yellow-2.svg);
    }
    .card:nth-child(2) .card-footer {
      background-image: url(../img/cards/4col-purple.svg);
    }
    .card:nth-child(3) .card-footer {
      background-image: url(../img/cards/4col-magenta-2.svg);
    }
    .card:nth-child(4) .card-footer {
      background-image: url(../img/cards/4col-light-green.svg);
    }
  }
}

.page-community {
  @each $platform in "github", "twitch", "stack-overflow", "twitter" {
    #platform-#{$platform} {
      content: url("../img/logos/#{$platform}.svg")
    }
  }
}

.page-references {
  #refs-types .card-deck {
    .card:nth-child(1) .card-footer {
      background-image: url(../img/cards/3col-orange-2.svg);
    }
    .card:nth-child(2) .card-footer {
      background-image: url(../img/cards/3col-green-2.svg);
    }
    .card:nth-child(3) .card-footer {
      background-image: url(../img/cards/3col-magenta.svg);
    }
  }
  #xrpl-protocol .card-deck {
    .card:nth-child(1) .card-footer {
      background-image: url(../img/cards/4col-light-blue-4.svg);
    }
    .card:nth-child(2) .card-footer {
      background-image: url(../img/cards/4col-blue-green-2.svg);
    }
    .card:nth-child(3) .card-footer {
      background-image: url(../img/cards/4col-yellow-3.svg);
    }
    .card:nth-child(4) .card-footer {
      background-image: url(../img/cards/4col-purple-blue.svg);
    }
  }
}


.page-calculator {

  .calculator-section-description {
    max-width: 458px;
  }
  /* CALCULATOR STYLING */
  .calc-inputs {
    margin-right: 1px;
  }
  #data-selector li a {
    background: #22252B;
    padding: 0.5rem 1.3rem;
    color: $white;
    white-space: nowrap;
    font-weight: normal;
  }
  #data-selector li:nth-child(2) {
    margin-left: -7px;
    margin-right: -7px;
  }
  #data-selector li.active a {
    background: $primary;
    color: $black;
  }
  .tab-content div {
    display: none;
  }
  .d-output {
    display: none;
    margin: 0 12px;
    max-width: 188px;
    width: 33%;
    @include media-breakpoint-down(md) {
      width: auto;
    }
  }
  .d-output.active {
    display: block;
    animation-fill-mode: forwards;
    animation: fadeIn 1s ease-in-out;
    @include media-breakpoint-down(md) {
      display: inline-block;
      margin-bottom: 32px;
    }
    @include media-breakpoint-down(xs) {
      display: block
    }
  }

  @include media-breakpoint-down(xs) {
    .d-output {
      display: none;
      width: auto;
      max-width: 100%;
    }
    .viz-wrapper {
      margin-right: 1rem;
      min-width: 184px;
    }
    .num-wrapper {
      h5 {
        font-size: 1.3rem;
        word-break: break-word;
      }
    }
    .d-output[data-comp="kWh"].active {
      display: inline-flex;
    }
    #data-selector li:nth-child(2) {
      margin-left: 0;
      margin-right: 0;
      border-top: 1px solid $black;
      border-bottom: 1px solid $black;
    }
  }
  @include media-breakpoint-down(md) {
    #calculator-inputs-offset.offset {
      height: 404px;
      width: 100%;
    }
    #calculator-inputs-offset {
      height: 0;
      width: 100%;
    }
    .d-output {
      margin: 2rem 0;
    }
    #calculator-mobile-toggle.show {
      position: fixed;
      top: 84px;
      right: 15px;
      z-index: 9999999;
      background: $black;
    }
    #calculator-mobile-toggle.hide {
      display: none;
    }
    #calculator-inputs.sticky {
      position: fixed;
      top: 84px;
      width: calc(100% - 30px);
      left: 15px;
      right: 15px;
      background: $black;
      display: none;
    }
    #calculator-inputs.sticky.show .calc-inputs-wrapper {
      display: block;
      margin-bottom: 1.5rem;
    }
    #calculator-inputs.sticky.show {
      display: block;
    }
  }
  @include media-breakpoint-down(sm) {
    #calculator-inputs-offset.offset {
      height: 486px;
      width: 100%;
    }
  }
  @include media-breakpoint-up(xl){
    #data-selector li:first-child a {
      border-top-left-radius: 8px;
      border-bottom-left-radius: 8px;
    }
    #data-selector li:last-child a {
      border-top-right-radius: 8px;
      border-bottom-right-radius: 8px;
    }
  }
  @include media-breakpoint-down(lg) {
    #data-selector li:nth-child(2) {
      margin-left: 0;
      margin-right: 0;
    }
  }
  .viz-wrapper {
    position: relative;
    height: 204px;
    width: 184px;
    overflow: hidden;
    border-radius: 10px;
  }
  .viz-wrapper img {
    margin-left: -1px;
    margin-right: -1px;
  }
  @keyframes fadeIn {
    0% { opacity: 0 }
    100% { opacity: 1 }
  }
  .dot {
    height: 2px;
    width: 2px;
    border-radius: 50%;
    background-color: red;
    position: absolute;
    z-index: -1;
    top: 98px;
    left: 68px;
    transform-origin: center center;
  }
  #kWh-btc-dot {
    background-color: #FF671A;
  }
  #kWh-eth-dot {
    background-color: #4F5664;
  }
  #kWh-xrp-dot {
    background-color: $primary;
  }
  #kWh-pap-dot {
  }

  .dash {
    &.active {
      font-weight: bold;
      color: $primary;
    }
  }

  .dash:before {
    // content: url(../img/icons/dash-line.png);
    content: '|';
    font-size: 7px;
    font-weight: bold;
    color: $gray-500;
    position: absolute;
    top: -10px;
    margin-left: 13px;
  }


  input[type=range] {
    -webkit-appearance: none; /* Hides the slider so that custom slider can be made */
    width: 100%; /* Specific width is required for Firefox. */
    background: transparent; /* Otherwise white in Chrome */
    z-index: 2;
  }

  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
  }

  input[type=range]:focus {
    outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
  }

  input[type=range]::-ms-track {
    width: 100%;
    cursor: pointer;

    /* Hides the slider so custom styles can be added */
    background: transparent;
    border-color: transparent;
    color: transparent;
  }

  .slider::-webkit-slider-thumb {
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    box-sizing: content-box;
    border-radius: 50px;
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    width: 1px; /* Set a specific slider handle width */
    height: 1px; /* Slider handle height */
    background: $primary;
    padding: 0.125rem;
    border: 8px solid $black;
    box-shadow: 0 0 0 2px $primary;
    cursor: pointer; /* Cursor on hover */
  }

  .slider::-moz-range-thumb {
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    box-sizing: content-box;
    border-radius: 50px;
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    width: 1px; /* Set a specific slider handle width */
    height: 1px; /* Slider handle height */
    background: $primary;
    padding: 0.125rem;
    border: 8px solid $black;
    box-shadow: 0 0 0 2px $primary;
    cursor: pointer; /* Cursor on hover */
  }
  input[type="range"] {
    background: $primary;
    height: 3px;
  }

  /** FF*/
  input[type="range"]::-moz-range-progress {
    background-color: $primary;
  }
  input[type="range"]::-moz-range-track {
    background-color: $gray-500;
  }
  /* IE*/
  input[type="range"]::-ms-fill-lower {
    background-color: $primary;
  }
  input[type="range"]::-ms-fill-upper {
    background-color: $gray-500;
  }
}
