// Import Swiper styles
@import "/node_modules/swiper/swiper.less";
@import "/node_modules/swiper/modules/navigation/navigation.less";
@import "/node_modules/swiper/modules/effect-coverflow/effect-coverflow.less";

/* latin */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/Inter.woff2") format("woff2");
}

@coverflow-image-height: 400px;
@2022red: #ff0e25;
@2022yellow: #ffcc49;

#year-in-music {
  // For coverflow arrow colors
  --swiper-theme-color: @blue;

  .accent {
    color: @orange;
  }
  > .row > * {
    margin-top: 2.5em;
    margin-bottom: 2.5em;
  }
  .flex > .content-card {
    min-width: 355px;
    height: auto;
  }
  .content-card {
    margin-right: 15px;
    margin-left: 15px;
    > * {
      padding: 0.6em;
    }
  }
  .listen-card {
    color: initial;
    .badge {
      line-height: 1.5em;
      margin-right: 1em;
      background-color: @blue;
      align-self: center;
    }
  }
  .scrollable-area {
    max-height: 500px;
    overflow-y: auto;
  }

  #header {
    align-items: center;
    #share-link {
      font-size: 0.7em;
    }
  }
  .graph-container {
    overflow-x: auto;
    .graph {
      min-width: min(700px, 100%);
      width: 100%;
    }
  }

  #calendar,
  #most-listened-year,
  #user-artist-map {
    > h3 {
      padding: 0.6em;
    }
    .graph-container {
      overflow: visible;
    }
  }
  #calendar .graph {
    height: 200px;
    @media (min-width: @screen-desktop) {
      height: 250px;
    }
  }
  #most-listened-year .graph {
    height: 300px;
  }

  #similar-users {
    .similar-users-list {
      margin: 0;
      padding: 0;
    }
  }

  #top-entities .listen-card.row {
    margin-right: 0;
    margin-left: 0;
  }
  #user-artist-map .graph {
    width: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    .user-artist-map {
      width: 100%;
      max-height: 70vw;
      height: auto;
      > div {
        min-height: 300px;
        max-height: 700px;
      }
    }
  }

  .swiper {
    width: 100%;
    perspective: 900px;
    background-color: whitesmoke;

    .swiper-wrapper {
      padding: 1em 0;
      align-items: center;
    }
    .swiper-slide {
      max-width: @coverflow-image-height;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      > img {
        width: inherit;
        box-shadow: 0 4px 10px 0 fade(@black, 20%);
      }
      > div {
        // center text in album title + artist name container
        text-align: center;
        margin-top: 0.5em;
      }
    }
  }

  /* "Save as image" component */
  #savable-release-component {
    width: 500px;
    .grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      align-items: center;
      justify-items: center;
      img {
        max-width: 100%;
      }
    }
  }
  .savable-card {
    width: 450px;
    display: none;
    padding: 1rem;
    box-shadow: unset !important;
    .card-img-top {
      max-width: 60%;
    }
    .card-img-bottom {
      width: 45%;
    }
    .card-footer {
      padding: 1rem;
    }
    .list-container {
      text-align: initial;
      padding: 2rem;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      .listen-card {
        box-shadow: unset !important;
        margin: 0;
        a {
          color: inherit !important;
        }
        .right-section {
          display: none;
        }
        .main-content {
          padding: 0;
          .listen-thumbnail {
            margin: 0px 10px 0px 0px;
          }
        }
      }
    }
  }

  &.yim-2022,
  &.yim-2023 {
    --swiper-theme-color: @2022red;
    /* Main header section at the top with logo */
    #main-header {
      padding: 3em 2em;
    }
    .header-image {
      padding: 1.5em;
      width: 700px;
      @media (max-width: @screen-sm) {
        min-height: 20vh;
      }
    }
    .no-yim-message {
      margin: 4vh auto;
      font-family: "Roboto", sans-serif;
      font-weight: 300;
      font-size: 24px;
      max-width: 480px;
    }
    .header {
      margin-bottom: 1em;
      text-align: center;
      font-family: "Roboto", sans-serif;
      font-weight: 700;
      font-size: 48px;
      line-height: 56px;
      @media (max-width: @screen-sm) {
        font-size: 38px;
        .subheader {
          font-size: 20px;
        }
      }
      .subheader {
        font-family: "Roboto", sans-serif;
        font-weight: 300;
        font-size: 24px;
        line-height: 28px;
        text-align: center;
      }
    }
    .link-section {
      padding: 0 1em;
      text-align: center;
      font-family: "Roboto", sans-serif;
      font-weight: 300;
      font-size: 1.6em;
    }
    .button {
      width: 2em;
      height: 2em;
      border-radius: 3px;
    }
    .yim-share-button-container {
      text-align: center;
      margin-top: 2em;
      margin-bottom: 2em;
    }
    .yim-share-button {
      border: none;
      width: 2.2em;
      height: 2.2em;
    }
    .flex > .content-card {
      min-width: 300px;
      height: auto;
    }
    .cover-art-mosaic {
      width: 100vw;
      max-height: 42em;
    }
    .content-card .img-header {
      max-height: 17em;
      padding: 2.5rem;
    }

    .small-cards-container {
      margin-top: 1.5em;
      > * {
        min-width: calc(100vw - 60px);
        margin-bottom: 1em;
        font-family: "Roboto", sans-serif;
        font-weight: 300;
        font-size: 24px;
        line-height: 1.3;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
    .cover-art-composite {
      padding-left: 0;
      padding-right: 0;
      .composite-image img {
        width: 100%;
        content-visibility: auto;
      }
    }
    .closing-remarks {
      padding: 3em 2em;
      font-size: 1.3em;
      color: @white;
      font-family: "Roboto", sans-serif;
      font-weight: 200;
      text-align: center;
      .bold {
        font-weight: 400;
      }
      a,
      a:visited,
      a:hover {
        color: inherit;
        text-decoration: underline;
        font-weight: 300;
      }
    }

    .share-modal .modal-body {
      overflow-x: auto;
    }
    .alert {
      margin: 0;
      padding: 2em;
    }
  }

  /* Styles specific to YIM 2022 */
  &.yim-2022 {
    --swiper-theme-color: @2022red;
    /* Main header section at the top with logo */
    #main-header {
      background: white;
      flex-direction: column;
      @media (max-width: @screen-sm) {
        // 80% of screen height minus menu bar and BrainzPlayer
        height: calc(80vh - 84px - 60px);
        .arrow-down {
          display: initial;
        }
      }
      .arrow-down {
        @media (min-width: @screen-sm) {
          display: none;
        }
        width: 0;
        height: 0;
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-top: 12px solid;
        border-top-color: @2022red;
      }
    }
    .header-image {
      padding: 1.5em;
      width: 700px;
      @media (max-width: @screen-sm) {
        min-height: 20vh;
      }
    }
    .link-section {
      color: @2022yellow;
      > div {
        max-width: 500px;
      }
      .input-group {
        margin-top: 0.7em;
      }
    }
    .red-section,
    .yellow-section {
      padding-top: 3em;
      padding-bottom: 3em;
      width: 100%;
    }
    .red-section {
      background-color: @2022red;
      &::after,
      &::before {
        background: @2022red;
      }
      .header,
      .no-data {
        color: @2022yellow;
      }
      .yim-share-button {
        color: @2022red;
        background-color: @2022yellow;
      }
    }
    .yellow-section {
      background-color: @2022yellow;
      &::after,
      &::before {
        background: @2022yellow;
      }
      .header,
      .no-data {
        color: @2022red;
      }
      .yim-share-button {
        color: @2022yellow;
        background-color: @2022red;
      }
    }
    .thanks-kc-green {
      font-weight: 300;
      color: @white;
      font-size: smaller;
      text-align: center;
    }
    .scrollable-area {
      box-shadow: inset 0px 11px 8px -10px #ccc;
    }
  }
  &.yim-2023 {
    --selectedColor: #4c6c52;
    --swiper-navigation-color: var(--selectedColor);
    @cream: #f0eee2;
    @text-color: @cream;
    @content-background-color: #e0e5de;
    background-color: @cream;
    color: var(--selectedColor);
    .btn {
      border-radius: 5px;
    }
    #main-header {
      background: unset;
      text-align: center;
      .header-image {
        width: 500px;
        margin: 3em 0;
      }
    }
    #discovery-playlist,
    #missed-playlist {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .heading .img-header {
        max-width: 450px;
        max-width: min(80%, 450px);
      }
    }
    #overview object {
      max-width: min(500px, 90%);
      height: auto;
    }
    #buddies {
      display: flex;
      justify-items: center;
      align-items: center;
      .card-container {
        flex: 1;
        scroll-snap-type: x mandatory;
      }
      .buddy {
        scroll-snap-align: start;
        text-align: center;
        max-width: fit-content;
        .value {
          overflow-wrap: anywhere;
          font-size: 1.5em;
        }
        .img-container {
          display: flex;
          width: 270px;
          height: 270px;
          flex-direction: row;
          justify-content: center;
          align-items: center;
        }
      }
    }
    .link-section {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      gap: 0.5em;
      input.form-control {
        height: 2em;
      }
    }
    .header .subheader {
      margin-top: 1rem;
    }
    .yim-share-button,
    .btn-info {
      color: @text-color;
      background-color: fade(@black, 60%);
      &:hover {
        background-color: fade(@black, 40%);
      }
    }
    .lb-follow-button {
      border: none;
    }
    .user-name {
      line-break: anywhere;
    }
    .user-name,
    .hashtag {
      text-transform: uppercase;
      letter-spacing: 1em;
      font-size: 2em;
      font-weight: 900;
      font-family: "Inter", "Roboto", sans-serif;
      text-align: center;
      @media (max-width: @screen-sm) {
        letter-spacing: 1rem;
      }
    }
    .color-picker {
      position: relative;
      gap: 1em;
      padding: 2rem;
      display: inline-flex;
      justify-content: center;
      margin: auto;
      .pick-color-caption {
        position: absolute;
        left: max(-15vw, -180px);
        top: -15px;
      }
      .color-selector {
        width: 2em;
        height: 2em;
        border-radius: 50%;
      }
    }
    .content-card {
      color: @cream;
      background-color: var(--selectedColor);
      padding: 1em;
      .heading {
        min-height: 300px;
        font-family: "Roboto", sans-serif;
        font-weight: 700;
        font-size: 48px;
        line-height: 56px;
        color: @cream;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        aspect-ratio: 1;
        .img-header {
          padding: 0.5rem;
          margin-bottom: auto;
          margin-top: auto;
          width: 100%;
          max-width: 400px;
          max-width: min(60%, 400px);
          min-width: 200px;
        }
        @media (max-width: @screen-sm) {
          font-size: 38px;
        }
      }
      h3,
      h4 {
        a {
          color: inherit;
          font-weight: initial;
        }
        color: inherit;
      }
    }
    .graph-container {
      border-radius: 8px;
      overflow: hidden;
      .graph {
        color: var(--selectedColor);
        overflow-x: auto;
        overflow-y: hidden;
        > * {
          min-width: 550px;
        }
      }
    }
    .swiper,
    .similar-users-list,
    .graph-container {
      background-color: @content-background-color;
    }
    .masked-image {
      display: inline-block;
      background-color: var(--selectedColor);
      mask-size: 98%; /* edges might get cut off if you use 100% */
      mask-repeat: no-repeat;
      mask-position: center;
      -webkit-mask-size: 98%; /* edges might get cut off if you use 100% */
      -webkit-mask-repeat: no-repeat;
      -webkit-mask-position: center;
      > img {
        opacity: 0;
        display: block;
      }
    }
    .section {
      margin-top: 4em;
      margin-bottom: 2em;
    }
    .closing-remarks {
      color: var(--selectedColor);
    }
    .small-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 3em;
      padding: 3em;
      > .small-stat {
        flex: 1 max(28%, 200px);
      }
    }
    .small-stat {
      color: @text-color;
      font-size: 1.8rem;
      text-align: center;
      font-weight: lighter;
      font-family: "Roboto", sans-serif;
      .value {
        position: relative;
        font-size: 2.3em;
        font-weight: 600;
        line-height: 1.5;
        margin-bottom: 0.2em;
        &:not(:last-child)::after {
          content: "";
          position: absolute;
          bottom: 0;
          left: calc(50% - 1.5em);
          width: 3em;
          height: 1px;
          border-bottom: 1px solid @cream;
        }
      }
    }
    .scrollable-area {
      position: relative;
      &::after {
        content: " ";
        width: 100%;
        position: sticky;
        display: block;
        bottom: -10px;
        height: 50px;
        background: linear-gradient(0deg, var(--selectedColor), transparent);
      }
    }
  }
}
