:root {
  --bg: #0b0b0f;
  --panel: #121219;
  --text: #f0f2f6;
  --muted: #9aa3b2;
  --accent: #1ed760;
  --accent-2: #2aee79;
  --border: rgba(255, 255, 255, .08);
}

/* YouTube tab active color override - ONLY for controls, search, and tab underline */
/* Main brand color (green) remains everywhere else, including CTAs */
body.youtube-active .controls,
body.youtube-active .play-btn,
body.youtube-active .icon-btn.active,
body.youtube-active .fill,
body.youtube-active .thumb,
body.youtube-active .volume-slider,
body.youtube-active .tab-underline,
body.youtube-active #youtubeSearchContainer .search-input:focus {
  --accent: #FF0033;
  --accent-2: #E30013;
}

/* Apply red color to specific elements on YouTube tab */
/* Exclude mini player - it has its own color logic based on what's playing */
/* Target only main controls, not mini player */
body.youtube-active .controls .play-btn,
body.youtube-active .player-main .play-btn {
  background: linear-gradient(180deg, #FF0033, #E30013) !important;
  box-shadow: 0 8px 20px rgba(255, 0, 51, 0.25) !important;
}

body.youtube-active .controls .icon-btn.active,
body.youtube-active .player-main .icon-btn.active {
  background: #FF0033 !important;
  border-color: #FF0033 !important;
}

body.youtube-active .controls .icon-btn.active.one,
body.youtube-active .player-main .icon-btn.active.one {
  background: #FF0033 !important;
  border-color: #E30013 !important;
}

body.youtube-active .controls .fill,
body.youtube-active .player-main .fill {
  background: linear-gradient(90deg, #FF0033, #FF0033) !important;
}

/* Volume slider background for YouTube is handled entirely by JavaScript */
/* No CSS rule needed - JavaScript updates it dynamically with correct percentage */

body.youtube-active .tab-underline {
  background: #FF0033 !important;
}

body.youtube-active #youtubeSearchContainer .search-input:focus {
  border-color: #FF0033 !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.1) !important;
}

/* YouTube content playing color override - ONLY for mini player */
#miniPlayer.youtube-playing {
  --accent: #FF0033;
  --accent-2: #E30013;
}

#miniPlayer.youtube-playing .play-btn {
  background: linear-gradient(180deg, #FF0033, #E30013) !important;
  box-shadow: 0 8px 20px rgba(255, 0, 51, 0.25) !important;
}

#miniPlayer.youtube-playing .icon-btn.active {
  background: #FF0033 !important;
  border-color: #FF0033 !important;
}

#miniPlayer.youtube-playing .mini-progress-fill {
  background: linear-gradient(90deg, #FF0033, #FF0033) !important;
}

#miniPlayer.youtube-playing .mini-progress-thumb {
  background: #FF0033 !important;
}

/* Ensure mini player stays green when local content is playing, even on YouTube tab */
/* This overrides any body.youtube-active styles with higher specificity */
#miniPlayer:not(.youtube-playing) .play-btn {
  background: linear-gradient(180deg, #1ed760, #2aee79) !important;
  box-shadow: 0 8px 20px rgba(30, 215, 96, 0.25) !important;
}

#miniPlayer:not(.youtube-playing) .icon-btn.active {
  background: #1ed760 !important;
  border-color: #1ed760 !important;
}

#miniPlayer:not(.youtube-playing) .mini-progress-fill {
  background: linear-gradient(90deg, #2aee79, #2aee79) !important;
}

#miniPlayer:not(.youtube-playing) .mini-progress-thumb {
  background: #1ed760 !important;
}

* {
  box-sizing: border-box;
  font-family: 'Nunito Sans', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu
}

html,
body {
  height: 100%
}

html {
  /* Hide scrollbar but maintain scroll functionality */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

html::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari and Opera */
}

body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu;
  background: var(--bg);
  color: var(--text);
  animation: fadeInPage 0.2s ease-in-out;
  /* Hide scrollbar but maintain scroll functionality */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar {
  display: none;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Mobile-only centered container */
.app {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  animation: fadeInContent 0.3s ease-in-out;
}

/* Desktop padding */
@media (min-width: 801px) {
  .app {
    padding: 30px;
  }
}

@keyframes fadeInContent {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Unified Header System */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

/* Hide header-left when empty so it doesn't take up flex space */
.header-left:empty {
  display: none;
}

.header-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  flex: 0 0 auto;
  line-height: 1em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
}

.header.header-detail {
  min-height: 48px;
  /* Fixed height to prevent layout shift when buttons are hidden */
}

/* Main page header (centered title) */
.header-main {
  min-height: 48px;
  /* Fixed height to prevent layout shift when buttons are hidden */
}

.header-main .header-title {
  text-align: center;
}

/* Ensure left and right sections have equal flex for proper centering on main headers */
.header-main .header-left {
  flex: 1 1 0;
  justify-content: flex-start;
}

.header-main .header-right {
  flex: 1 1 0;
  justify-content: flex-end;
}

/* Detail page header (left-aligned title with back button) */
.header-detail .header-left {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100% - 100px);
}

.header-detail .header-right {
  flex: 0 0 177px;
  min-width: 100px;
}

/* On mobile, make header-right dynamic (size based on content) */
@media (max-width: 800px) {
  .header-detail .header-right {
    flex: 0 0 auto;
    min-width: 0;
  }

  .header-detail .header-left {
    max-width: none;
  }
}

.header-detail .header-title {
  text-align: left;
  font-size: 22px;
  letter-spacing: -0.5px;
  font-weight: 600;
  margin: 0;
  position: static;
  left: auto;
  transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 0;
}

/* Legacy support - keep for backward compatibility during transition */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1em;
  font-weight: 600;
}

.now-playing {
  color: var(--muted);
  font-size: 14px;
  padding-left: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

/* Force mobile stack */
.player {
  display: grid;
  flex-direction: column;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}

.player-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgb(11 11 15 / 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: fit-content;
}

/* When YouTube is playing, make player-main full width */
.player-main.youtube-active {
  grid-column: 1 / -1;
  max-width: 100%;
}

.art-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center
}

.art-panel.youtube-active {
  max-width: 100%;
  width: 100%;
}

.art-wrap {
  position: relative;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  width: 100%;
}

.art-wrap.youtube-active {
  width: 100%;
  max-width: 100%;
}

.art-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
}

.art-wrap video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
  max-height: 400px;
  object-fit: contain
}

.continue-button {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  white-space: nowrap
}

