/* ==========================================================================
   Mkaz Music MP3 Player — PC / Desktop layout
   (base.css is linked separately in index-pc.php, loaded before this file)
   ========================================================================== */

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: #000000;
  padding: 20px 16px calc(var(--player-height) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }

.nav-section { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-item:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.nav-item.active { background: var(--bg-surface); color: var(--text-primary); }

/* ---------- Library (Your Library, Spotify-style) ---------- */
.library-section { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.library-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 0; }
.library-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.library-add-btn {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-surface-hover);
  border: none; color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
}
.library-add-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
.library-add-btn svg { width: 14px; height: 14px; }

.library-filters { display: flex; gap: 6px; padding: 0 8px; flex-wrap: wrap; }
.library-filter {
  background: var(--bg-surface-hover); border: none; color: var(--text-secondary);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 14px;
}
.library-filter:hover { color: var(--text-primary); }
.library-filter.active { background: var(--text-primary); color: #000; }

.library-list { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; min-height: 0; }
.library-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px;
  background: none; border: none; width: 100%; text-align: left;
}
.library-row:hover { background: var(--bg-surface-hover); }
.library-row.active { background: var(--bg-surface-hover); }
.library-row.active .name { color: var(--accent); }
.library-row-cover {
  width: 40px; height: 40px; border-radius: 4px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #2a2a2d, #1a1a1c); display: flex; align-items: center; justify-content: center;
}
.library-row-cover.round { border-radius: 50%; }
.library-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.library-row-cover svg { width: 44%; height: 44%; color: var(--text-muted); }
.library-row-meta { min-width: 0; }
.library-row-meta .name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-row-meta .type { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }


/* ---------- Main content ---------- */
.main {
  overflow-y: auto;
  padding-bottom: calc(var(--player-height) + 24px);
  background: linear-gradient(180deg, #1a1a1d 0%, var(--bg-base) 320px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  backdrop-filter: blur(12px);
  background: rgba(11,11,13,0.7);
}

.search-box {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px;
}
.search-box input { flex: 1; background: none; border: none; outline: none; color: var(--text-primary); font-size: 14px; }
.search-box svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

/* ---------- Topbar nav pills (back/forward) ---------- */
.topbar-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-pill {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.7);
  border: none; color: var(--text-primary); display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s; flex-shrink: 0;
}
.nav-pill:hover:not(:disabled) { background: rgba(0,0,0,0.9); transform: scale(1.06); }
.nav-pill:disabled { color: var(--text-muted); opacity: 0.45; cursor: default; }
.nav-pill svg { width: 15px; height: 15px; }

/* ---------- Topbar profile menu ---------- */
.topbar-profile { position: relative; margin-left: auto; flex-shrink: 0; }
.profile-btn {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg-surface-hover);
  border: none; color: var(--text-primary); display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.profile-btn:hover { background: var(--bg-elevated); }
.profile-btn svg { width: 17px; height: 17px; }

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.5);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.profile-menu.open { display: flex; }
.profile-menu button, .profile-menu a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 4px;
}
.profile-menu button:hover, .profile-menu a:hover { background: var(--bg-surface-hover); }

.page-heading { padding: 8px 32px 20px; }
.page-heading h1 { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 0 0 4px; letter-spacing: -0.5px; }
.page-heading p { margin: 0; color: var(--text-secondary); font-size: 14px; }

/* ---------- Detail headers (artist / album / playlist) ---------- */
.detail-header {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 12px 32px 28px;
}

.detail-cover {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2a2a2d, #1a1a1c);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
}
.detail-cover.round { border-radius: 50%; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover svg { width: 34%; height: 34%; color: var(--text-muted); }

.detail-meta .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); font-weight: 700; margin-bottom: 8px; }
.detail-meta h1 { font-family: var(--font-display); font-weight: 800; font-size: 42px; margin: 0 0 10px; letter-spacing: -0.8px; line-height: 1.05; }
.detail-meta .sub { font-size: 13.5px; color: var(--text-secondary); }
.detail-meta .bio { font-size: 13px; color: var(--text-secondary); max-width: 560px; margin-top: 8px; line-height: 1.5; }

.detail-actions { padding: 0 32px 20px; display: flex; align-items: center; gap: 14px; }
.play-all-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(29,185,84,0.35);
}
.play-all-btn:hover { background: var(--accent-hover); transform: scale(1.04); }
.play-all-btn svg { width: 22px; height: 22px; margin-left: 3px; }

