/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* MEMO: tile coloring */
.blue-100 {
  background-color: #c6dafc;
}

.blue-300 {
  background-color: #31425B;
  color: #FFFFFF;
}

.red-100 {
  background-color: #E61D62;
}

.red-300 {
  background-color: #A41251;
  color: #FFFFFF;
}

.purple-100 {
  background-color: #B11972;
}

.purple-300 {
  background-color: #72185F;
  color: #FFFFFF;
}

.vivid-100 {
  background-color: #ae4b6b;
}

.vivid-300 {
  background-color: #9A1E46;
  color: #FFFFFF;
}

.mulberry-100 {
  background-color: #734642;
}

.mulberry-300 {
  background-color: #501813;
  color: #FFFFFF;
}

.yellow-100 {
  background-color: #fce8b2;
}

.yellow-300 {
  background-color: #D9BF00;
  color: #000000;
}

.sap-100 {
  background-color: #6f955d;
}

.sap-300 {
  background-color: #4C7B35;
  color: #FFFFFF;
}

.jagular-100 {
  background-color: #535359;
}

.jagular-300 {
  background-color: #292830;
  color: #FFFFFF;
}

.athens-100 {
  background-color: #e5e5e5;
}

.athens-300 {
  background-color: #DFDFDF;
  color: #000000;
}

.egyptian-blue-100 {
  background-color: #4367b6;
}

.egyptian-blue-300 {
  background-color: #1441A4;
  color: #FFFFFF;
}

.william-100 {
  background-color: #638690;
}

.william-300 {
  background-color: #3C6875;
  color: #FFFFFF;
}

.charcoal-100 {
  background-color: #5b6970;
}

.charcoal-300 {
  background-color: #32444D;
  color: #FFFFFF;
}

/* MEMO: fab color */
.green-100 {
  background-color: #b7e1cd;
}
.green-300 {
  background-color: #57bb8a;
}
.jackson-300 {
  background-color: #383C80;
  color: #FFFFFF;
}
.portrage-300 {
  background-color: #8AA2D6;
  color: #FFFFFF;
}
.yuna-yellow {
  background-color: #FFEA01;
  color: #000000;
}
.ellie-blue {
  background-color: #03E5FF;
  color: #000000;
}
.pharrell-fab {
  background-color: #212121;
  color: #FFFFFF;
}

.neon-animated-pages {
  height: 100vh;
  position: relative;
}

body {
  overflow: hidden;
}

/* MEMO: animated grid */
.animated-grid {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

.tile {
  float: left;
  width: calc(100% / 6);
  height: calc(100% / 3);
  position: relative;
  box-sizing: border-box;
  border: 2px solid black;

  /**
   * Display the middle of the album art unless we
   * can guarantee background -> contain will look
   * better.
   */
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50%;
}

.tile * {
  pointer-events: none;
}

.tile:nth-of-type(1) {
  width: calc(100% / 3);
  height: calc(100% / 3 * 2);
}

.tile:nth-of-type(6) {
  width: calc(100% / 3);
  height: calc(100% / 3 * 2);
}

.tile:nth-of-type(9) {
  position: absolute;
  top: calc(100% / 3 * 2);
  left: 0;
  width: calc(100% / 6);
  height: calc(100% / 3);
}

.tile:nth-of-type(10) {
  position: absolute;
  top: calc(100% / 3 * 2);
  left: calc(100% / 6);
  width: calc(100% / 6);
  height: calc(100% / 3);
}

.footer {
  box-sizing: border-box;
  padding: 16px;
  font-size: 16px;
  width: 100%;
  bottom: 0;
  position: absolute;
}

.footer .album, .footer .artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile .artist {
  font-weight: 300;
  font-size: 14px;
  line-height: 19px;
}

/* TODO: no good effect so blocked for now */
/* @media (min-width: 1288px) {
  There's enough vert/horz space for artwork to use contain
  .album-tile {
    background-size: contain;
    background-position: initial;
  }

  For tiles that still don't work well on contain, revert to cover
  .album-tile:nth-of-type(1), .album-tile:nth-of-type(7), .album-tile:nth-of-type(6) {
    background-size: cover;
    background-position: 50%;
  }
} */
@media (max-width: 640px) {
  .tile,
  .tile:nth-of-type(n) {
    left: unset;
    top: unset;
    width: calc(100% / 2);
    height: calc(100% / 3);
    position: relative;
  }
}

/* MEMO: fullsize page with card */
.neon-animated-pages > .fullsize-page-with-card.iron-selected {
  display: block;
}

.neon-animated-pages > .fullsize-page-with-card {
  display: none;
}

.fullsize-page-with-card #color-background, .fullsize-page-with-card #image-background {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
}

