/* src/styles/app.scss */
:root {
  --bg-color: #121212;
  --sidebar-bg: #1c1c1e;
  --player-bg: rgba(28, 28, 30, 0.85);
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --accent-color: #fa243c;
  --hover-bg: #2c2c2e;
  --border-color: #38383a;
  --font-family:
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  --cover-1-bg-img:
    linear-gradient(
      135deg,
      #ff7e5f,
      #feb47b);
  --cover-2-bg-img:
    linear-gradient(
      135deg,
      #00c6ff,
      #0072ff);
  --cover-3-bg-img:
    linear-gradient(
      135deg,
      #f7971e,
      #ffd200);
  --cover-4-bg-img:
    linear-gradient(
      135deg,
      #11998e,
      #38ef7d);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden;
}
.app-container {
  display: flex;
  height: calc(100vh - 80px);
}
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  padding: 20px 15px;
  overflow-y: auto;
}
.sidebar-top {
  align-items: baseline;
  display: grid;
  grid-template-columns: 1fr auto;
}
.logo {
  font-size: 20px;
  font-weight: bold;
  line-height: 1em;
  margin-top: 5px;
  margin-bottom: 30px;
  padding-left: 10px;
}
.logo svg {
  fill: var(--accent-color);
  height: 1em;
  margin: 0 0.3em;
  vertical-align: top;
  width: 1em;
}
.nav-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin: 20px 0 10px 10px;
  letter-spacing: 0.5px;
}
.nav-menu ul {
  list-style: none;
}
.nav-menu li a {
  display: block;
  padding: 8px 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  margin-bottom: 2px;
  transition: background 0.2s ease;
}
.nav-menu li a:hover {
  background-color: var(--hover-bg);
}
.nav-menu li a.active {
  background-color: var(--hover-bg);
  color: var(--accent-color);
  font-weight: 500;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px;
  padding-bottom: 100px;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: -20px -40px 30px -40px;
  padding: 20px 40px;
  transform: translate(-10px, -20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.history-back {
  cursor: pointer;
  font-size: 32px;
  line-height: 1em;
  width: 1em;
  height: 1em;
  opacity: 0.9;
}
.history-back.disabled {
  opacity: 0.1;
  cursor: auto;
}
.sidebar-toggle,
.sidebar-close {
  display: none;
  cursor: pointer;
  font-size: 32px;
  line-height: 1em;
  width: 1em;
  height: 1em;
  opacity: 0.9;
}
.sidebar-toggle svg {
  width: 1.2em;
  height: 1.2em;
  fill: var(--accent-color);
  margin-top: -0.1em;
  margin-left: -0.1em;
}
.sidebar.open .sidebar-close {
  display: block;
  font-size: 24px;
}
.search-bar {
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  width: 250px;
  font-size: 14px;
  outline: none;
  margin: 0 1em;
}
.search-bar:focus {
  border-color: var(--accent-color);
}
.menu-icon {
  cursor: pointer;
  font-size: 32px;
  line-height: 1em;
  width: 1em;
  height: 1em;
}
.profile-icon {
  width: 32px;
  height: 32px;
  background-color: var(--text-secondary);
  border-radius: 50%;
}
.section-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.artist-albums-header {
  margin-bottom: 20px;
}
.album-tracks-section {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 140px 1fr;
  padding-bottom: 10px;
}
.album-tracks-section .section-title {
  border-bottom: 0;
  margin-bottom: 0;
}
.album-tracks-section .album-info {
  color: var(--text-secondary);
  font-size: 18px;
}
.album-tracks-section .album-info a {
  color: inherit;
}
.album-tracks-section .album-cover,
.album-tracks-section .playlist-cover,
.album-tracks-section .artist-image {
  width: 120px;
}
.view-section {
  margin-bottom: 40px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}
.album-card {
  cursor: pointer;
  transition: transform 0.2s ease;
}
.album-card:hover {
  transform: scale(1.02);
}
.album-cover,
.playlist-cover {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 8px;
  background-color: #333;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center;
}
.playlist-cover {
  background-image:
    var(--cover-1-bg-img),
    var(--cover-2-bg-img),
    var(--cover-3-bg-img),
    var(--cover-4-bg-img);
  background-position:
    top left,
    top right,
    bottom left,
    bottom right;
  background-size: 50% 50% !important;
  background-repeat: no-repeat !important;
}
.album-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-artist {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 30px 20px;
}
.artist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.artist-card:hover {
  transform: scale(1.03);
}
.artist-image {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background-color: #222;
  margin-bottom: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center;
}
.artist-name {
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-albums {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.artist-1 {
  background:
    linear-gradient(
      135deg,
      #8A2387,
      #E94057,
      #F27121);
}
.artist-2 {
  background:
    linear-gradient(
      135deg,
      #4CB8C4,
      #3CD3AD);
}
.artist-3 {
  background:
    linear-gradient(
      135deg,
      #1f4037,
      #99f2c8);
}
.artist-4 {
  background:
    linear-gradient(
      135deg,
      #f12711,
      #f5af19);
}
.artist-5 {
  background:
    linear-gradient(
      135deg,
      #654ea3,
      #eaafc8);
}
.artist-6 {
  background:
    linear-gradient(
      135deg,
      #FF416C,
      #FF4B2B);
}
.track-list {
  display: flex;
  flex-direction: column;
}
.track-item {
  display: grid;
  grid-template-columns: 2fr 1fr 50px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  border-radius: 6px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.track-item:hover {
  background-color: var(--hover-bg);
}
.track-info {
  display: flex;
  align-items: center;
  gap: 15px;
}
.track-number {
  color: var(--text-secondary);
  font-size: 14px;
  width: 20px;
  text-align: right;
}
.track-cover {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background-color: #555;
  background-size: cover;
}
.track-name {
  font-size: 14px;
  font-weight: 500;
}
.track-artist,
.track-album {
  font-size: 13px;
  color: var(--text-secondary);
}
.track-time {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
}
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: var(--player-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}
.now-playing {
  display: flex;
  align-items: center;
  position: relative;
  gap: 15px;
  width: 25%;
}
.now-playing-cover {
  aspect-ratio: 1;
  width: 48px;
  height: 48px;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  border-radius: 4px;
}
.now-playing-cover svg {
  fill: var(--text-secondary);
}
.now-playing-title {
  font-size: 14px;
  font-weight: 500;
}
.now-playing-artist {
  font-size: 12px;
  color: var(--text-secondary);
}
.now-playing-popoup-open {
  display: none;
}
.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50%;
}
.control-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}
.airplay-btn {
  fill: var(--text-secondary);
  width: 1em;
  height: 1em;
  padding: 0 !important;
}
.play-btn {
  font-size: 32px;
  min-width: 1em;
}
.progress-container {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 500px;
  gap: 10px;
}
.time-current,
.time-total {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 3em;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  cursor: pointer;
}
.progress-fill {
  width: 0;
  height: 100%;
  background-color: var(--text-primary);
  border-radius: 2px;
}
.volume-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 25%;
  justify-content: flex-end;
}
.queue-controls {
  margin-right: 20px;
}
.queue-controls .btn-icon.disabled {
  cursor: default;
  opacity: 0.1;
}
.queue-controls .btn-icon.active {
  color: var(--accent-color);
}
.volume-bar {
  width: 100px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
}
.volume-fill {
  width: 60%;
  height: 100%;
  background-color: var(--text-primary);
  border-radius: 2px;
}
.popup-panel {
  position: fixed;
  background-color: var(--bg-color);
  color: var(--text-primary);
  z-index: 90;
  overflow-y: auto;
  transform: translateY(120%);
  transition: transform 0.1s ease-in-out;
  border: 1px var(--border-color) solid;
  box-shadow: 0 0 1em #000;
  left: auto;
  height: calc(100vh - 80px);
  max-width: 30vw;
  padding: 0 10px 10px 10px;
  right: 0;
  top: 0;
}
.popup-panel.open {
  transform: translateY(0);
}
.popup-panel .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px env(safe-area-inset-right) 10px env(safe-area-inset-left);
  padding-top: calc(15px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  min-height: 55px;
  cursor: pointer;
}
.popup-panel .header-title {
  font-weight: bold;
}
.popup-panel .header-close {
  position: absolute;
  right: 1em;
}
.popup-panel .queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.popup-panel .track-item.queue-item {
  grid-template-columns: 1fr 30px;
  padding: 10px;
  gap: 10px;
  border: none;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.03);
}
.popup-panel .track-item.queue-item:active {
  background-color: var(--hover-bg);
}
.popup-panel .track-info {
  gap: 10px;
}
.popup-panel .track-cover {
  width: 45px;
  height: 45px;
  border-radius: 6px;
}
.popup-panel .track-name {
  font-size: 14px;
}
.popup-panel .track-artist {
  font-size: 12px;
}
.popup-panel .reorder-handle {
  font-size: 22px;
  color: var(--text-secondary);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-panel .subsection-title {
  display: none;
}
.popup-options-section,
.popup-controls-section,
.popup-progress-section,
.popup-cover-section,
.popup-header .header-track-info {
  display: none;
}
.cover-1 {
  background: var(--cover-1-bg-img);
}
.cover-2 {
  background: var(--cover-2-bg-img);
}
.cover-3 {
  background: var(--cover-3-bg-img);
}
.cover-4 {
  background: var(--cover-4-bg-img);
}
.scrubber {
  position: fixed;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  z-index: 60;
}
.scrubber span {
  text-decoration: none;
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}
.scrubber span:hover {
  background-color: var(--hover-bg);
  transform: scale(1.3);
}
.main-content:has(.scrubber) {
  padding-right: 50px;
}
@media (max-width: 768px) {
  body {
    min-height: -webkit-fill-available;
  }
  .sidebar {
    border-left: 1px solid var(--border-color);
    border-right: 0;
  }
  .app-container {
    flex-direction: row-reverse;
    height: 100vh;
  }
  .sidebar {
    position: fixed;
    right: -100vw;
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    min-height: 100vh;
  }
  .sidebar.open {
    right: 0;
  }
  .sidebar-toggle {
    display: block;
  }
  .main-content {
    overflow-x: hidden;
    padding: 20px 15px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
  .top-bar {
    margin: -20px -25px 20px -5px;
    padding: 15px 15px;
  }
  .main-content:has(.scrubber) .top-bar {
    margin-right: -60px;
  }
  .search-bar {
    width: 100%;
    max-width: 300px;
  }
  .artist-grid,
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
  .album-tracks-section .artist-image,
  .album-tracks-section .album-cover {
    width: 64px;
  }
  .album-tracks-section {
    align-items: start;
    grid-template-columns: 80px 1fr;
  }
  .track-item {
    grid-template-columns: 1fr 50px;
  }
  .track-album {
    display: none;
  }
  .player-bar {
    background-color: var(--sidebar-bg);
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 0 15px env(safe-area-inset-bottom) 15px;
    z-index: 1001;
  }
  .next-btn {
    font-size: 32px;
    min-width: 1em;
  }
  .now-playing {
    width: auto;
    flex: 1;
    gap: 10px;
  }
  .now-playing-cover {
    width: 40px;
    height: 40px;
  }
  .now-playing-popup-open {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  .player-controls {
    width: auto;
    flex-direction: row;
  }
  .control-buttons {
    margin-bottom: 0;
    gap: 15px;
  }
  .control-buttons button:first-child,
  .progress-container,
  .volume-controls {
    display: none;
  }
  .popup-panel {
    box-shadow: none;
    border: 0;
    top: 0;
    left: 0;
    max-width: none;
    width: 100vw;
    height: 100vh;
    z-index: 1002;
  }
  .popup-panel .header-track-info {
    display: block;
  }
  .popup-panel {
  }
  .popup-panel .btn-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
  }
  .popup-panel .popup-header .btn-icon {
    padding: 0 10px;
  }
  .popup-panel .btn-icon:active {
    background-color: var(--hover-bg);
  }
  .popup-panel .header-track-info {
    text-align: center;
    flex: 1;
    margin: 0 15px;
  }
  .popup-panel .header-track-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .popup-panel .header-artist-name {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .popup-panel .header-title {
    display: none;
  }
  .popup-panel {
  }
  .popup-panel .popup-cover-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    text-align: center;
  }
  .popup-panel .large-cover {
    width: 80%;
    max-width: 300px;
    aspect-ratio: 1/1;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-size: contain !important;
    margin-bottom: 25px;
  }
  .popup-panel .large-cover svg {
    fill: var(--text-secondary);
  }
  .popup-panel .large-track-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
  }
  .popup-panel .large-artist-name {
    font-size: 20px;
    color: var(--text-secondary);
  }
  .popup-panel {
  }
  .popup-panel .popup-progress-section {
    padding: 0 20px;
    margin-bottom: 25px;
  }
  .popup-panel .popup-progress-section .progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
  }
  .popup-panel .time-current,
  .popup-panel .time-total {
    font-size: 12px;
    color: var(--text-secondary);
    width: 40px;
  }
  .popup-panel .time-total {
    text-align: right;
  }
  .popup-panel .popup-progress-section .progress-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
  }
  .popup-panel .popup-progress-section .progress-fill {
    height: 100%;
    background-color: var(--text-primary);
    border-radius: 3px;
  }
  .popup-panel {
  }
  .popup-panel .popup-controls-section {
    gap: 40px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
  }
  .popup-panel .large-btn {
    font-size: 36px;
  }
  .popup-panel .play-btn.large-btn {
    font-size: 50px;
  }
  .popup-panel {
  }
  .popup-panel .popup-options-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    padding: 0 20px;
    margin: 40px 0;
  }
  .popup-panel .popup-options-section .btn-icon {
    font-size: 24px;
    color: var(--text-secondary);
  }
  .popup-panel .popup-options-section .btn-icon.active {
    color: var(--accent-color);
    font-weight: 600;
  }
  .popup-panel .icon-shuffle,
  .popup-panel .icon-repeat {
    font-weight: bold;
  }
  .popup-panel .repeat-count {
    font-size: 12px;
    margin-left: 2px;
    vertical-align: super;
  }
  .popup-panel {
  }
  .popup-panel .popup-queue-section {
    padding: 0 20px env(safe-area-inset-bottom) 20px;
  }
  .popup-panel .subsection-title {
    color: var(--text-secondary);
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.3px;
    position: sticky;
    top: 10px;
    z-index: 100;
  }
}
