// Copyright (c) 2020 KALEIDOS INC
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

.dashboard-sidebar {
  &.settings {
    .back-to-dashboard {
      padding: 12px 18px;
      font-size: $fs14;
      cursor: pointer;
      display: flex;

      .icon {
        display: flex;
        align-items: center;
        margin-right: 14px;
      }

      .text {
        color: $color-gray-60;
      }

      svg {
        fill: $color-gray-60;
        transform: rotate(90deg);
        width: 12px;
        height: 12px;
      }
    }
  }
}

.dashboard-settings {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;

  .form-container {
    margin-top: 50px;
    display: flex;
    max-width: 368px;
    margin-bottom: 2rem;
    width: 100%;

    &.two-columns {
      max-width: 536px;
      justify-content: space-between;
      flex-direction: row;
    }

    h2 {
      margin-bottom: 1rem;
    }
  }

  .avatar-form {
    display: flex;
    flex-direction: column;
    width: 120px;
    min-width: 120px;

    img {
      border-radius: 50%;
      flex-shrink: 0;
      height: 120px;
      margin-right: $size-4;
      width: 120px;
    }

    .image-change-field {
      position: relative;
      width: 120px;
      height: 120px;

      .update-overlay {
        opacity: 0;
        cursor: pointer;
        position: absolute;
        width: 121px;
        height: 121px;
        border-radius: 50%;
        font-size: $fs24;
        color: $color-white;
        line-height: $lh-500; // Original value was 120px; 120px/24px = 500% => $lh-500
        text-align: center;
        background: $color-primary-dark;
        z-index: 14;
      }

      input[type="file"] {
        width: 120px;
        height: 120px;
        position: absolute;
        opacity: 0;
        cursor: pointer;
        top: 0;
        z-index: 15;
      }

      &:hover {
        .update-overlay {
          opacity: 0.8;
        }
      }
    }
  }

  .profile-form {
    display: flex;
    flex-direction: column;
    max-width: 368px;
    width: 100%;

    .newsletter-subs {
      border-bottom: 1px solid $color-gray-20;
      border-top: 1px solid $color-gray-20;
      padding: 30px 0;
      margin-bottom: 31px;

      .newsletter-title {
        font-family: "worksans", sans-serif;
        color: $color-gray-30;
        font-size: $fs14;
      }

      label {
        font-family: "worksans", sans-serif;
        color: $color-gray-60;
        font-size: $fs12;
        margin-right: -17px;
        margin-bottom: 13px;
      }

      .info {
        font-family: "worksans", sans-serif;
        color: $color-gray-30;
        font-size: $fs12;
        margin-bottom: 8px;
      }

      .input-checkbox label {
        align-items: flex-start;
      }
    }
  }

  .options-form,
  .password-form {
    h2 {
      font-size: $fs14;
      margin-bottom: 20px;
    }
  }
}

.dashboard-access-tokens {
  display: flex;
  flex-direction: column;
  align-items: center;

  .access-tokens-hero-container {
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .access-tokens-hero {
    font-size: $fs14;
    padding: $size-6;
    background-color: $color-white;
    margin-top: $size-6;
    display: flex;
    justify-content: space-between;

    .desc {
      width: 80%;
      color: $color-gray-40;
      h2 {
        margin-bottom: $size-4;
        color: $color-black;
      }
      p {
        font-size: $fs16;
      }
    }

    .btn-primary {
      flex-shrink: 0;
    }
  }

  .access-tokens-empty {
    text-align: center;
    max-width: 1000px;
    width: 100%;
    padding: $size-6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px dashed $color-gray-20;
    color: $color-gray-40;
    margin-top: 12px;
    min-height: 136px;
  }

  .table-row {
    background-color: $color-white;
    display: grid;
    grid-template-columns: 1fr 43% 12px;
    height: 63px;
    &:not(:first-child) {
      margin-top: 8px;
    }
  }

  .table-field {
    &.name {
      color: $color-gray-60;
    }

    &.expiration-date {
      color: $color-gray-40;
      font-size: $fs14;
      .content {
        padding: 2px 5px;
        &.expired {
          background-color: $color-warning-lighter;
          border-radius: $br4;
          color: $color-gray-40;
        }
      }
    }

    &.access-token-created {
      word-break: break-all;
    }

    &.actions {
      position: relative;
    }
  }
}

.access-tokens-modal {
  .action-buttons {
    gap: 10px;

    .cancel-button {
      border: 1px solid $color-gray-30;
      background: $color-canvas;
      border-radius: $br3;
      padding: 0.5rem 1rem;
      cursor: pointer;
      margin-right: 8px;

      &:hover {
        background: $color-gray-20;
      }
    }
  }
  .access-token-created {
    position: relative;
    word-break: break-all;

    .custom-input input {
      background-color: $color-success-lighter;
      border: 0;
      padding: 0 0 0 15px;
    }
  }

  .help-icon {
    border: none;
    height: 40px;
    width: 40px;
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
    background-color: $color-success-lighter;

    svg {
      fill: $color-gray-30;
    }

    &:hover {
      svg {
        fill: $color-gray-60;
      }
    }
  }

  .token-created-info {
    font-size: $fs12;
    color: $color-gray-40;
  }
}
