@import 'variables';
@import 'mixins';
@import 'components/buttons';
@import 'components/modals';
@import 'components/forms';
@import 'config/import';

#onboarding-container {
  min-height: calc(100vh - 350px);
}

.pages-onboarding {
  min-height: initial;
}

// modal box card
.onboarding-main {
  @extend .crayons-modal;
  @extend .crayons-modal--l;
  @extend .crayons-modal--padding-0;
  border: none;
  z-index: 1;

  @media screen and (min-width: 600px) {
    border-width: 2px;
  }

  a {
    color: var(--link-brand-color);
  }
}

// modal inner content spacing
.onboarding-content {
  box-sizing: border-box;
  flex: 1 0 auto;
  padding: $su-4;
  width: 100%;
  max-height: calc(100vh - 70px);
  overflow: auto;

  @media screen and (min-width: $breakpoint-s) {
    justify-content: center;
    padding: $su-7 $su-8 $su-8;
  }
}

.toggle-bottom {
  padding-bottom: 0px;
}

// terms and conditions view
.terms-and-conditions-wrapper {
  $content-height: 358px;

  button {
    @extend .crayons-btn;
  }
  .terms-and-conditions-content {
    height: $content-height;
    overflow-y: scroll;
    margin-top: 10px;
  }
}

// window background
.onboarding-body {
  -moz-background-size: cover;
  -o-background-size: cover;
  -webkit-background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  height: 100vh;
  justify-content: start;
  line-height: 200%;
  margin: 0;
  overflow-y: scroll;
  position: fixed;
  top: 0;
  width: 100%;

  @media screen and (min-width: 600px) {
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-image: url('/assets/onboarding-background-white.png');
  }

  &:before {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    height: 100%;
    width: 100%;
  }
}

// modal navigation
.onboarding-navigation {
  align-self: flex-end;
  flex-shrink: 0;
  width: 100%;
  border-bottom: 2px solid var(--box-darker);

  &.intro-slide {
    border-bottom: none;
  }

  .navigation-content {
    display: flex;
    justify-content: space-between;
    padding: $su-4;

    &.intro-slide {
      padding: 0;
    }

    button {
      @extend .crayons-btn;
    }

    .back-button-container,
    .next-button {
      // Explicitly set width to avoid next-button re-sizing with text,
      // and to ensure that back-button-container takes up the same amount of space.
      width: $su-10;
    }

    .back-button {
      @extend .crayons-btn;
      @extend .crayons-btn--ghost;
      @extend .crayons-btn--icon;

      $button-size: 40px; // Explicitly set size for accessibility.

      border-radius: 100%;
      min-width: $button-size;
      height: $button-size;
      align-items: center;
      display: flex;

      &:hover,
      &:active {
        background: var(--base-10);
      }
    }

    .skip-for-now {
      @extend .crayons-btn;
      @extend .crayons-btn--secondary;
    }

    .stepper {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .dot {
      $dot-size: 10px;

      background-color: var(--base-30);
      border-radius: 50%;
      width: $dot-size;
      height: $dot-size;
      margin: $su-1;
    }

    .active {
      background-color: var(--accent-brand);
    }
  }
}

// modal header
.onboarding-content-header {
  margin-bottom: $su-4;

  @media screen and (min-width: $breakpoint-s) {
    margin-bottom: $su-6;
  }

  .title,
  .subtitle {
    margin: 0;
  }

  .title {
    font-weight: $fw-heavy;
    margin-bottom: $su-1;
    text-align: left;
  }

  .subtitle {
    color: var(--card-color-secondary);
    font-size: $fs-xl;
    font-weight: $fw-medium;
    letter-spacing: normal;
    line-height: $lh-base;
  }
}

// modal selection status
.onboarding-selection-status {
  align-self: flex-end;
  flex-shrink: 0;
  width: 100%;
  line-height: 100%;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;

  .selection-status-content {
    display: block;
    text-align: center;

    .follow-count {
      font-size: $su-4;
      font-weight: $fw-medium;
      line-height: $lh-base;

      &--active {
        font-weight: $fw-bold;
      }
    }

    button {
      background: none;
      border: none;
      padding: 0px;
      color: var(--accent-brand);
      font-size: $fs-s;
    }
  }
}

// override crayons notice
.onboarding-body {
  .crayons-notice {
    display: block;
    margin-bottom: $su-2;
  }
}
// modal overflow scrolling
.onboarding-modal-scroll-container {
  height: auto;
  max-height: calc(100vh - 289px);
  overflow-y: scroll;
  border-bottom: 1px solid var(--base-20);

  @media screen and (min-height: 800px) {
    max-height: 520px;
  }
}

// tag styles
.onboarding-tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: $su-4;
  width: 100%;

  @media screen and (min-width: 800px) {
    grid-template-columns: repeat(3, 1fr);
  }

  &__button {
    @extend .crayons-btn;
    border: 0;
    display: block;
    position: absolute;
    left: $su-4;
    right: $su-4;
    bottom: $su-4;
    width: calc(100% - 32px);
    transform: translateY(0px);
    font-family: $ff-default;
    $button: &;

    @media screen and (min-width: 800px) {
      transform: translateY(60px);
    }

    &-default {
      display: inline-block;
    }

    &-alt {
      display: none;
    }
  }

  &__item {
    border-radius: $br-default;
    position: relative;
    overflow: hidden;
    height: 150px;
    $item: &;

    &__inner {
      background: var(--base-10);
      bottom: 0;
      font-family: $ff-accent;
      hyphens: auto;
      left: 0;
      padding: $su-4;
      position: absolute;
      right: 0;
      top: 0;
      transition: all ease-in-out 0.1s;
      z-index: 2;
    }

    &:hover {
      #{$item}__inner {
        background: transparent;
      }

      .onboarding-tags__button {
        transform: translateY(0);

        &:hover {
          transform: translateY(-2px);
        }
      }
    }

    &--selected {
      #{$item}__inner {
        background: transparent;
      }

      input[type='checkbox']:checked {
        background: var(--link-brand-color);
      }
    }
  }
}

