/*! _components-widgets.scss | Friendkit | © Css Ninja. 2020-2021 */

/* ==========================================================================
Widget styles
========================================================================== */

/*
    0. Schedule widget
    1. Widget Keyframes
    2. Media Flex Center
    3. Media Queries
*/

/* ==========================================================================
0. Schedule widget
========================================================================== */

.schedule {
  position: relative;
  width: 100%;
  height: auto;
  border-radius: 0.65rem;
  border: 1px solid $fade-grey;
  margin: 10px 0 20px 0;
  overflow: visible;
  background: $white;

  .schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 16px 0 16px;

    .month {
      text-align: center;
      padding: 4px 0;
      color: $dark-text;
      width: 40%;
      border-radius: 100px;
      cursor: pointer;
      transition: all 0.3s;

      &:hover {
        background: lighten($fade-grey, 5%);
      }
    }

    .nav-icon {
      height: 34px;
      width: 34px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      transition: all 0.3s;
      cursor: pointer;

      &:hover {
        background: lighten($fade-grey, 5%);
      }

      svg {
        height: 20px;
        width: 20px;
        stroke: $muted-grey;
      }
    }
  }

  .schedule-calendar {
    position: relative;
    padding: 20px 20px 40px 20px;

    .next-fab {
      position: absolute;
      bottom: -25px;
      right: 0;
      left: 0;
      margin: 0 auto;
      height: 50px;
      width: 50px;
      border: 1px solid lighten($placeholder, 8%);
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      background: $white;
      box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.07);
      cursor: pointer;
      transition: all 0.3s;
      transform: rotate(0);

      &:hover {
        background: $white-smoke;

        svg {
          stroke: $accent;
        }
      }

      &.is-toggled {
        transform: rotate(180deg);
        box-shadow: none;
      }

      svg {
        height: 20px;
        width: 20px;
        transition: all 0.3s;
      }
    }

    .calendar-row {
      display: flex;
      align-items: center;
      justify-content: space-between;

      &:not(:first-of-type) {
        margin-top: 4px;
      }

      .day {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        font-size: 12px;
        padding: 14px;
        color: #596367;
        border-radius: 50%;
        cursor: pointer;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;

        &:hover {
          background: lighten($fade-grey, 5%);
        }

        &.day-name {
          color: #869ba1;
        }

        &.event {
          position: relative;
          color: $white;

          &:before {
            content: '';
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            width: 27px;
            height: 27px;
            border-radius: 50%;
            z-index: -1;
            transition: -webkit-transform 0.25s ease-in-out;
            transition: transform 0.25s ease-in-out;
            transition:
              transform 0.25s ease-in-out,
              -webkit-transform 0.25s ease-in-out;
          }

          &.primary {
            background: $primary;

            &:before {
              background: $primary;
            }
          }

          &.green {
            background: $green;

            &:before {
              background: $green;
            }
          }

          &.purple {
            background: $accent;

            &:before {
              background: $accent;
            }
          }

          &.pink {
            background: #fa3275;

            &:before {
              background: #fa3275;
            }
          }

          &.animate {
            position: static;

            &:before {
              top: 160px;
              left: 55px;
              z-index: 1;
              will-change: transform;
            }
          }
        }
      }
    }
  }

  .schedule-divider {
    height: 1px;
    background: #ededed;
  }

  .schedule-events {
    padding: 16px;
    display: none;
    background: lighten($fade-grey, 7%);

    .schedule-events-title {
      margin-top: 16px;
      font-weight: 500;
      text-transform: uppercase;
      font-size: 0.75rem;
      color: $muted-grey;
    }

    .schedule-event {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      margin-top: 16px;

      .event-date {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
        font-weight: 500;
        border-radius: 50%;
        color: $white;

        &.primary {
          background: $primary;
        }

        &.green {
          background: $green;
        }

        &.purple {
          background: $accent;
        }

        &.pink {
          background: #fa3275;
        }
      }

      .event-title {
        color: #596367;
        padding-left: 16px;

        span {
          display: block;

          &:first-child {
            font-size: 0.9rem;
            color: $dark-text;
          }

          &:nth-child(2) {
            color: $muted-grey;
            font-size: 0.85rem;
          }
        }
      }
    }

    .button-wrap {
      margin-top: 16px;
    }
  }

  .schedule-day-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    opacity: 1;
    -webkit-transform: translate(0, 0);
    transform: translate(0, 0);
    z-index: 1;
    overflow: hidden;

    &.animate-out {
      -webkit-animation: day-container-out 0.15s ease-out forwards;
      animation: day-container-out 0.15s ease-out forwards;
      will-change: transform;
    }

    &.hidden {
      z-index: -100;
    }

    .day-header {
      position: relative;
      top: 0;
      left: 0;
      display: flex;
      flex-direction: column;
      height: 46px;
      padding: 16px;
      overflow: hidden;
      z-index: 2;
      transition: height 0.075s linear;

      &.day-header--large {
        height: 200px;

        .day-header-content {
          font-weight: lighter;
          padding: 16px;
          height: 200px;
          padding-top: 46px;

          .day-header-title .day-header-title-day {
            font-size: 2.4rem;
            font-weight: 600;
          }

          .day-header-title .day-header-title-month {
            font-size: 1rem;
            text-transform: uppercase;
          }

          .day-header-event {
            font-size: 1.2rem;
            font-weight: 600;
            padding-top: 16px;
          }
        }
      }

      .day-header-bg {
        position: absolute;
        top: 166px;
        left: 55px;
        width: 27px;
        height: 27px;
        border-radius: 50%;
        will-change: transform;
        -webkit-transform: scale(1);
        transform: scale(1);

        &.primary {
          background: $primary;
        }

        &.pink {
          background: #fa3275;
        }

        &.purple {
          background: $accent;
        }

        &.green {
          background: $green;
        }

        &.animate {
          -webkit-animation: day-header-grow 0.25s 0.05s ease-in-out forwards;
          animation: day-header-grow 0.25s 0.05s ease-in-out forwards;
        }
      }

      .day-header-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 18px;
        height: 18px;
        opacity: 0;
        cursor: pointer;
        transition: opacity 0.15s ease-out;
        z-index: 4;

        svg {
          height: 20px;
          width: 20px;
          stroke: $white-smoke;
        }

        &.animate {
          opacity: 1;
        }
      }

      .day-header-content {
        position: absolute;
        display: flex;
        flex-direction: column;
        padding: 8px;
        top: 0;
        left: 0;
        width: 100%;
        height: 46px;
        color: #fff;
        z-index: 3;
        opacity: 0;
        transform: translateY(18px);

        &.animate-in {
          -webkit-animation: day-header-content-in 0.15s ease-out forwards;
          animation: day-header-content-in 0.15s ease-out forwards;
        }

        .day-header-title {
          font-weight: normal;

          .day-header-title-day,
          .day-header-title-month {
            display: inline;
            vertical-align: baseline;
          }

          .day-header-title-day {
            font-size: 18px;
          }

          .day-header-title-month {
            font-size: 18px;
          }
        }

        .day-header-event {
          padding-top: 2px;
          font-size: 12px;
          font-weight: normal;
        }
      }
    }

    .day-content {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow-y: auto;
      z-index: 0;
      opacity: 0;
      padding-top: 216px;
      padding-left: 16px;
      padding-right: 16px;
      -webkit-transform: translateY(35px);
      transform: translateY(35px);
      background: #fff;

      &.animate-in {
        -webkit-animation: day-content-animate-in 0.2s ease-out forwards;
        animation: day-content-animate-in 0.2s ease-out forwards;
      }

      .event-details-wrap {
        display: none;
        padding: 20px 0;

        &.is-active {
          display: block;
        }

        .meta-block {
          display: flex;
          justify-content: flex-start;
          align-items: center;
          margin-bottom: 10px;

          i {
            font-size: 24px;
            color: $muted-grey;
          }

          .meta {
            margin-left: 20px;

            span {
              display: block;

              &:first-child {
                font-weight: 500;
                font-size: 0.9rem;
              }

              &:nth-child(2) {
                font-size: 0.8rem;
                color: $muted-grey;
              }
            }
          }
        }

        .participants-wrap {
          padding: 16px 0;

          label {
            display: block;
            font-size: 0.9rem;
            font-weight: 500;
            margin-bottom: 6px;
          }

          .participants {
            display: flex;
            justify-content: flex-start;
            align-items: center;

            img {
              display: block;
              height: 53px;
              width: 53px;
              font-size: 0.8rem;
              border-radius: 50%;
              border: 3px solid $white;
              background: $fade-grey;

              &:not(:first-child) {
                $var: 14;

                @for $i from 1 through 6 {
                  &:nth-child(#{$i}) {
                    margin-left: -#{$var}px;
                  }
                }
              }
            }

            .is-more {
              display: flex;
              justify-content: center;
              align-items: center;
              height: 53px;
              width: 53px;
              font-weight: 500;
              font-size: 0.9rem;
              border-radius: 50%;
              border: 3px solid $white;
              background: $fade-grey;
              margin-left: -14px;
            }
          }
        }

        .event-description {
          label {
            display: block;
            font-size: 0.9rem;
            font-weight: 500;
            margin-bottom: 6px;
          }

          p {
            font-size: 0.9rem;
            color: $muted-grey;
          }
        }

        .button-wrap {
          display: flex;
          justify-content: space-between;
          align-items: center;

          .button {
            width: 49%;
          }
        }

        .img {
          margin-top: 16px;
          margin-bottom: 16px;
          width: 100%;
          height: 150px;
          background: #2c3144;
        }
      }
    }
  }
}

