:root {
  --primary-color: #ad421b;
  --secondary-color: #ad421bcc;
  --text-color: #333;
  --sub-text-color: #555;
  --control-btn-color: #383838;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

@keyframes playlistSlideRight {
  from {
    opacity: 0;
    transform: translateX(0);
  }
  to {
    opacity: 1;
    transform: translateX(56%);
  }
}

@keyframes playlistSlideLeft {
  from {
    opacity: 1;
    transform: translateX(56%);
  }
  to {
    opacity: 0;
    transform: translateX(0);
  }
}

@keyframes dashboardSlideRight {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes dashboardSlideLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes loader {
  0% {
    transform: scaleY(0.1);
    background: var(--primary-color);
  }
  50% {
    transform: scaleY(1);
    background: #ffab4c;
  }
  100% {
    transform: scaleY(0.1);
    background: transparent;
  }
}

.preloader {
  background: linear-gradient(to top, #001c30, #2d4356);
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  opacity: 1;
  z-index: 100;
  transition: opacity 0.5s linear;
}
.preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
}

.bar {
  width: 30px;
  height: 120px;
  display: inline-block;
  transform-origin: bottom center;
  border-top-right-radius: 20px;
  border-top-left-radius: 20px;
  animation: loader 2s ease-in-out infinite;
  animation-play-state: running;
}
.bar.pause {
  animation-play-state: paused;
}

.bar1 {
  animation-delay: 0.1s;
}
.bar2 {
  animation-delay: 0.2s;
}
.bar3 {
  animation-delay: 0.3s;
}
.bar4 {
  animation-delay: 0.4s;
}
.bar5 {
  animation-delay: 0.5s;
}
.bar6 {
  animation-delay: 0.6s;
}
.bar7 {
  animation-delay: 0.7s;
}
.bar8 {
  animation-delay: 0.8s;
}
.bar9 {
  animation-delay: 0.9s;
}
.bar10 {
  animation-delay: 1s;
}
.bar11 {
  animation-delay: 1.1s;
}
.bar12 {
  animation-delay: 1.2s;
}
.bar13 {
  animation-delay: 1.3s;
}
.bar14 {
  animation-delay: 1.4s;
}
.bar15 {
  animation-delay: 1.5s;
}
.bar16 {
  animation-delay: 1.6s;
}
.bar17 {
  animation-delay: 1.7s;
}
.bar18 {
  animation-delay: 1.8s;
}
.bar19 {
  animation-delay: 1.9s;
}
.bar20 {
  animation-delay: 2s;
}

.background-video {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.background-video #video {
  position: fixed;
  object-fit: cover;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.player {
  width: 100%;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  z-index: 0;
}
.player .icon-pause {
  display: none;
}

.player.playing .icon-pause {
  display: inline-block;
}

.player.playing .icon-play {
  display: none;
}

.dashboard {
  position: absolute;
  width: 350px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  border: 3px solid rgba(255, 255, 255, 0.3);
  animation: dashboardSlideRight 0.5s ease;
  z-index: -1;
}

.dashboard.non-active {
  animation: none;
}

.dashboard.active {
  transform: translateX(-50%);
  animation: dashboardSlideLeft 0.5s ease;
}

.playlist-btn,
.tip-btn {
  display: flex;
  font-size: 20px;
  color: var(--control-btn-color);
  position: absolute;
  transition: transform 0.1s linear;
}

.playlist-btn {
  right: 18px;
  cursor: pointer;
}

.tip-btn {
  left: 18px;
}

.tip-btn:hover {
  color: var(--primary-color);
}

.tip-text {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 5px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  position: absolute;
  bottom: 130%;
  padding: 5px 10px;
  font-size: 10px;
  opacity: 0;
  transition: all 0.5s;
  color: var(--text-color);
}
.tip-text b {
  color: var(--primary-color);
}
.tip-btn:hover .tip-text {
  opacity: 1;
  transform: translateY(-10px);
}

.playlist-btn:hover,
.tip-btn:hover {
  transform: scale(1.2, 1.2);
}
.playlist-btn:active {
  color: var(--primary-color);
}
.playlist-btn.active {
  color: var(--primary-color);
}

/* HEADER */
header {
  text-align: center;
  margin-bottom: 10px;
}

header h4 {
  color: var(--primary-color);
  font-size: 14px;
}

header h2 {
  color: var(--text-color);
  font-size: 18px;
}

header p {
  color: var(--sub-text-color);
  font-size: 14px;
}

/* CD */
.cd {
  display: flex;
  margin: auto;
  width: 200px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  border: 8px solid rgba(255, 255, 255, 0.3);
}

.cd-thumb {
  width: 100%;
  padding-top: 100%;
  border-radius: 50%;
  background-color: #333;
  background-size: cover;
  margin: auto;
}

/* CONTROL */
.control {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 4px 0;
}

.control .btn {
  color: var(--control-btn-color);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.1s linear;
}
.control .btn:hover {
  transform: scale(1.2, 1.2);
}
.control .btn:active {
  color: var(--primary-color);
}

.control .btn.active {
  color: var(--primary-color);
}

.control .btn-toggle-play {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  color: #f7f5eb;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
}

.volume-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}
.progress-bar {
  width: 100%;
  padding: 0 16px;
}
.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  align-items: center;
}

.progress,
.volume {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
  overflow: hidden;
}
.progress {
  width: 100%;
}
.volume {
  width: 50%;
}

.progress::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 16px;
  width: 12px;
  height: 12px;
  background-color: var(--primary-color);
  box-shadow: -200px 50px 0px 195px var(--secondary-color);
}

.volume-icon,
.mute-icon {
  font-size: 20px;
  margin-right: 5px;
  display: none;
  cursor: pointer;
  color: var(--control-btn-color);
  transition: transform 0.1s linear;
}
.volume-icon:hover,
.mute-icon:hover {
  transform: scale(1.2, 1.2);
}

.mute-icon {
  color: var(--primary-color);
}
.block {
  display: block;
}

/* PLAYLIST */
.playlist {
  position: absolute;
  overflow-y: overlay;
  opacity: 0;
  z-index: -2;
  width: 370px;
  height: 450px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 3px solid rgba(255, 255, 255, 0.3);
  animation: playlistSlideLeft 0.5s ease;
}

.playlist.non-active {
  animation: none;
}

.playlist.active {
  opacity: 1;
  transform: translateX(56%);
  animation: playlistSlideRight 0.5s ease;
}

.song {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.song.active {
  background-color: var(--secondary-color);
}

.song:active {
  opacity: 0.8;
}

.song.active .option,
.song.active .author,
.song.active .title {
  color: #fff;
}

.song .thumb {
  width: 50px;
  height: 50px;
  border-radius: 5px;
  background-size: cover;
  margin: 0 8px;
}

.song .body {
  flex: 1;
  padding: 0 8px;
}

.song .title {
  font-size: 14px;
  color: var(--text-color);
}

.song .author {
  font-size: 12px;
  color: var(--sub-text-color);
}

/* .song .option {
  padding: 16px 8px;
  color: var(--sub-text-color);
  font-size: 12px;
} */

/* Scrollbar css */
html *::-webkit-scrollbar {
  border-radius: 0;
  width: 8px;
}

html *::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: var(--secondary-color);
}

html *::-webkit-scrollbar-track {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.3);
}