// Onboarding Intro
.onboarding-main.introduction {
  width: 578px;

  .onboarding-content {
    background: var(--base-100);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: start;
    padding: $su-8;

    @media screen and (min-width: $breakpoint-s) {
      justify-content: center;
    }
  }

  figure {
    margin: 0 0 $su-2 0;

    .sticker-logo {
      height: $su-8;
      width: $su-8;
      transform: rotate(-30deg);
      padding: $su-3;
      vertical-align: middle;
    }
  }

  .introduction-title,
  .introduction-subtitle {
    margin: 0;
  }

  .introduction-title {
    font-size: $fs-5xl;
    font-weight: $fw-heavy;
    line-height: $lh-tight;
  }

  .introduction-subtitle {
    font-size: $fs-2xl;
    font-weight: $fw-normal;
    line-height: $lh-base;
  }

  .navigation-content {
    padding: $su-7;
    justify-content: center;

    &.intro-slide {
      padding: 0;
    }

    button {
      @extend .crayons-btn;
    }
  }
}

// follow users slide
$onboarding-user-unselected-hover: rgba(71, 85, 235, 0.05);
$onboarding-user-selected: rgba(71, 85, 235, 0.1);
$onboarding-user-selected-hover: rgba(71, 85, 235, 0.2);

.onboarding-body {
  .content-row {
    align-items: center;
    border: none;
    box-sizing: border-box;
    color: var(--body-color);
    display: flex;
    padding: $su-2 $su-4;
    text-align: left;
    width: 100%;

    &.unselected {
      &:hover {
        background-color: $onboarding-user-unselected-hover;
        cursor: pointer;
      }

      button {
        @extend .crayons-btn;
        @extend .crayons-btn--outlined;
      }
    }

    &.selected {
      background-color: $onboarding-user-selected;

      &:hover {
        background-color: $onboarding-user-selected-hover;
        cursor: pointer;
      }

      button {
        @extend .crayons-btn;
      }
    }
  }

  .user-avatar-container {
    align-self: baseline;
    margin: 0 $su-4 0 0;

    @media screen and (min-width: $breakpoint-s) {
      align-self: center;
    }
  }

  .user-avatar {
    border-radius: 100%;
    height: $su-8;
    width: $su-8;
    object-fit: cover;
    border: 1px solid var(--base-10);
  }

  .current-user-info {
    text-align: center;
    margin-bottom: 1rem;

    .current-user-avatar-container {
      height: 80px;
    }

    .current-user-avatar {
      border-radius: 100%;
      height: inherit;
      object-fit: cover;
      border: 2px solid var(--base-90);
    }

    h3 {
      margin-top: $su-2;
      line-height: $lh-tight;
    }

    p {
      font-size: $fs-base;
      line-height: $lh-tight;
      color: var(--base-70);
    }
  }

  .user-name,
  .user-summary {
    margin: 0;
    line-height: $lh-tight;
  }

  .user-name {
    font-size: $fs-base;
  }

  .user-info {
    width: 100%;
  }

  .user-summary {
    font-size: $fs-s;
  }

  .user-following-status {
    margin-left: $su-7;
  }
}

