@import '../../theme/mixins';

.Main {
  padding: 32px 48px;

  @media (max-width: 730px) {
    padding: 64px var(--spacing-m);
  }
}

.Section {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 22px;
  padding-bottom: 22px;
}

.EditProfile {
  overflow: hidden;
  max-width: 935px;
  min-height: 500px;
  width: 100%;
  flex-direction: row;
  @include whiteBox();
}

.Title {
  font-size: 24px;
  font-weight: 400;
  line-height: 27px;
  margin-bottom: 26px;
  color: var(--color-main);
}

.Menu {
  border-right: 1px solid var(--color-border);
  flex-basis: 280px;
  flex-grow: 0;
  flex-shrink: 0;

  li > a {
    display: block;
    border-left: 1px solid transparent;
    color: var(--color-main);
    font-size: var(--medium-font);
    height: 100%;
    line-height: 20px;
    padding:
            var(--spacing-m)
            var(--spacing-m)
            var(--spacing-m)
            var(--spacing-xl);
    width: calc(100% - 48px);

    &:global(.active) {
      border-left-color: var(--color-main);
      font-weight: 600;
    }
  }

  .CloseIcon {
    display: none;
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
  }

  @media (max-width: 840px) {
    position: fixed;
    right: -500px;
    background-color: var(--color-light);
    z-index: 10;
    height: 100%;
    transition: right .3s ease-in-out;

    &.open {
      right: 0;
    }

    .CloseIcon {
      display: block;
    }
  }
}

.MenuTrigger {
  display: none;
  flex-direction: row;
  align-items: center;
  z-index: 1;

  .MenuLabel {
    color: var(--color-main);
    font-weight: 400;
    margin-top: -4px;
    font-size: var(--medium-font);
    margin-left: 4px;
  }

  button {
    background: transparent;
    border: 0;
    outline: 0;

    span {
      display: block;
      width: 18px;
      height: 2px;
      background-color: var(--color-main);
      margin-bottom: 3px;
      border-radius: 3px;
    }
  }

  @media (max-width: 840px) {
    display: flex;
  }
}

.Overlay {
  position: fixed;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  overflow-y: auto;
  cursor: pointer;
  z-index: 3;
}

.Content {
  flex: 1 1 400px;
  min-width: 50px;

  @media (max-width: 600px) {
    flex: 1;
    padding: 0 var(--spacing-m);
  }
}

.ChangeAvatar {
  flex-direction: row;
  margin: 32px 0 0;
  justify-content: flex-start;

  .AvatarWrapper {
    margin: 2px 32px 0 124px;
    width: 38px;
    height: 38px;
  }

  @media (max-width: 600px) {
    .AvatarWrapper {
      margin-left: 0;
      margin-right: var(--spacing-m);
    }
  }

  .AvatarChange {
    border: 0;
    cursor: pointer;
    padding: 0;
    width: 100%;
    height: 100%;

    img {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
    }
  }

  .Avatar {
    background-color: var(--color-light);
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
  }
}

.Username {
  flex: 0 1 auto;
  margin-right: 20px;
  overflow-x: hidden;

  h1 {
    font-size: 20px;
    line-height: 22px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
  }

  button {
    text-align: left;
    color: var(--color-accent);
    background-color: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-weight: 600;
  }

  &.WithoutUpload {
    justify-content: center;
    align-items: center;

    h1 {
      font-size: 24px;
      line-height: 38px;
    }
  }
}

.Form {
  display: flex;
  flex-direction: column;
  margin: var(--spacing-m) 0;
  align-items: stretch;

  .Control {
    margin-bottom: var(--spacing-m);
    flex-direction: row;
    justify-content: flex-start;
  }

  .Label {
    padding-left: 32px;
    padding-right: 32px;
    text-align: right;
    flex: 0 0 194px;
    font-size: var(--medium-font);
    font-weight: 600;
    line-height: 18px;
    margin-top: 6px;

    @media (max-width: 600px) {
      display: none;
    }
  }

  .Input {
    flex-basis: 355px;
    flex-direction: row;
    padding-right: 60px;
    font-size: var(--medium-font);
    justify-content: flex-start;

    @media (max-width: 600px) {
      flex-basis: auto;
      width: 100%;
      padding-right: 0;
      justify-content: center;
    }
  }

  .Buttons {
    margin-top: var(--spacing-m);
    justify-content: space-between;
  }

  .Submit {
    flex-direction: row;
    justify-content: center;
    align-items: center;

    svg {
      margin-left: var(--spacing-xs);
    }
  }

  .Error {
    text-align: center;
    color: var(--color-danger);
  }

  &.FormPassword {
    .Input {
      padding-right: 0;
    }
  }
}

.UpdatedMessage {
  text-align: center;
  color: var(--color-accent);
}

.HelperText {
  margin-top: var(--spacing-xs);
  color: var(--color-neutral-03);
  font-size: var(--base-font);
  font-weight: 400;
  line-height: 20px;
}

.Loader {
  justify-content: center;
  align-items: center;
  height: 100%;
}

.SectionLoading {
  opacity: .4;
}

.SectionLoadingSpinner {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
}

.Back {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background-color: transparent;
  transform: rotate(-90deg);
}

.Error {
  color: var(--color-danger);
  text-align: center;
}
