/* ==========================================================================
   HUDBA - MODERN AUDIO WEB PLAYER (Vanilla HTML5 / CSS3 / ES6)
   ========================================================================== */

/* --- CSS Variables & Theme Tokens --- */
:root {
  --bg-app: #121316;
  --bg-sidebar: #101114;
  --bg-header: #121316;
  --bg-main: #15161a;
  --bg-player: #131518;
  --bg-card: #191b20;
  --bg-card-hover: #22262d;
  --bg-active: #22262b;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-input: #1a1c22;
  --bg-input-focus: #21252c;
  
  --border-subtle: #202328;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-active: rgba(115, 217, 171, 0.4);

  --text-primary: #ffffff;
  --text-secondary: #8d939c;
  --text-muted: #626770;
  --text-inverted: #0d1013;

  /* Mint/Teal Signature Accent */
  --accent: #73d9ab;
  --accent-hover: #86e4b9;
  --accent-active: #5fc797;
  --accent-subtle: rgba(115, 217, 171, 0.15);
  --accent-glow: rgba(115, 217, 171, 0.35);

  --sidebar-width: 236px;
  --header-height: 64px;
  --player-height: 86px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Base Reset & Typography --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* --- Layout Grid --- */
.app-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
  position: relative;
}

/* ==========================================================================
   TOP HEADER
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-primary);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 0;
  position: relative;
  transition: color var(--transition-fast);
}

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

.nav-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: -19px;
  left: 0;
  right: 0;
  height: 2.5px;
  background-color: var(--accent);
  border-radius: var(--radius-full);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Bar */
.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 320px;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 34px 0 38px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

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

.search-input:focus {
  background-color: var(--bg-input-focus);
  border-color: var(--border-light);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

/* Import Audio Button */
.btn-import-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-import-audio svg {
  width: 15px;
  height: 15px;
}

.btn-import-audio:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* User Avatar */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.user-avatar:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

/* ==========================================================================
   WORKSPACE BODY (Sidebar + Main)
   ========================================================================== */
.workspace-body {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height) - var(--player-height));
  position: relative;
  overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-nav {
  margin-bottom: 20px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-align: left;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.sidebar-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 10px 0 16px 0;
}

/* Playlists Section in Sidebar */
.playlists-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.playlists-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--text-muted);
  padding: 0 14px 10px 14px;
}

.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-align: left;
}

.playlist-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.playlist-item.active {
  color: var(--accent);
  background-color: var(--accent-subtle);
  font-weight: 600;
}

.playlist-icon-box {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-icon-box svg {
  width: 12px;
  height: 12px;
}

.playlist-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-icon svg {
  width: 16px;
  height: 16px;
}

.playlist-item .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.footer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  transition: all var(--transition-fast);
}

.footer-btn svg {
  width: 15px;
  height: 15px;
}

.footer-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex: 1;
  background-color: var(--bg-main);
  overflow-y: auto;
  padding: 28px 36px 48px 36px;
  position: relative;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* --- SECTION 1: EDITOR'S PICKS --- */
.section-picks {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-overline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.carousel-btn svg {
  width: 16px;
  height: 16px;
}

.carousel-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
  transform: scale(1.05);
}

.carousel-btn:active {
  transform: scale(0.95);
}

/* Cards Carousel Track */
.carousel-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: none; /* Firefox */
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.album-card {
  flex: 0 0 calc((100% - (4 * 22px)) / 5);
  min-width: 175px;
  max-width: 230px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  outline: none;
  border-radius: var(--radius-lg);
  transition: transform var(--transition-normal);
}

.album-card:hover {
  transform: translateY(-4px);
}

.card-art-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background-color: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.album-card:hover .card-img {
  transform: scale(1.04);
}

/* Hover Floating Mint Play Button */
.card-play-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: var(--text-inverted);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px) scale(0.85);
  transition: all var(--transition-bounce);
  z-index: 2;
}

.card-play-btn svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.album-card:hover .card-play-btn,
.album-card:focus-visible .card-play-btn,
.album-card.is-playing .card-play-btn {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.card-play-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.08) !important;
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

/* --- SECTION 2: POPULAR THIS WEEK --- */
.section-popular {
  margin-top: 20px;
}