.continue-button:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3)
}

.continue-button:active {
  transform: translateX(-50%) translateY(0)
}

/* When controls are hidden, make art fully rounded */
.art-wrap.controls-hidden img,
.art-wrap.controls-hidden video {
  border-radius: 12px;
}

.track-meta {
  padding: 20px 20px 0px;
}

.track-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  line-height: 1.2em;
}

.track-album {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 0px 20px 40px;
}

/* Center transport and volume */
.transport {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px
}

.transport-row-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px
}

.transport-row-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px
}

.icon-btn {
  background: #1a1a22;
  border: 1px solid var(--border);
  color: #d9e3f0;
  border-radius: 50%;
  padding: 10px;
  cursor: pointer;
  transition: .15s transform ease, .15s background ease;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: #20212a
}

.icon-btn.active {
  background: var(--accent);
  color: #001b08;
  border-color: var(--accent)
}

.icon-btn.active.one {
  background: var(--accent-2);
  color: #001b08;
  border-color: var(--accent-2)
}

/* Mute button specific styling */
#muteBtn.muted {
  background: #2a1a1a;
  border: 2px solid #d32f2f;
  color: #d32f2f
}

#miniMuteBtn.muted {
  padding: 8px;
  background: #2a1a1a;
  border: 2px solid #d32f2f;
  color: #d32f2f
}

.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: none;
  color: #001b08;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 215, 96, .25)
}

.progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center
}

.time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px
}

.bar {
  position: relative;
  height: 8px;
  background: #1a1a22;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer
}

.fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-2));
  border-radius: 999px
}

.thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4)
}

.volume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px
}

.volume input[type="range"] {
  width: 160px
}

.mute-text {
  color: var(--muted);
  font-size: 12px;
  min-width: 60px;
  text-align: center
}

input[type="range"] {
  appearance: none;
  height: 6px;
  background: #1a1a22;
  border-radius: 999px;
  outline: none;
  border: 1px solid var(--border);
  position: relative
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35)
}

/* Fullscreen button - only visible for video players */
#fullscreenBtn {
  display: none;
}

/* Volume slider with green progress track - background updated via JavaScript */
.volume-slider {
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 80%, #1a1a22 80%, #1a1a22 100%);
}

/* Mobile volume control - pill button */
@media (max-width: 800px) {
  .controls {
    padding: 0px 20px 0px;
  }

  .volume-slider {
    display: none
  }

  .volume {
    justify-content: center
  }

  .volume .icon-btn {
    display: none
  }

  /* Hide the volume button in mobile since it's moved to transport */

  /* Transport controls layout for mobile */
  .transport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px
  }

  .transport-row-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap
  }

  .transport-row-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px
  }

  /* Mute button styling for mobile (no text, just icon) */
  #miniMuteBtn,
  #muteBtn {
    border: 1px solid var(--border);
    color: #dbe3f0;
    border-radius: 50%;
    min-width: auto;
    justify-content: center
  }

  /* Header title left-aligned on mobile */
  .header-title {
    text-align: left !important;
    font-size: 28px !important;
    position: static !important;
    transform: none !important;
    left: auto !important;
  }

  .header-main .header-title {
    text-align: left !important;
    position: static !important;
    transform: none !important;
    left: auto !important;
  }

  .header-detail .header-title {
    font-size: 20px !important;
    text-align: left !important;
  }

  /* On mobile, reset flex for simpler layout */
  .header-main .header-left,
  .header-main .header-right {
    flex: 0 0 auto;
  }

  /* Make header sticky when in edit mode (mobile only) */
  .header-detail.header-edit-mode {
    position: sticky;
    top: -16px;
    z-index: 100;
    background: rgba(11, 11, 15, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 24px 16px 8px 16px;
    margin: -16px -16px 10px -16px;
    width: calc(100% + 32px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
}

/* Hide volume slider on touch devices (phones, tablets like iPad) */
/* This targets devices with touch input regardless of screen size */
@media (pointer: coarse) and (hover: none),
(hover: none) and (pointer: coarse),
(any-pointer: coarse),
(max-width: 800px) {
  .volume-slider {
    display: none !important
  }

  .volume {
    justify-content: center
  }
}

.playlist {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 80px;
  background: rgb(11 11 15 / 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: fit-content;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: auto;
  overflow: visible
}

.track-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  color: #dbe3f0;
  border: 1px solid transparent;
  cursor: pointer
}

.track-item:hover {
  background: #161620;
  border-color: var(--border)
}

.track-item.active {
  background: #17221b;
  border-color: rgba(30, 215, 96, .28)
}

.track-item.active .track-index {
  color: var(--accent)
}

.track-item.active .track-name {
  margin-left: -8px;
  font-weight: 600;
  color: var(--accent)
}

.track-item.active .track-length {
  color: var(--accent)
}

.track-item.active .track-offline-icon {
  color: var(--accent)
}

.track-offline-icon {
  color: var(--muted)
}

.track-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none
}

.track-item.disabled .track-name {
  color: var(--muted)
}

.track-item.disabled .track-index {
  color: var(--muted)
}

.track-item.disabled .track-length {
  color: var(--muted)
}

.track-index {
  font-size: 14px;
  margin-left: 5px;
  text-align: right;
  color: var(--muted)
}

.track-name {
  font-size: 14px;
  letter-spacing: -0.25px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.track-length {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums
}

/* Animated music icon for playing tracks */
.track-music-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.music-bars {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 16px;
}

.music-bar {
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 1px;
  transform-origin: bottom;
  animation: musicPulse 0.8s ease-in-out infinite;
}

.music-bar:nth-child(1) {
  animation-delay: 0s;
  animation-duration: 0.8s;
}

.music-bar:nth-child(2) {
  animation-delay: 0.2s;
  animation-duration: 1.0s;
}

.music-bar:nth-child(3) {
  animation-delay: 0.1s;
  animation-duration: 0.9s;
}

@keyframes musicPulse {

  0%,
  100% {
    transform: scaleY(0.25);
  }

  50% {
    transform: scaleY(1);
  }
}

/* Hover state - show pause button only when playing */
.track-item:hover .track-music-icon .music-bars {
  display: none;
}

.track-item:hover .track-music-icon .pause-btn {
  display: flex;
}

/* When paused, don't show pause button on hover */
.track-item.paused:hover .track-music-icon .pause-btn {
  display: none;
}

.track-music-icon .pause-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: none;
}

.track-music-icon .pause-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.track-music-icon .pause-btn svg {
  width: 20px;
  height: 20px;
}

/* When paused, show play button on hover */
.track-item.paused .track-music-icon .music-bars {
  display: none;
}

.track-item.paused .track-music-icon .play-btn {
  display: flex;
}

.track-music-icon .play-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: none;
}

