/*
This file is part of the Meeds project (https://meeds.io/).
Copyright (C) 2020 Meeds Association
contact@meeds.io
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
@import "../../../variables.less"; 
@import "../../../mixins.less";

#ProfileHeader {
  /* Only for owner because the 'refuse connection' button
  that is displayed on profile of profile of other user
  will be displayed under the banner */
  &.profileHeaderOwner {
    overflow: hidden;
  }

  .profileBannerImg {
    overflow: visible;

    .v-responsive__sizer {
      padding-bottom: 0 !important;
    }
  }

  .profileHeaderTitle {
    margin-top: 28px;
    margin-bottom: 28px;
  }

  .changeBannerButton {
    position: absolute;
    padding: 0;
    margin: 0;
    display: inline;
    background: rgba(0, 0, 0, 0.2) !important;
    left: auto;
    top: 15px;
    height: 36px;
    width: 36px;
    border-radius: 50%;

    .v-input__prepend-outer {
      margin: 0;

      button {
        color: #fff;
        padding: 3px;
      }
    }

    .v-input__control {
      visibility: hidden;
      width: 0;
      height: 0;
    }

    .v-input__icon--prepend {
      padding-left: 11px ~'; /** orientation=rt */ ';
    }

    &:not(.skeleton-background) {
      border: 1px solid #fff !important;
    }

    button {
      margin: auto;
      min-width: 30px;
      height: 30px;
      justify-content: flex-end;

      &:before {
        font-family: "PLF-FONT-ICONS";
        content: "\e956";
        font-size: 18px;
      }
    }
  }

  .invitationButtons {
    position: relative;
    top: 4px;

    .acceptToConnectButtonParent {
      display: inline-flex;
  
      .acceptToConnectButton {
        border-right: 1px solid @btnBorder !important;
        border-bottom-right-radius: 0 !important;
        border-top-right-radius: 0 !important;
  
        .v-btn__content {
          span {
            overflow: hidden !important;
            text-overflow: ellipsis !important;
          }
        }
      }
      .peopleButtonMenu {
        border-bottom-left-radius: 0 !important;
        border-top-left-radius: 0 !important;
        min-width: auto;
        padding: 0;

        i {
          margin: 0;
        }

        &.dialogButton {
          display: none;
        }  
      }

    }
    .refuseToConnectButton {
      margin-top: 2px;
      position: absolute;
      left: 0;
      top: 24px;
      min-width: 76%;
      max-width: 76%;
    }
  }
}

.profileHeaderAvatar {
  border: 2px solid @lightWhite !important;
  position: relative !important;

  &.profileHeaderAvatarHoverEdit {
    background: linear-gradient(180deg, rgb(255, 255, 255) 0%, rgb(4, 4, 4) 80%, rgba(0,0,0,1) 100%);

    .v-image__image {
      opacity: 0.8;
    }
  }

  .changeAvatarButton {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    position: absolute;
    padding: 0;
    margin: 0;
    display: inline;

    .v-input__prepend-outer {
      margin: 0;

      button {
        color: #fff;
        padding: 3px;
      }
    }

    .v-input__control {
      visibility: hidden;
      width: 0;
      height: 0;
    }
  }
}

@media (max-width: 979px) {
  .profileHeader{
    width: 100%;
  }
}
@media (min-width: 980px) {
  .profileHeader{
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .profileHeaderText{
    height: 100%;
    margin-top: 22px;
  }
}

@media (max-width: @maxTabletWidth) {
  #ProfileHeader {
    .profileBannerImg {
      height: 218px !important;
      min-height: 218px !important;
      max-height: 218px !important;
      background: white;

      > .v-image__image {
        max-height: 50% !important;
        max-width: ~"calc( 100% - 12px )";
        margin: 6px;
      }

      > .v-responsive__content {
        max-height: 50% !important;
        margin-top: 108px;
        display: block;

        > .layout {
          max-height: 100%;
        }

        .profileHeaderAvatar {
          height: 95px !important;
          min-width: 95px !important;
          width: 95px !important;
          position: absolute !important;
          top: 50px !important;
        }

        .profileHeaderTitle {
          margin: 0;
        }

        .profileHeaderText {
          position: absolute;
          top: 145px;

          > .skeleton-text {
            margin-top: 10px !important;
            margin-left: 18px !important;
          }
          .headline {
            color: @textColor !important;
          }
          .subtitle {
            color: @greyColorLighten1 !important;
          }
          .headline, .subtitle {
            max-width: ~"calc(100vw - 50px)";
            box-sizing: border-box;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            display: block;
          }
        }

        #profileHeaderActions {
          margin: 8px 0 !important;

          button {
            margin: 0 6px !important;
            padding: 0 !important;
            min-width: auto !important;
            background: transparent !important;
            border: 0 !important;

            .buttonText {
              display: none;
            }
            i {
              color: @primaryColor !important;
            }
          }

          .acceptToConnectButton, .refuseToConnectButton {
            display: none;
          }

          .invitationButtons {
            min-width: 24px;
            display: inline-block !important;
            height: 21px;
            top: 0;
          }

          .acceptToConnectButtonParent {
            position: absolute;
          }

          .peopleButtonMenu {
            &.dropdownButton {
              display: none;
            }
            &.dialogButton {
              margin: 0 !important;
              display: block;
            }
          }
        }
      }
    }
  }
}