.section-header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-compact {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.see-all-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.see-all-btn svg {
  width: 14px;
  height: 14px;
}

.see-all-btn:hover {
  color: var(--text-primary);
}

/* Track Table Header & Rows */
.tracklist-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.track-header-row {
  display: grid;
  grid-template-columns: 44px minmax(220px, 3.2fr) minmax(140px, 2.2fr) minmax(100px, 1.4fr) 70px 48px;
  align-items: center;
  padding: 0 16px 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.clock-icon {
  width: 14px;
  height: 14px;
}

.col-duration, .col-plays {
  text-align: right;
}

.col-plays {
  padding-right: 12px;
}

.track-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.track-row {
  display: grid;
  grid-template-columns: 44px minmax(220px, 3.2fr) minmax(140px, 2.2fr) minmax(100px, 1.4fr) 70px 48px;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.track-row:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.track-row.active {
  background-color: rgba(115, 217, 171, 0.08);
}

.track-row.active .row-title {
  color: var(--accent);
}

.row-num {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  width: 24px;
}

.row-num-val {
  display: block;
}

.row-play-icon {
  display: none;
  width: 14px;
  height: 14px;
  color: var(--text-primary);
}

.track-row:hover .row-num-val {
  display: none;
}

.track-row:hover .row-play-icon {
  display: block;
}

/* Active song playing animation */
.track-row.is-playing .row-num-val {
  display: none;
}

.track-row.is-playing .row-eq-bars {
  display: flex !important;
}

.track-row.is-playing:hover .row-eq-bars {
  display: none !important;
}

.track-row.is-playing:hover .row-play-icon {
  display: block !important;
}

.row-eq-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 14px;
}

.row-eq-bars span {
  width: 3px;
  background-color: var(--accent);
  border-radius: 1px;
  animation: bounceEq 1s ease-in-out infinite alternate;
}

.row-eq-bars span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.row-eq-bars span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.row-eq-bars span:nth-child(3) { height: 60%; animation-delay: 0.2s; }

@keyframes bounceEq {
  0% { height: 25%; }
  100% { height: 100%; }
}

.row-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.row-title {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-plays {
  text-align: right;
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.row-duration {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.row-more {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.row-action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  opacity: 0.7;
  transition: all var(--transition-fast);
}

.row-action-btn svg {
  width: 16px;
  height: 16px;
}

.track-row:hover .row-action-btn {
  opacity: 1;
}

.row-action-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.row-action-btn.liked {
  color: var(--accent);
}

.row-action-btn.liked svg {
  fill: var(--accent);
}

/* Dynamic view header */
.dynamic-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

.btn-back:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
}

/* ==========================================================================
   QUEUE DRAWER (Right Slide-over)
   ========================================================================== */
.queue-drawer {
  position: absolute;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: right var(--transition-normal);
}

.queue-drawer.open {
  right: 0;
}

.queue-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.queue-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  font-size: 24px;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}

.close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.queue-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.queue-subhead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.queue-subhead {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.btn-clear-queue {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-clear-queue:hover {
  color: var(--accent);
}

.queue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

.queue-card img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

.queue-card-info {
  flex: 1;
  min-width: 0;
}

.queue-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-card-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.queue-item:hover {
  background-color: var(--bg-hover);
}

.queue-item img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-artist {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   BOTTOM PLAYER BAR (Persistent Audio Controller)
   ========================================================================== */
.player-bar {
  height: var(--player-height);
  background-color: var(--bg-player);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 40;
  flex-shrink: 0;
}

/* Left: Track Information */
.player-left {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 280px;
  min-width: 220px;
}

.track-art-wrapper {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.player-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mini Equalizer indicator in bottom player */
.now-playing-bars {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.now-playing-bars.active {
  display: flex;
}

.now-playing-bars .bar {
  width: 3px;
  background-color: var(--accent);
  border-radius: 1px;
  animation: miniEq 1s ease-in-out infinite alternate;
}

.now-playing-bars .bar-1 { height: 10px; animation-delay: 0.1s; }
.now-playing-bars .bar-2 { height: 18px; animation-delay: 0.3s; }
.now-playing-bars .bar-3 { height: 12px; animation-delay: 0.2s; }

@keyframes miniEq {
  0% { height: 6px; }
  100% { height: 20px; }
}

.track-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.track-name-row {
  display: flex;
  align-items: center;
}

.player-track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.player-track-title:hover {
  text-decoration: underline;
}

.player-artist-name {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  cursor: pointer;
}

.player-artist-name:hover {
  color: var(--text-primary);
}

.btn-like {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  margin-left: 4px;
}

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

.btn-like:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.btn-like.liked {
  color: var(--accent);
}

.btn-like.liked svg {
  fill: var(--accent);
}

/* Center: Controls & Timeline */
.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 620px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 22px;
}

.btn-ctrl {
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition-fast);
}

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

.btn-ctrl:hover {
  color: var(--text-primary);
  transform: scale(1.08);
}

.btn-ctrl:active {
  transform: scale(0.95);
}

.btn-ctrl.active {
  color: var(--accent);
}

.btn-ctrl.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--accent);
  border-radius: var(--radius-full);
}

.repeat-badge {
  position: absolute;
  top: -2px;
  right: -6px;
  font-size: 9px;
  font-weight: 700;
  background-color: var(--accent);
  color: var(--text-inverted);
  border-radius: var(--radius-full);
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Play/Pause Mint Accent Button */
.btn-play-pause {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: var(--text-inverted);
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: all var(--transition-fast);
}

.btn-play-pause svg {
  width: 18px;
  height: 18px;
}

.btn-play-pause .play-svg {
  margin-left: 2px;
}

/* Explicit Play / Pause State Icon Toggle */
.btn-play-pause.is-playing .play-svg,
.fs-play-btn.is-playing #fsPlayIcon {
  display: none !important;
}

.btn-play-pause.is-playing .pause-svg,
.fs-play-btn.is-playing #fsPauseIcon {
  display: block !important;
}

.btn-play-pause:not(.is-playing) .play-svg,
.fs-play-btn:not(.is-playing) #fsPlayIcon {
  display: block !important;
}

.btn-play-pause:not(.is-playing) .pause-svg,
.fs-play-btn:not(.is-playing) #fsPauseIcon {
  display: none !important;
}

.btn-play-pause:hover {
  background-color: var(--accent-hover);
  transform: scale(1.06);
}

.btn-play-pause:active {
  transform: scale(0.96);
  background-color: var(--accent-active);
}

/* Scrubber / Timeline */
.player-timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.time-label {
  font-size: 11.5px;
  color: var(--text-muted);
  width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seek-bar-container {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  outline: none;
}

/* Toggle modes between classic flat line and waveform peaks */
.seek-bar-container.mode-classic .waveform-canvas {
  display: none !important;
}

.seek-bar-container.mode-classic .seek-bar-track {
  display: block;
}

.seek-bar-container.mode-waveform .seek-bar-track {
  display: none;
}

.seek-bar-container.mode-waveform .waveform-canvas {
  display: block;
}

.waveform-canvas {
  width: 100%;
  height: 26px;
  display: block;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-fast);
}

.seek-bar-track {
  width: 100%;
  height: 4px;
  background-color: #2b3038;
  border-radius: var(--radius-full);
  position: relative;
  transition: height var(--transition-fast);
}

.seek-bar-container:hover .seek-bar-track {
  height: 6px;
}

.seek-bar-buffer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

.seek-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: var(--accent);
  border-radius: var(--radius-full);
}