.track-music-icon .play-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.track-music-icon .play-btn svg {
  width: 20px;
  height: 20px;
}

/* Custom scrollbar for track list - commented out since no scrolling */
/* .track-list::-webkit-scrollbar{width:8px}
 .track-list::-webkit-scrollbar-track{background:#1a1a22;border-radius:999px}
 .track-list::-webkit-scrollbar-thumb{background:#4a4a5a;border-radius:999px}
 .track-list::-webkit-scrollbar-thumb:hover{background:#5a5a6a} */

/* Firefox scrollbar - commented out */
/* .track-list{scrollbar-width:thin;scrollbar-color:#4a4a5a #1a1a22} */

/* Back arrow button */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  min-height: 36px;
  max-height: 36px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

/* Back button link wrapper (for dashboard user edit) */
.back-btn-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: 12px;
}

.footer {
  margin: 72px 0 72px;
  color: var(--muted);
  font-size: 12px;
  text-align: center
}

/* Albums view */
.view[hidden] {
  display: none
}

/* Legacy library-title - now uses header-title */
.library-title {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px 0;
  text-align: center;
}

/* Search functionality */
.search-container {
  margin-bottom: 24px;
  transition: margin-bottom 0.3s ease;
}

.search-container.compact {
  margin-bottom: 16px;
}

.search-wrapper {
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
}

.search-input {
  flex: 1;
  padding: 12px 16px 12px 48px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1;
  /* Prevent iOS zoom on focus */
  -webkit-text-size-adjust: 100%;
}

.search-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.upload-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: 'Nunito Sans', sans-serif;
  outline: none;
  position: relative;
}

.upload-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.upload-icon-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.upload-icon-btn.active svg {
  transform: rotate(45deg);
}

/* Small square icon buttons - matches dashboard styles */
.icon-square-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  font-family: 'Nunito Sans', sans-serif;
  outline: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.icon-square-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-square-btn svg {
  width: 18px;
  height: 18px;
}

/* Accent variant (green) - extends icon-square-btn with green color */
.icon-square-btn--accent {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(30, 215, 96, 0.7);
  background: rgba(30, 215, 96, 0.12);
  color: var(--accent, #1ED760);
}

.icon-square-btn--accent:hover {
  background: rgba(30, 215, 96, 0.18);
  border-color: rgba(30, 215, 96, 0.9);
}

.icon-square-btn--accent svg {
  width: 18px;
  height: 18px;
}

/* Delete selected button - red variant */
.delete-selected-btn {
  background: rgba(255, 77, 79, 0.12) !important;
  border: 1px solid rgba(255, 77, 79, 0.7) !important;
  color: #ff4d4f !important;
  width: auto !important;
  height: 36px !important;
  padding: 8px 16px !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.delete-selected-btn:hover {
  background: rgba(255, 77, 79, 0.18) !important;
  border-color: rgba(255, 77, 79, 0.9) !important;
}

.delete-selected-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Library header actions - now uses unified header-right structure */
/* Legacy support - kept for backward compatibility during transition */
#libraryHeaderActions {
  display: flex;
  gap: 12px;
  align-items: center;
}

#libraryHeaderActionsHeader {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Spinning animation for offline icons */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Offline icon loading spinner */
.offline-toggle-icon.offline-icon-loading {
  animation: none;
  /* Disable any rotation animation - we use SVG animateTransform instead */
}

/* Toggle switch - matching dashboard style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  top: 50%;
  transform: translate(0, -50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked+.toggle-slider {
  background: rgba(30, 215, 96, 0.3);
  border-color: rgba(30, 215, 96, 0.6);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translate(16px, -50%);
}

/* Larger toggles on desktop */
@media (min-width: 801px) {
  .toggle-switch {
    width: 40px;
    height: 22px;
  }

  .toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
  }

  .toggle-switch input:checked+.toggle-slider:before {
    transform: translate(18px, -50%);
  }
}

/* Album Settings Dropdown */
.album-settings-dropdown {
  position: relative;
}

.album-settings-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  min-width: 200px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.album-settings-menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s ease;
}

.album-settings-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.album-settings-menu-item:active {
  background: rgba(255, 255, 255, 0.12);
}

.album-settings-menu-item.album-delete-item {
  color: #ff4d4f;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4px;
  padding-top: 12px;
}

.album-settings-menu-item.album-delete-item:hover {
  background: rgba(255, 77, 79, 0.12);
  color: #ff4d4f;
}

.album-settings-menu-item.album-delete-item:active {
  background: rgba(255, 77, 79, 0.2);
}

/* Edit mode styles */
.track-list.edit-mode .track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.track-list.edit-mode .track-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 16px;
}

.track-list.edit-mode .track-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.track-list.edit-mode .track-save-btn {
  padding: 10px 12px;
  border-radius: 6px;
  display: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.track-list.edit-mode .track-save-btn.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 215, 96, 0.12);
  border: 1px solid rgba(30, 215, 96, 0.7);
  color: var(--accent, #1ED760);
}

.track-list.edit-mode .track-delete-btn {
  padding: 10px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255, 77, 79, 0.3);
  color: #ff4d4f;
  cursor: pointer;
  transition: all 0.2s ease;
}

.track-list.edit-mode .track-delete-btn:hover {
  background: rgba(255, 77, 79, 0.12);
  border-color: rgba(255, 77, 79, 0.7);
}

.track-list.edit-mode .track-delete-btn.selected {
  background: #ff4d4f;
  border-color: #ff4d4f;
  color: white;
}

.track-list.edit-mode .track-delete-btn.selected:hover {
  background: #ff3336;
  border-color: #ff3336;
}

.track-list.edit-mode .track-delete-btn.selected svg {
  stroke: white;
  fill: none;
}

/* Album title row in edit mode - match track styling */
.track-list.edit-mode .track-item.offline-album-row {
  padding: 2px 0;
  margin-bottom: 8px;
}

.track-list.edit-mode .track-item.offline-album-row > div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.track-list.edit-mode .track-item.offline-album-row:hover > div {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.track-list.edit-mode .track-item.offline-album-row .album-title-input-edit {
  background: transparent;
}

/* Album title edit mode */
.album-title-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex: 1;
}