// closing slide
.onboarding-what-next {
  display: flex;
  flex-direction: column;
  overflow: auto;
  min-height: 250px;

  @media screen and (min-width: $breakpoint-s) {
    flex-direction: column;
  }

  p {
    align-items: center;
    display: inline-flex;
  }

  a {
    background: #d9e7ff;
    margin: 4px auto;
    border-radius: 3px;
    display: block;
    font-weight: 800;
    width: 100%;
    padding: 0.25em;
    position: relative;
    text-align: center;
    box-sizing: border-box;

    .whatnext-emoji {
      text-align: center;
      font-size: 32px;
      margin-right: 8px;
    }
  }
}

.onboarding-previous-location {
  text-align: center;
  margin-top: 10px;
  font-weight: bold;
  display: none;

  @media screen and (min-width: 600px) {
    display: block;
  }

  code {
    font-size: 0.6em;
    margin-top: -10px;
    display: block;
    font-weight: 400;
  }
}

// Follow user
.onboarding-body {
  .content-row {
    align-items: center;
    color: #202428;
    display: flex;
    padding: 8px 16px;
    text-align: left;
    width: 100%;

    &:hover {
      background-color: #eef0f1 !important;
    }
  }

  .user-avatar-container {
    margin: 0 16px 0 0;
  }

  .user-avatar {
    border-radius: 100%;
    height: 48px;
    width: 48px;
    object-fit: cover;
    border: 1px solid #eef0f1;
  }

  .user-name,
  .user-summary {
    margin: 0;
  }

  .user-following-status {
    margin-left: 32px;
  }
}

// Forms
.onboarding-main {
  fieldset {
    padding: 0;
    border: none;
    margin-bottom: $su-6;

    &:last-child {
      margin-bottom: 0;
    }

    ul {
      list-style-type: none;
      margin: 0;
      padding-left: 0;
    }
  }

  legend {
    color: var(--body-color);
    font-weight: $fw-medium;
  }

  input[type='text'],
  textarea {
    @extend .crayons-textfield;
    box-sizing: border-box;
  }

  textarea {
    min-height: 80px;
  }

  label {
    @extend .crayons-field;
    @extend .crayons-field__label;
    margin-bottom: $su-4;

    &:last-child {
      margin-bottom: 0;
    }
  }

  .checkbox-form-wrapper {
    padding: $su-7;

    .checkbox-form {
      padding-bottom: $su-6;
    }
  }

  // Checkboxes
  .checkbox-item {
    label {
      @extend .crayons-field__label;
      align-items: baseline;
      border-radius: $br-default;
      display: flex;
      flex-direction: row;
      padding: 0 $su-1;
      width: 100%;

      @media screen and (min-width: $breakpoint-s) {
        align-items: center;
      }

      &:hover {
        background: var(--body-bg);
        cursor: pointer;
      }

      &:last-child {
        margin-bottom: 0;
      }

      a {
        display: contents;
      }

      input[type='checkbox'] {
        @extend .crayons-checkbox;
        margin-right: $su-2 !important;
      }
    }
  }

  @media screen and (max-height: 790px) {
    .onboarding-form-input--last {
      margin-bottom: 25px;
    }
  }
}
