@import 'base';

.user-profile {
  @extend %block;
  background-color: white;

  padding: 0 30px 1px 30px;

  &__header {
    display: flex;
    flex-direction: column;
    align-items: center;

    &-title {
      font-size: 20px;
      margin: 20px 0;
    }
  }

  &__agency {
    margin-bottom: 30px;

    &-header {
      &-title {
        color: color(primary);
        margin-bottom: 10px;
      }

      &-subtitle {
        color: color(black, bright);
        margin-bottom: 10px;
      }
    }
  }

  &__field {
    margin-bottom: 10px;

    &-header {
      display: flex;
      align-items: center;
      color: color(primary, light);
      margin-bottom: 10px;

      &-indicator {
        margin-left: 10px;

        &.user-profile__field-header-indicator_synchronized {
          color: color(primary);
        }

        &.user-profile__field-header-indicator_locked {
          color: color(black, bright);
        }

        &.user-profile__field-header-indicator_synchronizing {
          @keyframes spin {
            0% { transform: rotate(360deg); }
            100% { transform: rotate(0deg); }
          }

          color: color(black, bright);
          animation: spin 2s linear infinite;
        }
      }
    }

    &-input {
      @extend %simple-input;
      border-radius: 5px;
      width: 100%;

      &:hover {
        opacity: 0.54;
      }

      &.user-profile__field-input_empty {
        border: solid 1px color(black, bright);
      }

      &.user-profile__field-input_focused {
        opacity: 1;
        border-color: transparent;
      }
    }

    &-values {
      display: flex;
      flex-wrap: wrap;
      $margin: 2px;
      margin: -$margin;

      &-value {
        $border-width: 1px;
        $padding-width: 4px;
        $padding-height: 6px;

        &-outline {
          @extend %link;
          display: flex;
          align-items: center;
          justify-content: space-between;
          $empty-color: color(black, bright);
          border: solid $border-width $empty-color;
          color: $empty-color;
          margin: $margin;
          border-radius: 5px;
          padding: $padding-width $padding-height;
        }

        &.user-profile__field-values-value_selected {
          .user-profile__field-values-value-outline {
            border-style: none;
            background-color: color(primary);
            color: color(white);
            padding: ($padding-width + $border-width) ($padding-height + $border-width);
          }
        }
      }
    }

    &-dropzone {
      max-width: 300px;
    }

    &-file {
      display: flex;
      flex-direction: column;
      align-items: flex-start;

      &-preview {
        font-size: 40px;
        color: color(black, normal, 0.7);
        @extend %link;

        &:hover {
          opacity: 1;
          color: color(primary);
        }
      }

      &-update {
        color: color(black, bright);
        text-decoration: underline;
        @extend %link;

        &:hover {
          color: color(primary);
        }
      }
    }
  }
}