.album-title-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 18px;
  font-weight: 600;
}

.album-title-save-btn {
  padding: 10px 12px;
  border-radius: 6px;
  display: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: rgba(30, 215, 96, 0.12);
  border: 1px solid rgba(30, 215, 96, 0.7);
  color: var(--accent, #1ED760);
}

.album-title-save-btn.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#exitEditModeBtn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  width: auto !important;
  min-width: auto;
  background: rgba(30, 215, 96, 0.12);
  color: var(--accent, #1ED760);
  border: 1px solid rgba(30, 215, 96, 0.7);
}

#exitEditModeBtn:hover {
  background: rgba(30, 215, 96, 0.18);
  border-color: rgba(30, 215, 96, 0.9);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.1);
}

.search-input::placeholder {
  color: var(--muted);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  /* Ensure above input and actions */
}

.clear-search-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.clear-search-btn svg {
  width: 18px;
  height: 18px;
}

.search-results {
  margin-top: 20px;
  margin-bottom: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  min-height: 0;
  height: auto;
  overflow: hidden;
  transition: all 0.3s ease;
}

.search-results:empty {
  margin-top: 0;
  margin-bottom: 0;
  height: 0;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

/* Search sections */
.search-section {
  margin-bottom: 32px;
}

.search-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Search results grid - single column layout for search results */
.search-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 80px;
}

/* Desktop-specific font sizes */
@media (min-width: 801px) {

  /* Use CSS custom properties for scalable font sizing */
  :root {
    --desktop-font-multiplier: 1.3;
  }

  .album-sub,
  .time,
  .mini-player .album,
  .search-track-album {
    font-size: calc(12px * var(--desktop-font-multiplier)) !important;
  }

  /* Apply multiplier to all font sizes */
  .search-results,
  .search-track-title,
  .mini-player .title,
  .search-section-title,
  .no-results,
  .track-album,
  .track-index,
  .track-name,
  .track-length,
  .track-namesernm nbvczsaw3rt6yhgtrew3q2wQAS∂ {
    font-size: 16px !important;
  }

  /* Album titles - separate sizing */
  .album-title {
    font-size: 18px !important;
  }

  /* Media tabs labels - separate from other tab-label uses */
  .media-tabs .tab-label {
    font-size: 20px !important;
  }

  .search-input {
    font-size: 16px !important;
  }


  .mini-player .playlist-expander .header h3 {
    font-size: calc(16px * var(--desktop-font-multiplier)) !important;
  }

  .mini-player .playlist-expander .track-index,
  .mini-player .playlist-expander .track-name,
  .mini-player .playlist-expander .track-length {
    font-size: 16px !important;
  }

  .yt-import-input,
  .media-track-input,
  .media-cover-filename {
    font-size: 16px !important;
  }

  .track-title,
  .brand h1,
  .header-detail .header-title {
    font-size: calc(20px * var(--desktop-font-multiplier)) !important;
  }

  .library-title,
  .header-main .header-title {
    font-size: calc(30px * var(--desktop-font-multiplier)) !important;
  }

}

/* Search albums container - single column layout */
.search-albums-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Search tracks container */
.search-tracks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Search tracks container */
.search-tracks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-track-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 12px;
  /* Ensure consistent spacing between elements */
}

.search-track-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.search-track-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-track-details {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 60px);
  /* Reserve space for play button */
}

.search-track-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.search-track-album {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.search-track-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #001b08;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-track-play-btn:hover {
  background: var(--accent-2);
  transform: scale(1.05);
}

.search-track-play-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile optimizations for search results */
@media (max-width: 800px) {
  .search-albums-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-section-title {
    font-size: 14px;
    margin: 0 0 12px 0;
  }

  .search-albums-container .album-card {
    font-size: 12px;
  }

  .search-albums-container .album-card .album-title {
    font-size: 14px;
  }

  .search-albums-container .album-card .album-sub {
    font-size: 12px;
  }
}

.albums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 16px;
  padding-bottom: 0;
  transition: padding-bottom 0.3s ease
}

/* Add bottom padding when mini player is visible to prevent overlap */
.albums.mini-player-visible {
  padding-bottom: 80px
}

.album-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  border: none;
  border-radius: 16px;
  padding: 0px;
  color: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: rgb(11 11 15 / 0%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3)
}

.album-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 1;
}

/* Video albums get 16:9 aspect ratio */
.album-card.video-album img {
  aspect-ratio: 16/9;
  height: auto;
  object-fit: cover;
}

.album-meta {
  width: 100%;
  padding: 12px;
  text-align: left;
}

.album-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2em;
}

.album-sub {
  font-size: 12px;
  margin-top: 5px;
  color: var(--muted)
}

.offline-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Offline banner */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10000;
  background: rgba(30, 215, 96, 0.15);
  border-bottom: 1px solid rgba(30, 215, 96, 0.3);
  padding: 12px 16px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Add padding to body when offline banner is visible */
body.offline-banner-active {
  padding-top: 48px;
}

/* Video album indicator */
.video-album {
  position: relative
}

/* Loading indicator for large libraries */
.loading-indicator {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 16px;
}

/* Optimize album grid for large libraries */
.albums:has(.loading-indicator) {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bottom navigation tray - temporarily hidden */
.bottom-nav {
  display: none
}

/* Mini player */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  opacity: 0;
  background: rgb(11 11 15 / 90%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none
}

.mini-player.visible {
  transform: translateY(0);
  opacity: 1;
  z-index: 1000;
  pointer-events: auto
}

.mini-player .content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mini-player .content button {
  cursor: pointer;
}

.mini-player .art {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover
}

.mini-player .info {
  flex: 1;
  min-width: 0
}

.mini-player .title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.mini-player .album {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.mini-player .controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row
}

.mini-player .play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #001b08;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  order: 2
}

.mini-player .play-btn:disabled {
  background: var(--muted);
  cursor: not-allowed
}

.mini-player .play-btn svg {
  width: 22px;
  height: 22px
}

.mini-player .icon-btn {
  width: 40px;
  height: 40px;
  background: #1a1a22;
  border: 1px solid var(--border);
  color: #dbe3f0;
  border-radius: 50%;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  order: 1
}

.mini-player .icon-btn:hover {
  background: #20212a
}

.mini-player .icon-btn svg {
  width: 22px;
  height: 22px
}

/* Mini player playlist expander */
.mini-player .playlist-expander {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--panel);
  border-top: 1px solid var(--border);
  z-index: 999;
  transition: transform 0.3s ease;
  transform: translateY(100%)
}