/* ==========================================================================
1. Widget Keyframes
========================================================================== */

@-webkit-keyframes day-header-grow {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  100% {
    -webkit-transform: scale(25);
    transform: scale(25);
  }
}

@keyframes day-header-grow {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  100% {
    -webkit-transform: scale(25);
    transform: scale(25);
  }
}

@-webkit-keyframes day-container-out {
  0% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    -webkit-transform: translateY(45px);
    transform: translateY(45px);
    opacity: 0;
  }
}

@keyframes day-container-out {
  0% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    -webkit-transform: translateY(45px);
    transform: translateY(45px);
    opacity: 0;
  }
}

@-webkit-keyframes day-header-content-in {
  0% {
    -webkit-transform: translateY(18px);
    transform: translateY(18px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes day-header-content-in {
  0% {
    -webkit-transform: translateY(18px);
    transform: translateY(18px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@-webkit-keyframes day-content-animate-in {
  0% {
    -webkit-transform: translateY(35px);
    transform: translateY(35px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes day-content-animate-in {
  0% {
    -webkit-transform: translateY(35px);
    transform: translateY(35px);
    opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
2. Media Flex Center
========================================================================== */

.media-flex-center {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;

  &:last-child,
  &.no-margin {
    margin-bottom: 0;
  }

  .flex-meta {
    margin-left: 12px;
    line-height: 1.4;

    &.is-lighter {
      span,
      > a {
        &:first-child {
          font-weight: 400;
        }
      }
    }

    &.is-light {
      span,
      > a {
        &:first-child {
          font-weight: 500;
        }
      }
    }

    span,
    > a {
      display: block;

      &:first-child {
        font-family: $font-main;
        font-size: 0.85rem;
        color: $dark-text;
        font-weight: 600;
      }

      &:nth-child(2) {
        font-family: $font;
        color: $light-text;
        font-size: 0.8rem;
      }
    }

    a:hover {
      color: $primary;
    }
  }

  .flex-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;

    .end-action {
      margin-left: 1rem;
    }
  }
}

/* ==========================================================================
3. Media Queries
========================================================================== */

@media only screen and (max-width: 767px) {
  .media-flex,
  .media-flex-center {
    &.is-responsive-mobile {
      flex-direction: column;
      text-align: center;

      .h-avatar,
      .h-icon {
        display: block;
        margin: 0 auto;
      }

      .flex-meta {
        margin: 10px auto 16px auto;
      }

      .flex-end {
        margin: 0 auto 10px auto;

        .end-action {
          margin-left: 0;
        }

        .button {
          min-width: 140px;
        }
      }
    }
  }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .media-flex,
  .media-flex-center {
    &.is-responsive-tablet-p {
      flex-direction: column;
      text-align: center;

      .h-avatar,
      .h-icon {
        display: block;
        margin: 0 auto;
      }

      .flex-meta {
        margin: 10px auto 16px auto;
      }

      .flex-end {
        margin: 0 auto 10px auto;

        .end-action {
          margin-left: 0;
        }

        .button {
          min-width: 140px;
        }
      }
    }
  }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .media-flex,
  .media-flex-center {
    &.is-responsive-tablet-l {
      flex-direction: column;
      text-align: center;

      .h-avatar,
      .h-icon {
        display: block;
        margin: 0 auto;
      }

      .flex-meta {
        margin: 10px auto 16px auto;
      }

      .flex-end {
        margin: 0 auto 10px auto;

        .end-action {
          margin-left: 0;
        }

        .button {
          min-width: 140px;
        }
      }
    }
  }

  .friend-cards-list {
    .is-friend-card {
      .friend-item {
        .text-content {
          a {
            font-size: 0.8rem !important;
          }

          span {
            font-size: 0.65rem !important;
          }
        }
      }
    }
  }
}
