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

/* ==========================================================================
Card styles
========================================================================== */

/*
    1. Main Extendable Class
*/

/* ==========================================================================
1. Main Extendable Class
========================================================================== */

.card {
  position: relative;
  margin-bottom: 1.5rem;
  border: 1px solid $fade-grey;
  background: $white;
  border-radius: 0.85rem;
  box-shadow: none;

  .card-heading {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 16px;

    .dropdown {
      margin-left: auto;

      .button {
        padding: 0;
        background: none;
        border: none;

        svg {
          stroke: $grey-text;
        }
      }

      &.is-light {
        svg {
          stroke: $white;
        }
      }
    }

    &.is-bordered {
      border-bottom: 1px solid $fade-grey;

      h4 {
        font-size: 0.9rem;
        color: $medium-text;
        font-weight: 400;
      }
    }
  }

  .card-body {
    padding: 10px 16px;

    &.no-padding {
      padding: 0;
    }
  }

  .card-footer {
    margin: 8px 16px 16px 16px;
    border-top: 1px solid $fade-grey;
  }

  &.is-weather-card {
    background-color: $accent;
    background-color: -webkit-linear-gradient(to right, #c2e9fb, #a1c4fd);
    background-color: linear-gradient(to right, #c2e9fb, #a1c4fd);

    .card-heading {
      .dropdown.is-spaced > div {
        .button:hover {
          background: darken($accent, 12%) !important;
        }
      }
    }

    .card-body {
      padding-top: 0;
    }

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

      span {
        position: relative;
        display: block;
        font-size: 2.6rem;
        font-weight: 500;
        color: $white;

        &:after {
          content: '';
          position: absolute;
          top: 10px;
          right: -18px;
          height: 14px;
          width: 14px;
          border: 2px solid $white;
          border-radius: 50%;
        }
      }
    }

    .weather-icon {
      display: flex;
      justify-content: center;
      align-items: center;

      div {
        text-align: center;
      }

      h4 {
        font-size: 1.4rem;
        color: $white;
      }

      svg {
        stroke: $white;
        height: 2.8rem;
        width: 2.8rem;
      }

      .details {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.85rem;
        color: $white;

        span {
          display: block;
          margin: 0 10px;
        }
      }
    }

    .previsions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.2);
      padding: 15px;
      margin: 20px 0;

      .day {
        text-align: center;
        font-size: 0.7rem;
        color: $white;

        * {
          display: block;
        }

        span:first-child {
          text-transform: uppercase;
          font-size: 0.6rem;
          font-weight: 500;
        }

        svg {
          margin: 3px auto;
          height: 18px;
          width: 18px;
        }
      }
    }

    .current-date-location {
      margin-bottom: 20px;

      span {
        display: block;
        color: $white;
      }

      .date {
        font-size: 1.1rem;
        font-weight: 500;
      }

      .location {
        font-size: 0.8rem;

        svg {
          height: 16px;
          width: 16px;
        }
      }
    }
  }

  &.is-birthday-card {
    background-color: lighten($secondary, 1%);

    .card-heading {
      padding: 16px 16px 0 16px;

      .dropdown.is-spaced > div {
        .button:hover {
          background: darken($secondary, 24%) !important;
        }
      }

      > svg {
        stroke: $white;
      }
    }

    .card-body {
      padding: 16px;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 290px;

      .birthday-avatar {
        position: relative;
        width: 45px;
        margin: 0 auto 16px auto;

        img {
          display: block;
          height: 45px;
          width: 45px;
          border-radius: 50%;
        }

        .birthday-indicator {
          position: absolute;
          top: -6px;
          right: -14px;
          display: flex;
          justify-content: center;
          align-items: center;
          height: 26px;
          width: 26px;
          border-radius: 50%;
          border: 2px solid lighten($secondary, 1%);
          font-size: 0.7rem;
          color: $white;
          font-weight: 500;
          background: $sidebar;
        }
      }

      .birthday-content {
        text-align: center;
        color: $white;

        h4 {
          font-weight: 500;
        }

        p {
          font-size: 0.9rem;
        }

        button {
          line-height: 0;
          margin: 16px 0;
        }
      }
    }
  }

  &.is-new-job-card {
    background-color: lighten($primary, 1%);

    .card-heading {
      padding: 16px 16px 0 16px;

      .dropdown.is-spaced > div {
        .button:hover {
          background: darken($primary, 12%) !important;
        }
      }

      > svg {
        stroke: $white;
      }
    }

    .card-body {
      padding: 16px;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 290px;

      .job-avatar {
        position: relative;
        width: 45px;
        margin: 0 auto 16px auto;

        img {
          display: block;
          height: 45px;
          width: 45px;
          border-radius: 50%;
        }
      }

      .job-content {
        text-align: center;
        color: $white;

        h4 {
          font-weight: 500;
        }

        p {
          font-size: 0.9rem;
        }

        button {
          line-height: 0;
          margin: 16px 0;
        }
      }
    }
  }

  &.is-ad {
    .card-body {
      position: relative;
      display: flex !important;
      align-items: center;
      padding: 14px;

      img {
        display: block;
        max-width: 50% !important;
        flex-shrink: 2;
      }

      .ad-text {
        padding-left: 10px;
        font-size: 0.85rem;
        font-weight: 500;
        margin-top: -20px;
      }

      .ad-brand {
        position: absolute;
        bottom: 12px;
        right: 14px;
        text-transform: uppercase;
        font-size: 0.65rem;
        color: $muted-grey;
      }
    }
  }
}

body {
  &.is-dark {
    .card:not(.is-new-job-card):not(.is-weather-card):not(.is-birthday-card) {
      border-color: lighten($dark, 4%);
      background: $dark;
    }

    .card {
      &.is-weather-card,
      &.is-new-job-card {
        border-color: $primary;
      }

      &.is-birthday-card {
        border-color: $secondary;
      }

      .card-heading {
        &.is-bordered {
          border-color: lighten($dark, 12%);
        }

        h4 {
          color: $white-light;
        }
      }

      .card-body {
        .ad-text {
          color: $white-light;
        }

        .page-block,
        .story-block,
        .add-friend-block {
          border-color: lighten($dark, 12%);

          .page-meta,
          .story-meta {
            span {
              &:first-child {
                color: $white-light;
              }

              &:nth-child(2) {
                color: lighten($medium-text, 10%);
              }
            }
          }

          .add-page,
          .add-friend {
            &:hover {
              background: lighten($dark, 8%);
            }
          }
        }
      }
    }
  }
}