.fullsize-page-with-card #image-background {
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.fullsize-page-with-card #card {
  pointer-events: none;
  position: relative;
  margin: 250px 275px 0;
  min-height: 700px;
}

.fade {
  -webkit-animation: fadein 2s;
  -moz-animation: fadein 2s;
  -ms-animation: fadein 2s;
  -o-animation: fadein 2s;
  animation: fadein 2s;
}

@keyframes fadein {
  from {opacity: 0;}
  to   {opacity: 1;}
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
  from {opacity: 0;}
  to   {opacity: 1;}
}

/* Internet Explorer */
@-ms-keyframes fadein {
  from {opacity: 0;}
  to   {opacity: 1;}
}

#card .container {
  display: flex;
  user-select: none;
}

.album-art {
  width: 360px;
  min-height: 360px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.album-name {
  display: block;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  font-size: 40px;
  font-weight: 300;
}

.artist-name {
  display: block;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  font-size: 20px;
  font-weight: 300;
}

.album-details {
  display: flex;
  flex-direction: column;
  position: relative;
}

.album-details .favorite-star {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 16px;
}

.album-details .album-text {
  flex-grow: 1;
  text-align: left;
  margin-left: 40px;
}

#lowerbar {
  position: relative;
  padding-top: 15px;
  padding-bottom: 15px;
}

.music-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 360px;
  margin: 0 auto;
  padding: 0 16px;
}

.music-control svg {
  width: 24px;
  fill: #FFFFFF
}

#fab {
  display: flex;
  justify-content: center;
  align-items: center;

  position: absolute;
  top: 0;
  right: 30px;
  transform: translate(0, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transition: all 0.1s ease-in-out;
}

#fab:hover {
  cursor: pointer;
  transform: scale(1.05);
}

@media (min-width: 640px) {
  .album-details {
    flex: 1;
    min-width: 0;
  }

  .album-details .album-text {
    padding: 60px 60px 60px 0;
  }
}

@media (max-width: 1288px) {
  .fullsize-page-with-card #card {
    margin: 0;
  }
}

@media (max-width: 640px) {
  #card .container {
    flex-direction: column;
  }

  .album-art {
    width: 100%;
    height: 100vw;
  }

  .album-details .album-text {
    margin-top: 10px;
    margin-left: 25px;
    min-height: 90px;
  }

  .album-name {
    font-size: 30px;
  }

  .artist-name {
    font-size: 20px;
  }

  .music-control {
    padding: 0 48px;
  }

  #fab {
    width: 48px;
    height: 48px;
    right: 12px;
  }
}

/* MEMO: album list */
.album-list {
  background: #FFFFFF;
  height: 100%;
  color: black;
  padding: 10px;
  font-size: 20px;
}

.album-list table {
  width: 100%;
}

.album-list td:nth-child(1) {
  width: 10%;
  text-align: left;
  color: #ADADAD;
}

.album-list td:nth-child(2) {
  width: 60%;
  text-align: left;
}

.album-list td:nth-child(3) {
  width: 20%;
  text-align: right;
  color: #ADADAD;
}