/* ---------- Album grid (inside artist screen) ---------- */
.section-label { padding: 8px 32px 12px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
  padding: 0 32px 28px;
}
.album-card { background: var(--bg-surface); border-radius: var(--radius); padding: 12px; transition: background 0.2s; }
.album-card:hover { background: var(--bg-surface-hover); }
.album-cover-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; margin-bottom: 10px; background: linear-gradient(135deg, #2a2a2d, #1a1a1c); display: flex; align-items: center; justify-content: center; }
.album-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-wrap svg { width: 36%; height: 36%; color: var(--text-muted); }
.album-card .a-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card .a-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Playlist / Artist grid (browse screens) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
  padding: 0 32px 32px;
}
.tile-card { background: var(--bg-surface); border-radius: var(--radius); padding: 14px; transition: background 0.2s; }
.tile-card:hover { background: var(--bg-surface-hover); }
.tile-cover { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; margin-bottom: 12px; background: linear-gradient(135deg, #2a2a2d, #1a1a1c); display: flex; align-items: center; justify-content: center; }
.tile-cover.round { border-radius: 50%; }
.tile-cover img { width: 100%; height: 100%; object-fit: cover; }
.tile-cover svg { width: 38%; height: 38%; color: var(--text-muted); }
.tile-card .t-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-card .t-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Card hover play button (Spotify-style) ---------- */
.card-play-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
}
.card-play-btn svg { width: 18px; height: 18px; margin-left: 2px; }
.tile-card:hover .card-play-btn,
.album-card:hover .card-play-btn,
.card-play-btn:focus-visible {
  opacity: 1;
  transform: translateY(0);
}
.card-play-btn:hover { background: var(--accent-hover); transform: translateY(0) scale(1.05); }

/* ---------- Song list ---------- */
.song-list { padding: 0 32px 32px; display: flex; flex-direction: column; }

.song-list-head {
  display: grid;
  grid-template-columns: 32px 1fr 160px 90px 40px;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.song-row {
  display: grid;
  grid-template-columns: 32px 1fr 160px 90px 40px;
  gap: 14px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  position: relative;
}
.song-row:hover { background: var(--bg-surface-hover); }
.song-row.playing .idx-number { color: var(--accent); }
.song-row.playing .song-title { color: var(--accent); }

.idx-cell { display: flex; align-items: center; justify-content: center; width: 24px; }
.idx-number { color: var(--text-secondary); font-size: 13px; }
.idx-play-btn { display: none; background: none; border: none; color: var(--text-primary); width: 24px; height: 24px; align-items: center; justify-content: center; }
.idx-play-btn svg { width: 13px; height: 13px; }
.song-row:hover .idx-number { display: none; }
.song-row:hover .idx-play-btn { display: flex; }
.song-row.playing .idx-number { display: none; }
.song-row.playing .idx-play-btn { display: flex; color: var(--accent); }

.song-title-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.song-thumb { width: 40px; height: 40px; border-radius: 4px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #2a2a2d, #1a1a1c); display: flex; align-items: center; justify-content: center; }
.song-thumb img { width: 100%; height: 100%; object-fit: cover; }
.song-thumb svg { width: 44%; height: 44%; color: var(--text-muted); }
.song-title-text { min-width: 0; }
.song-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.song-album-cell { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-duration-cell { font-size: 13px; color: var(--text-secondary); text-align: right; }

.song-fav-btn { background: none; border: none; color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; opacity: 0; }
.song-row:hover .song-fav-btn, .song-fav-btn.active { opacity: 1; }
.song-fav-btn.active { color: var(--accent); }
.song-fav-btn svg { width: 15px; height: 15px; }

.empty-state { padding: 60px 32px; text-align: center; color: var(--text-secondary); }
.empty-state svg { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 12px; }

/* ---------- Player bar ---------- */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-height);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 0 20px;
  z-index: 20;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.player-bar.visible { transform: translateY(0); }

.player-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-cover {
  width: 56px; height: 56px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #2a2a2d, #1a1a1c); display: flex; align-items: center; justify-content: center;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-cover svg { width: 40%; height: 40%; color: var(--text-muted); }
.player-meta { min-width: 0; }
.player-meta .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta .artist { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-fav-btn { background: none; border: none; color: var(--text-muted); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.player-fav-btn.active { color: var(--accent); }
.player-fav-btn svg { width: 14px; height: 14px; }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.control-row { display: flex; align-items: center; gap: 18px; }

.transport-btn { background: none; border: none; color: var(--text-secondary); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.transport-btn:hover { color: var(--text-primary); }
.transport-btn.active { color: var(--accent); }
.transport-btn svg { width: 17px; height: 17px; }

.play-pause-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--text-primary); border: none; color: #000;
  display: flex; align-items: center; justify-content: center; transition: transform 0.1s;
}
.play-pause-btn:hover { transform: scale(1.06); }
.play-pause-btn svg { width: 15px; height: 15px; }

.seek-row { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 480px; }
.time-label { font-size: 11px; color: var(--text-muted); width: 36px; flex-shrink: 0; }
.time-label.end { text-align: right; }

.player-extra { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.icon-btn {
  background: none; border: none; color: var(--text-secondary); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 6px; position: relative;
}
.icon-btn:hover { color: var(--text-primary); background: var(--bg-surface-hover); }
.icon-btn.active { color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }

.volume-row { display: flex; align-items: center; gap: 8px; width: 110px; }

/* ---------- Lyrics panel ---------- */
.lyrics-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--player-height);
  width: 380px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 30;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.lyrics-panel.open { transform: translateX(0); }
.lyrics-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.lyrics-panel-header h2 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.lyrics-panel-close { background: none; border: none; color: var(--text-secondary); font-size: 20px; width: 28px; height: 28px; }
.lyrics-panel-close:hover { color: var(--text-primary); }
.lyrics-body { padding: 20px; overflow-y: auto; white-space: pre-line; font-size: 14.5px; line-height: 1.9; color: var(--text-secondary); }
.lyrics-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px; }