.mini-player .playlist-expander.expanded {
  transform: translateY(0)
}

.mini-player .playlist-expander .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border)
}

.mini-player .playlist-expander .header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600
}

.mini-player .playlist-expander .close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px
}

.mini-player .playlist-expander .tracks {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px
}

/* Use exact same track list styling as main page */
.mini-player .playlist-expander .track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: auto;
  overflow: visible
}

.mini-player .playlist-expander .track-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  color: #dbe3f0;
  border: 1px solid transparent;
  cursor: pointer
}

.mini-player .playlist-expander .track-item:hover {
  background: #161620;
  border-color: var(--border)
}

.mini-player .playlist-expander .track-item.active {
  background: #17221b;
  border: 1px solid rgba(30, 215, 96, .28)
}

.mini-player .playlist-expander .track-item.active .track-index {
  color: var(--accent)
}

.mini-player .playlist-expander .track-item.active .track-name {
  color: var(--accent);
  font-weight: 600;
  margin-left: -5px;
}

.mini-player .playlist-expander .track-item.active .track-length {
  color: var(--accent)
}

.mini-player .playlist-expander .track-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none
}

.mini-player .playlist-expander .track-item.disabled .track-name {
  color: var(--muted)
}

.mini-player .playlist-expander .track-item.disabled .track-index {
  color: var(--muted)
}

.mini-player .playlist-expander .track-item.disabled .track-length {
  color: var(--muted)
}

.mini-player .playlist-expander .track-index {
  font-size: 14px;
  width: 20px;
  text-align: right;
  color: var(--muted)
}

.mini-player .playlist-expander .track-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.mini-player .playlist-expander .track-length {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums
}

/* Mini playlist animated music icon - same as main playlist */
.mini-player .playlist-expander .track-music-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-left: 10px;
}

.mini-player .playlist-expander .music-bars {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 16px;
}

.mini-player .playlist-expander .music-bar {
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 1px;
  transform-origin: bottom;
  animation: musicPulse 0.8s ease-in-out infinite;
}

.mini-player .playlist-expander .music-bar:nth-child(1) {
  animation-delay: 0s;
  animation-duration: 0.8s;
}

.mini-player .playlist-expander .music-bar:nth-child(2) {
  animation-delay: 0.2s;
  animation-duration: 1.0s;
}

.mini-player .playlist-expander .music-bar:nth-child(3) {
  animation-delay: 0.1s;
  animation-duration: 0.9s;
}

/* Mini playlist hover states */
.mini-player .playlist-expander .track-item:hover .track-music-icon .music-bars {
  display: none;
}

.mini-player .playlist-expander .track-item:hover .track-music-icon .pause-btn {
  display: flex;
}

/* When paused, don't show pause button on hover */
.mini-player .playlist-expander .track-item.paused:hover .track-music-icon .pause-btn {
  display: none;
}

.mini-player .playlist-expander .track-music-icon .pause-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: none;
}

.mini-player .playlist-expander .track-music-icon .pause-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.mini-player .playlist-expander .track-music-icon .pause-btn svg {
  width: 20px;
  height: 20px;
}

/* Mini playlist paused state */
.mini-player .playlist-expander .track-item.paused .track-music-icon .music-bars {
  display: none;
}

.mini-player .playlist-expander .track-item.paused .track-music-icon .play-btn {
  display: flex;
}

.mini-player .playlist-expander .track-music-icon .play-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: none;
}

.mini-player .playlist-expander .track-music-icon .play-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.mini-player .playlist-expander .track-music-icon .play-btn svg {
  width: 20px;
  height: 20px;
}

/* Custom scrollbar for mini player playlist */
.mini-player .playlist-expander .tracks::-webkit-scrollbar {
  width: 8px
}

.mini-player .playlist-expander .tracks::-webkit-scrollbar-track {
  background: #1a1a22;
  border-radius: 999px
}

.mini-player .playlist-expander .tracks::-webkit-scrollbar-thumb {
  background: #4a4a5a;
  border-radius: 999px
}

.mini-player .playlist-expander .tracks::-webkit-scrollbar-thumb:hover {
  background: #5a5a6a
}

/* Firefox scrollbar for mini player playlist */
.mini-player .playlist-expander .tracks {
  scrollbar-width: thin;
  scrollbar-color: #4a4a5a #1a1a22
}

/* Limit global width on large screens to look mobile */
body {
  display: flex;
  align-items: flex-start;
  justify-content: center
}

/* Mobile padding override */
@media (max-width: 800px) {
  .mini-player .content {
    padding: 0px
  }

  .player {
    grid-template-columns: 1fr
  }

  .albums {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Performance optimizations - Hardware acceleration for smooth animations */
.album-card {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.album-card:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.track-item {
  will-change: background-color, border-color;
  transform: translateZ(0);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mini-player {
  will-change: transform;
  transform: translateZ(0);
  transition: transform 0.3s ease;
}

/* Optimize music bar animations for better performance */
.music-bar {
  will-change: height;
  transform: translateZ(0);
}

/* Optimize button hover effects */
.track-music-icon .pause-btn,
.track-music-icon .play-btn {
  will-change: transform;
  transform: translateZ(0);
}

/* Albums view */

/* Mini player progress bar */
.mini-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  z-index: 10;
}

.mini-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s ease;
}

.mini-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.mini-progress-bar:hover .mini-progress-thumb {
  opacity: 1;
}

.mini-progress-bar:active .mini-progress-thumb {
  opacity: 1;
}

/* Smooth transitions for album switching */
.playing-view-transition {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.playing-view-fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.playing-view-fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Dynamic album background system */
.album-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  transition: opacity 0.5s ease-in-out;
}

.background-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(240px);
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: float 40s linear infinite;
}

.background-blob.vibrant {
  top: -30vmin;
  left: -30vmin;
  animation-duration: 22s;
}

.background-blob.muted {
  bottom: -30vmin;
  right: -30vmin;
  animation-duration: 35s;
}

.background-blob.dark-vibrant {
  top: 10%;
  left: 40%;
  animation-duration: 25s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(8vw, -6vh) scale(1.1);
  }

  50% {
    transform: translate(-6vw, 8vh) scale(0.95);
  }

  75% {
    transform: translate(5vw, 5vh) scale(1.1);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

/* Mobile optimizations for background blobs */
@media (max-width: 800px) {
  .background-blob {
    /* Reduce blur on mobile for better performance */
    filter: blur(120px);
    /* Slightly reduce opacity for better battery life */
    opacity: 0.9;
  }

  /* Reduce animation complexity on mobile */
  @keyframes float {
    0% {
      transform: translate(0, 0) scale(1);
    }

    50% {
      transform: translate(4vw, -3vh) scale(1.05);
    }

    100% {
      transform: translate(0, 0) scale(1);
    }
  }

  /* Slower animations on mobile to save battery */
  .background-blob.vibrant {
    animation-duration: 15s;
  }

  .background-blob.muted {
    animation-duration: 30s;
  }

  .background-blob.dark-vibrant {
    animation-duration: 20s;
  }
}

/* Media Type Tabs */
.media-tabs {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
  position: relative;
  background: transparent;
  border: none;
  gap: 0;
  overflow: hidden;
}

/* Grey background bar for all tabs (inactive state) */
.media-tabs::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.tab-label {
  flex: 1 1 0;
  min-width: 0;
  padding: 20px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  /* text-transform: uppercase; */
  cursor: pointer;
  text-align: center;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}

.tab-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tab-label:hover {
  color: var(--primary);
}

.tab-label.active {
  color: var(--primary);
}

.tab-underline {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 2;
  /* Width will be set dynamically via JavaScript based on number of tabs */
}

.media-tabs.hidden {
  display: none !important;
}

/* Search container */

/* Album Play Button Overlay */
.album-cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
}

/* Video albums should be wider (16:9 aspect ratio) */
.album-card.video-album .album-cover-container {
  aspect-ratio: 16/9;
}

.album-cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.album-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.album-card:hover .album-play-overlay {
  opacity: 1;
}

/* Make play button hover work even when overlay is hidden */
.album-card:hover .album-play-button:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 15px 30px rgba(30, 215, 96, 0.5) !important;
}