.seek-bar-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background-color: var(--accent);
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.seek-bar-container:hover .seek-bar-thumb,
.seek-bar-container.dragging .seek-bar-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.btn-waveform-toggle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  padding: 4px;
}

.btn-waveform-toggle svg {
  width: 16px;
  height: 16px;
}

.btn-waveform-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.btn-waveform-toggle.active {
  color: var(--accent);
}

.seek-tooltip {
  position: absolute;
  bottom: 28px;
  left: 0;
  transform: translateX(-50%);
  background-color: #22262d;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.seek-bar-container:hover .seek-tooltip {
  opacity: 1;
}

/* Right: Utilities, Volume & Fullscreen */
.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: 280px;
  min-width: 220px;
}

.audio-engine-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-muted);
}

.engine-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.volume-slider-container {
  width: 90px;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
  position: relative;
}

.volume-track {
  width: 100%;
  height: 4px;
  background-color: #2b3038;
  border-radius: var(--radius-full);
  position: relative;
  transition: height var(--transition-fast);
}

.volume-slider-container:hover .volume-track {
  height: 5px;
}

.volume-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 80%;
  background-color: var(--accent);
  border-radius: var(--radius-full);
}

.volume-thumb {
  position: absolute;
  top: 50%;
  left: 80%;
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.volume-slider-container:hover .volume-thumb,
.volume-slider-container.dragging .volume-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   FULLSCREEN IMMERSIVE VISUALIZER MODAL
   ========================================================================== */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.fs-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #1b2028 0%, #0d0f12 100%);
  opacity: 0.98;
  backdrop-filter: blur(24px);
}

