// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

//
// Office UI Fabric
// --------------------------------------------------
// Persona Card styles


// Small
//
// The persona card docks to the bottom of the viewport.
.ms-PersonaCard {
  @include ms-font-m;
  @include ms-u-slideUpIn10;
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  outline: 1px solid transparent;
}

.ms-PersonaCard-persona {
  background-color: $ms-color-neutralLighter;
}

// Overrides for persona
.ms-PersonaCard-persona .ms-Persona {
  .ms-Persona-imageArea {
    width: 80px;
    height: 80px;
    margin: 12px 0 12px 20px;
  }

  .ms-Persona-image {
    width: 80px;
    height: 80px;
  }

  .ms-Persona-placeholder {
    font-size: 75px;
    left: 1px;
    top: 11px;
  }

  .ms-Persona-initials {
    font-size: $ms-font-size-xxl;
    line-height: 80px;
  }

  .ms-Persona-presence {
    border-color: $ms-color-neutralLighter;
    left: 77px;
    bottom: 12px;
  }

  .ms-Persona-tertiaryText,
  .ms-Persona-optionalText {
    display: block; // Show tertiary and optional text
  }
}

.ms-PersonaCard-actions {
  @include ms-u-borderBox;
  list-style: none;
  margin: 0;
  padding: 0 10px;
  border-bottom: 1px solid $ms-color-neutralTertiaryAlt;
  background-color: $ms-color-white;
  height: 48px;
}

.ms-PersonaCard-action {
  display: inline-block;
  cursor: pointer;
  font-size: $ms-font-size-l;
  height: 48px;
  line-height: 48px;
  padding: 0 10px;
  color: $ms-color-neutralSecondary;
  position: relative;
  @include ms-u-borderBox;

  &:hover {
    color: $ms-color-neutralDark;
  }

  &:active {
    color: $ms-color-themePrimary;
  }

  // Currently-selected action
  &.is-active {
    color: $ms-color-themePrimary;

    // Arrow
    &:after {
      @include ms-u-borderBox;
      @include rotate(45deg);
      content: "";
      width: 10px;
      height: 10px;
      border: 1px solid $ms-color-neutralTertiaryAlt;
      background-color: $ms-color-white;
      position: absolute;
      border-right: 0;
      border-bottom: 0;
      bottom: -4px;
      left: 15px;
    }
  }
}

.ms-PersonaCard-overflow {
  @extend .ms-PersonaCard-action;
  font-size: $ms-font-size-m;
  color: $ms-color-neutralPrimary;
  float: right;
  margin-top: -1px;

  &:hover {
    color: $ms-color-themePrimary;
  }
}

.ms-PersonaCard-orgChart {
  position: absolute;
  right: 12px;
  top: 0;
}

.ms-PersonaCard-actionDetailBox {
  min-height: 48px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: $ms-color-white;
}

.ms-PersonaCard-actionDetails {
  list-style: none;
  width: 20%;
  float: left;
  min-height: 48px;
  color: $ms-color-neutralSecondary;
  padding: 9px 20px;
  transition: max-height $ms-duration2 $ms-ease1 0.2s;
  box-sizing: border-box;

  // State: Contents are collapsed to a single line.
  &.is-collapsed {
    height: 30px;
    overflow: hidden;

    // Show the expander icon.
    .ms-PersonaCard-detailExpander:after {
      content: '\e088';
    }
  }
}

// Active detail items
.ms-PersonaCard-detailChat,
.ms-PersonaCard-detailPhone,
.ms-PersonaCard-detailVideo,
.ms-PersonaCard-detailMail,
.ms-PersonaCard-detailOrg {
  overflow: hidden;
  width: 500%;
  padding: 0;
  margin: 0;
}

.ms-PersonaCard-detailOrg {
  overflow-y: auto;
}

.ms-PersonaCard-detailChat {
  margin-left: 0;
}
.ms-PersonaCard-detailPhone {
  margin-left: -100%;
}
.ms-PersonaCard-detailVideo {
  margin-left: -200%;
}
.ms-PersonaCard-detailMail {
  margin-left: -300%;
}
.ms-PersonaCard-detailOrg {
  margin-left: -400%;
}

.ms-PersonaCard-detailChat .detail-1,
.ms-PersonaCard-detailPhone .detail-2,
.ms-PersonaCard-detailVideo .detail-3,
.ms-PersonaCard-detailMail .detail-4 {
  max-height: 78px;
  transition: max-height 0.25s ease;
}

.ms-PersonaCard-detailOrg .detail-5 {
  max-height: 300px;
  transition: max-height 0.25s ease;
}

// Inactive Items
.ms-PersonaCard-detailChat .detail-2,
.ms-PersonaCard-detailChat .detail-3,
.ms-PersonaCard-detailChat .detail-4,
.ms-PersonaCard-detailChat .detail-5,
.ms-PersonaCard-detailPhone .detail-1,
.ms-PersonaCard-detailPhone .detail-3,
.ms-PersonaCard-detailPhone .detail-4,
.ms-PersonaCard-detailPhone .detail-5,
.ms-PersonaCard-detailVideo .detail-1,
.ms-PersonaCard-detailVideo .detail-2,
.ms-PersonaCard-detailVideo .detail-4,
.ms-PersonaCard-detailVideo .detail-5,
.ms-PersonaCard-detailMail .detail-1,
.ms-PersonaCard-detailMail .detail-2,
.ms-PersonaCard-detailMail .detail-3,
.ms-PersonaCard-detailMail .detail-5,
.ms-PersonaCard-detailOrg .detail-1,
.ms-PersonaCard-detailOrg .detail-2,
.ms-PersonaCard-detailOrg .detail-3,
.ms-PersonaCard-detailOrg .detail-4 {
  max-height: 48px;
}

// Icon to expand a collapsed actionDetails section.
.ms-PersonaCard-detailExpander {
  color: $ms-color-neutralPrimary;
  cursor: pointer;
  font-size: $ms-font-size-m-plus;
  height: 30px;
  line-height: 30px;
  margin-top: 1px;
  position: absolute;
  right: 10px;
  text-align: center;
  width: 30px;

  &:after {
    @include ms-Icon;
    content: '\e087';
  }
}

.ms-PersonaCard-detailLine {
  color: $ms-color-neutralPrimary;
  line-height: 30px;
}

.ms-PersonaCard-detailLabel {
  color: $ms-color-neutralSecondary;
}

.ms-PersonaCard-action.ms-PersonaCard-orgChart {
  &:after {
    display: none; // Hide arrow for orgchart action
  }
}


//== Modifier: Persona card with square personas
//
.ms-PersonaCard.ms-PersonaCard--square {
  .ms-PersonaCard-persona {
    .ms-Persona-imageArea,
    .ms-Persona-image {
      width: 100px;
      height: 100px;
      margin: 0;
    }

    .ms-Persona-presence {
      left: 0;
    }
  }
}


@media (min-width: $ms-screen-md-min) {
  // Undock the persona card and give it a shadow.
  .ms-PersonaCard {
    @include drop-shadow();
    max-width: 360px;
    position: relative;
  }
}