/* Ensure overlay becomes visible when hovering over play button */
.album-play-button:hover~.album-play-overlay,
.album-play-overlay:hover {
  opacity: 1 !important;
}

.album-card:hover .album-cover-container img {
  transform: scale(1.05);
}

.album-play-button {
  width: 54px;
  height: 54px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #001b08;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 215, 96, 0.25);
  transition: all 0.3s ease;
}

/* Dashboard link buttons (andrew-only) */
.dashboard-link-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  padding: 10px;
  z-index: 10;
  background-color: #3ADB71;
  border-radius: 50px;
}

.dashboard-link-icon {
  margin-left: 12px;
}

.album-play-button svg {
  width: 22px;
  height: 22px;
}

.album-card:hover .album-play-button {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  transform: scale(1.1);
  box-shadow: 0 12px 25px rgba(30, 215, 96, 0.4);
}


/* Responsive adjustments for album play button */
@media (max-width: 768px) {
  .album-play-button {
    width: 48px;
    height: 48px;
  }

  .album-play-button svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .album-play-button {
    width: 44px;
    height: 44px;
  }

  .album-play-button svg {
    width: 24px;
    height: 24px;
  }
}

.track-list.video-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  list-style: none;
  margin: 0;
}

.video-thumbnail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: transparent;
  padding: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 0 0 var(--border);
  border: 1px solid transparent;
  border-radius: 10px;
}

.video-thumbnail-item:last-child {
  box-shadow: none;
}

.video-thumbnail-item:only-child {
  box-shadow: none;
}

.video-thumbnail-item:hover {
  border-color: var(--border);
  background: #161620;
}

.video-thumbnail-item.active {
  background: #1d2027;
  border: 1px solid #393950;
}

.video-thumbnail-container {
  position: relative;
  width: 120px;
  min-width: 120px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
  flex-shrink: 0;
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-thumbnail-item:hover .video-thumbnail {
  transform: scale(1.05);
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-thumbnail-item:hover .video-play-overlay {
  opacity: 1;
}

/* Also show overlay while item is active (playing/paused) */
/* Overlay only on hover; hidden otherwise */


.play-button {
  width: 34px;
  height: 34px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #001b08;
  /* for currentColor fill */
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 215, 96, 0.25);
  transition: all 0.3s ease;
}

.play-button svg {
  width: 22px;
  height: 22px;
}

.video-thumbnail-item:hover .play-button {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  transform: scale(1.1);
  box-shadow: 0 12px 25px rgba(30, 215, 96, 0.4);
}

.video-thumbnail-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.video-thumbnail-title {
  font-size: 1rem;
  font-weight: 500;
  color: white;
  text-align: left;
  margin: 0 0 0.5rem 0;
  padding: 0;
}

.video-thumbnail-duration {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  margin: 0;
  padding: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .video-thumbnail-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .video-thumbnail-container {
    width: 120px;
    min-width: 120px;
  }

  .video-thumbnail-title {
    font-size: 0.9rem;
  }

  .video-thumbnail-duration {
    font-size: 0.8rem;
  }

  .play-button {
    width: 48px;
    height: 48px;
  }

  .play-button svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .video-thumbnail-item {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .video-thumbnail-container {
    width: 120px;
    min-width: 120px;
  }

  .video-thumbnail-title {
    font-size: 0.85rem;
  }

  .video-thumbnail-duration {
    font-size: 0.75rem;
  }
}

/* Password Protection Styles */
.password-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: none;
  /* Hidden by default - shown only when needed */
  align-items: center;
  justify-content: center;
  z-index: 10000;
  font-family: 'Nunito Sans', sans-serif;
  overflow: hidden;
  animation: fadeInPage 0.4s ease-in-out;
}

.password-screen[style*="display: flex"],
.password-screen.show {
  display: flex;
}

/* Random particle system */
.password-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 23px 47px, rgba(30, 215, 96, 0.6), transparent),
    radial-gradient(3px 3px at 67px 83px, rgba(42, 238, 121, 0.5), transparent),
    radial-gradient(1px 1px at 127px 31px, rgba(30, 215, 96, 0.7), transparent),
    radial-gradient(2px 2px at 193px 97px, rgba(42, 238, 121, 0.6), transparent),
    radial-gradient(3px 3px at 251px 43px, rgba(30, 215, 96, 0.5), transparent),
    radial-gradient(1px 1px at 311px 79px, rgba(42, 238, 121, 0.7), transparent),
    radial-gradient(2px 2px at 373px 17px, rgba(30, 215, 96, 0.6), transparent),
    radial-gradient(3px 3px at 431px 61px, rgba(42, 238, 121, 0.5), transparent),
    radial-gradient(1px 1px at 487px 89px, rgba(30, 215, 96, 0.7), transparent),
    radial-gradient(2px 2px at 547px 29px, rgba(42, 238, 121, 0.6), transparent),
    radial-gradient(3px 3px at 607px 73px, rgba(30, 215, 96, 0.5), transparent),
    radial-gradient(1px 1px at 667px 41px, rgba(42, 238, 121, 0.7), transparent);
  background-repeat: repeat;
  background-size: 300px 200px;
  animation: particleFloat 25s linear infinite;
  opacity: 0.8;
}