.fs-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  font-size: 28px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  z-index: 10;
  transition: all var(--transition-fast);
}

.fs-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  transform: scale(1.05);
}

.fs-content {
  position: relative;
  z-index: 5;
  width: 90%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.fs-visualizer-container {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#visualizerCanvas {
  width: 100%;
  height: 100%;
  max-width: 800px;
  border-radius: var(--radius-md);
}

.fs-card {
  display: flex;
  align-items: center;
  gap: 36px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px;
  border-radius: 18px;
  backdrop-filter: blur(16px);
  position: relative;
}

.fs-artwork {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  object-fit: cover;
  flex-shrink: 0;
}

.fs-info {
  flex: 1;
}

.fs-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
}

.fs-artist {
  font-size: 18px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.fs-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.fs-controls-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fs-timeline {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.fs-timeline span {
  font-size: 12px;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}

.fs-seek-track {
  flex: 1;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 4px;
}

.fs-waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.fs-seek-fill {
  display: none;
}

.fs-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.fs-ctrl-btn {
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.fs-ctrl-btn svg {
  width: 22px;
  height: 22px;
}

.fs-ctrl-btn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.fs-play-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: var(--text-inverted);
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: all var(--transition-fast);
}

.fs-play-btn svg {
  width: 24px;
  height: 24px;
}

.fs-play-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.08);
}

/* ==========================================================================
   MODALS (Playlist creation & Shortcuts)
   ========================================================================== */
.modal-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  width: 90%;
  max-width: 440px;
  background-color: #1a1d22;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-input {
  width: 100%;
  height: 42px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-primary);
  margin-top: 6px;
}

.modal-input:focus {
  border-color: var(--accent);
}

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

.btn-secondary {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.btn-primary {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-inverted);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Shortcuts Dialog */
.modal-shortcuts {
  max-width: 500px;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

/* Drag & Drop Overlay */
.drag-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 19, 22, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--accent);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.drag-drop-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drag-drop-box svg {
  width: 56px;
  height: 56px;
  color: var(--accent);
}

.drag-drop-box h3 {
  font-size: 22px;
  font-weight: 700;
}

.drag-drop-box p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background-color: #242930;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.75s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* ==========================================================================
   RESPONSIVENESS (Mobile & Tablet adaptivity)
   ========================================================================== */
@media (max-width: 1024px) {
  .carousel-track {
    gap: 16px;
  }
  .album-card {
    flex: 0 0 calc((100% - (2 * 16px)) / 3);
  }
  .col-plays {
    display: none;
  }
  .track-header-row,
  .track-row {
    grid-template-columns: 36px minmax(180px, 3fr) minmax(120px, 2fr) 60px 40px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .search-bar-wrapper {
    width: 200px;
  }
  .btn-import-text {
    display: none;
  }
  .album-card {
    flex: 0 0 calc((100% - 16px) / 2);
  }
  .player-right .volume-container,
  .player-right .audio-engine-badge {
    display: none;
  }
  .track-header-row,
  .track-row {
    grid-template-columns: 30px minmax(140px, 3fr) 50px 36px;
  }
  .col-artist {
    display: none;
  }
}

/* provibe: CSP-safe replacement for former inline style */
.queue-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 0;
}