.password-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1px 1px at 37px 113px, rgba(30, 215, 96, 0.5), transparent),
    radial-gradient(3px 3px at 97px 53px, rgba(42, 238, 121, 0.6), transparent),
    radial-gradient(2px 2px at 157px 97px, rgba(30, 215, 96, 0.55), transparent),
    radial-gradient(1px 1px at 217px 37px, rgba(42, 238, 121, 0.5), transparent),
    radial-gradient(3px 3px at 277px 77px, rgba(30, 215, 96, 0.6), transparent),
    radial-gradient(2px 2px at 337px 17px, rgba(42, 238, 121, 0.5), transparent),
    radial-gradient(1px 1px at 397px 57px, rgba(30, 215, 96, 0.7), transparent),
    radial-gradient(3px 3px at 457px 97px, rgba(42, 238, 121, 0.5), transparent),
    radial-gradient(2px 2px at 517px 37px, rgba(30, 215, 96, 0.6), transparent),
    radial-gradient(1px 1px at 577px 77px, rgba(42, 238, 121, 0.5), transparent),
    radial-gradient(3px 3px at 637px 17px, rgba(30, 215, 96, 0.7), transparent),
    radial-gradient(2px 2px at 697px 57px, rgba(42, 238, 121, 0.5), transparent);
  background-repeat: repeat;
  background-size: 350px 250px;
  animation: particleFloat 35s linear infinite reverse;
  opacity: 0.6;
}

@keyframes particleFloat {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-200px, -200px);
  }
}

.password-container {
  background: rgb(11 11 15 / 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: slideIn 0.5s ease-out;
  position: relative;
  z-index: 2;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.password-header h1 {
  color: var(--text);
  font-size: 2.3rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.password-header p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 2rem 0;
  font-weight: 400;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.password-input {
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1.1rem;
  font-family: 'Nunito Sans', sans-serif;
  transition: all 0.3s ease;
  background: #1a1a22;
  color: var(--text);
  outline: none;
}

.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.1);
}

.password-input::placeholder {
  color: var(--muted);
}

.password-submit {
  padding: 1rem 2rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #001b08;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Nunito Sans', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 20px rgba(30, 215, 96, 0.25);
}

.password-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(30, 215, 96, 0.35);
}

.password-submit:active {
  transform: translateY(0);
}

.password-error {
  color: #d32f2f;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 1rem;
  animation: shake 0.5s ease-in-out;
  background: #2a1a1a;
  border: 1px solid #d32f2f;
  border-radius: 8px;
  padding: 0.75rem;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* Mobile responsiveness for password screen */
@media (max-width: 480px) {
  .password-container {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  .password-header h1 {
    font-size: 2rem;
  }

  .password-header p {
    font-size: 1rem;
  }

  .password-input,
  .password-submit {
    font-size: 1rem;
  }
}


/* Global Notification Tray (full-width bottom) */
.notification-toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: rgb(11 11 15 / 90%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transform: translateY(100%);
  opacity: 0;
  animation: slideUpNotification 0.3s ease forwards;
}

.notification-toast.show {
  opacity: 1;
}

.notification-toast.success {
  border-top: 3px solid #1ed760;
  background: rgba(30, 215, 96, 0.12);
}

.notification-toast.error {
  border-top: 3px solid #d32f2f;
  background: rgba(211, 47, 47, 0.12);
}

.notification-toast.info {
  border-top: 3px solid #2196f3;
  background: rgba(33, 150, 243, 0.12);
}

.notification-icon {
  flex-shrink: 0;
  color: var(--text);
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-icon svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  line-height: 1.2;
  align-self: center;
}

/* Color text and icons per type */
.notification-toast.success .notification-message,
.notification-toast.success .notification-icon {
  color: var(--accent, #1ED760);
}

.notification-toast.error .notification-message,
.notification-toast.error .notification-icon {
  color: rgba(255, 99, 99, 0.95);
}

.notification-toast.info .notification-message,
.notification-toast.info .notification-icon {
  color: #2196f3;
}

@keyframes slideUpNotification {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* YouTube import styles */
.yt-import {
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.yt-import-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.yt-import-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.yt-import-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.1);
}

.yt-import-input::placeholder {
  color: var(--muted);
}

.yt-import-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.yt-import-actions .btn-primary {
  padding: 12px 16px;
  font-size: 16px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Disabled state (grey) - when no URL entered */
.yt-import-actions .btn-primary:disabled,
.yt-import-actions .btn-primary.btn-disabled {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none !important;
}

/* Active state (green) - when URL entered */
.yt-import-actions .btn-primary:not(:disabled):not(.btn-disabled) {
  background: linear-gradient(180deg, var(--accent), var(--accent-2)) !important;
  color: #001b08 !important;
  box-shadow: 0 4px 16px rgba(30, 215, 96, 0.25);
}

.yt-import-actions .btn-primary:not(:disabled):not(.btn-disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 215, 96, 0.35);
}

@media (max-width: 800px) {
  .yt-import-actions .btn-primary {
    font-size: 14px;
  }
}

.yt-import-status {
  display: none;
  margin: 0;
  font-size: 13px;
  color: var(--accent-2);
}

.yt-import-status:not(:empty) {
  display: block;
  margin: 8px 0px;
  color: var(--accent-2);
}

/* Album import section styling */
.album-import-section {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.album-import-section .media-track-row {
  margin-bottom: 12px;
}

.album-import-section .media-track-row:last-child,
.album-import-section.cover-row-hidden .media-track-row {
  margin-bottom: 0;
}

/* Dashboard-style media track and cover rows */
.media-track-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.media-track-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  flex: 1;
}

.media-track-input::placeholder {
  color: var(--muted);
}

.media-cover-row {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
}

.media-cover-filename {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.media-cover-filename::placeholder {
  color: var(--muted);
}

.yt-import-status {
  display: none;
  margin: 0;
  font-size: 13px;
  color: var(--accent-2);
}

/* Button Styles for YouTube Import */
.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Nunito Sans', sans-serif;
  outline: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #001b08;
  box-shadow: 0 4px 16px rgba(30, 215, 96, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 215, 96, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #1a1a22;
  border-color: #505050;
}

.btn-danger {
  background: rgba(211, 47, 47, 0.2);
  color: rgba(255, 64, 64, 0.8);
  border: 1px solid rgba(211, 47, 47, 0.3);
}

.btn-danger:hover {
  background: rgba(211, 47, 47, 0.3);
  color: rgba(255, 64, 64, 1);
  transform: translateY(-1px);
}

/* Desktop sizing for notification tray */
@media (min-width: 1024px) {
  .notification-icon svg {
    width: 22px;
    height: 22px;
  }

  .notification-message {
    font-size: 16px;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  background: rgb(11 11 15 / 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-content.modal-sm {
  max-width: 500px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: white;
}

.modal-header .close-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.modal-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-confirm-text {
  margin: 0 0 24px 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.icon-plain-btn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.icon-plain-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Account Settings Page Styles */
.account-settings-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-settings-section-last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.account-settings-header {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  margin-top: 0;
}

.account-form-group {
  margin-bottom: 20px;
}

.account-form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.account-input {
  width: 100%;
  padding: 14px 16px;
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-family: 'Nunito Sans', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.account-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.1);
}

.account-input-disabled {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.account-password-field {
  position: relative;
}

.account-password-input {
  padding-right: 48px;
}

.account-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-toggle-password:hover {
  color: var(--text);
}

.account-select {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-family: 'Nunito Sans', sans-serif;
  transition: all 0.3s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2388888d' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.account-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.1);
}

.account-error-message {
  display: none;
  color: #ff4d4f;
  font-size: 12px;
  margin-top: 6px;
}

.account-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.account-btn-cancel,
.account-btn-save {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.account-btn-save {
  background: rgba(30, 215, 96, 0.12);
  border: 1px solid rgba(30, 215, 96, 0.7);
  color: var(--accent, #1ED760);
  box-shadow: none;
}

.account-btn-save:hover:not(:disabled) {
  background: rgba(30, 215, 96, 0.18);
  border-color: rgba(30, 215, 96, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 215, 96, 0.35);
}

.account-btn-save:disabled {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.account-btn-save:disabled:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

/* Mobile responsive styles for account settings */
@media (max-width: 800px) {
  .account-settings-header {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .account-form-label {
    font-size: 14px;
  }

  .account-input {
    padding: 12px;
    font-size: 14px;
  }

  .account-password-input {
    padding-right: 44px;
  }

  .account-select {
    padding: 12px 40px 12px 12px;
    font-size: 14px;
    background-position: right 12px center;
  }

  .account-btn-cancel,
  .account-btn-save {
    padding: 10px 20px;
    font-size: 15px;
  }

  .account-form-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .account-btn-cancel,
  .account-btn-save {
    width: 100%;
  }
}

/* Hide YouTube player UI elements */
.ytp-chrome-top.ytp-show-cards-title,
.ytp-gradient-top,
.ytp-pause-overlay-container {
  display: none !important;
}

/* YouTube Search View Styles */
/* Note: YouTube search now uses the same .search-container, .search-wrapper, and .search-input classes as the main library search */

.youtube-section {
  margin-bottom: 32px;
}

.youtube-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.youtube-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  flex: 1;
}

.youtube-sort-dropdown {
  flex-shrink: 0;
}

#youtubeSortMenu {
  right: 0;
  left: auto;
}

.youtube-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 20px;
}

.youtube-video-card {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.youtube-video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.youtube-video-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.youtube-video-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 aspect ratio */
  background: var(--bg);
  overflow: hidden;
}

.youtube-video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.youtube-video-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.youtube-video-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.youtube-video-channel {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}

.youtube-video-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.youtube-video-views {
  color: var(--muted);
}

.youtube-loading,
.youtube-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

.youtube-error {
  color: #ff4d4f;
}

/* YouTube Load More Button */
.youtube-load-more-container {
  display: flex;
  justify-content: center;
  padding: 32px 20px;
  margin-top: 20px;
}

.youtube-load-more-btn {
  padding: 12px 32px;
  background: rgba(30, 215, 96, 0.12);
  color: var(--accent, #1ED760);
  border: 1px solid rgba(30, 215, 96, 0.7);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  box-shadow: none;
}

.youtube-load-more-btn:hover:not(:disabled) {
  background: rgba(30, 215, 96, 0.18);
  border-color: rgba(30, 215, 96, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 215, 96, 0.35);
}

.youtube-load-more-btn:active:not(:disabled) {
  transform: translateY(0);
}

.youtube-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mobile responsive for YouTube search */
@media (max-width: 800px) {
  .youtube-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .youtube-video-info {
    padding: 10px;
  }

  .youtube-video-title {
    font-size: 14px;
  }

  .youtube-video-channel {
    font-size: 12px;
  }

  .youtube-section-title {
    font-size: 18px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .youtube-results-grid {
    grid-template-columns: 1fr;
    margin: 0 -16px;
  }

  .youtube-video-card {
    border-radius: 0;
  }

}

/* YouTube Player View - Separate from library player */
.youtube-player-view {
  width: 100%;
  padding: 20px;
}

.youtube-player-container {
  width: 100%;
  max-width: 100%;
}

.youtube-player-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgb(11 11 15 / 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: fit-content;
  width: 100%;
}

.youtube-art-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.youtube-art-wrap {
  position: relative;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  width: 100%;
}

#youtubePlayerContainer {
  width: 100%;
  height: 0;
  padding-top: 56.25%;
  position: relative;
  background: #000;
  display: block;
}

#youtubePlayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#youtubePlayer iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Hide YouTube player UI elements - these are inside the iframe so we use CSS overlays to cover them */
/* Overlay to hide ytp-gradient-top and ytp-chrome-top at the top of the video */
#youtubePlayerContainer {
  position: relative;
  overflow: hidden;
}

/* Center overlay to hide ytp-pause-overlay-container */
#youtubeCenterOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: transparent;
  pointer-events: none;
  z-index: 999;
  /* This creates a transparent overlay that blocks the pause button area */
  border-radius: 50%;
}

.youtube-track-meta {
  padding: 20px 20px 0px;
}

.youtube-track-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  line-height: 1.2em;
}

.youtube-track-channel {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.youtube-search-content {
  width: 100%;
}

/* YouTube Download Button Styles */
.youtube-download-dropdown {
  position: relative;
  display: none;
}

#youtubeDownloadMenu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  min-width: 200px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}