/* ============================================================
   albums.css — v4.0 (clean hero, interactive cover, ghost links)
   ============================================================ */

/* ── Card grid (unchanged) ─────────────────────────────────── */
.alb-card {
  border-radius: 16px;
  background: var(--bg-card, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07), 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.alb-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.13);
}
.alb-card:active {
  transform: scale(0.97);
}
.dark-mode .alb-card {
  background: var(--bg-card, #1c1c1e);
}

/* ── Sort pills & badge (unchanged) ───────────────────────── */
.sort-pill {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.sort-pill.active {
  background: var(--accent, #ef4444);
  color: white;
}
.sort-pill.inactive {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}
.dark-mode .sort-pill.inactive {
  background: rgba(255, 255, 255, 0.08);
}
.album-count-badge {
  background: rgba(0, 0, 0, 0.05);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.dark-mode .album-count-badge {
  background: rgba(255, 255, 255, 0.08);
}

/* ── Album detail root & hero (updated for v4.0) ──────────── */
.album-detail-root {
  position: relative;
}
.album-hero-backdrop {
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}
.album-hero-blur-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(60px) brightness(0.7);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.album-art-hero {
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
  background: var(--bg-card);
  transition: transform 0.2s ease;
}
/* Interactive overlay on album art (new) */
.album-art-hero-wrapper {
  position: relative;
  display: inline-block;
}
.album-art-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}
.album-art-hero-wrapper:hover .album-art-overlay,
.album-art-hero-wrapper:active .album-art-overlay {
  opacity: 1;
}
.overlay-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.1s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.overlay-btn:active {
  transform: scale(0.92);
  background: white;
}
.overlay-btn svg {
  width: 20px;
  height: 20px;
  color: #1c1c1e;
}
.overlay-btn.shuffle-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
}
.overlay-btn.shuffle-btn svg {
  width: 18px;
  height: 18px;
}
.dark-mode .overlay-btn {
  background: rgba(28, 28, 30, 0.95);
}
.dark-mode .overlay-btn svg {
  color: #f5f5f7;
}

/* Ghost action links (below album info) */
.ghost-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.6;
  transition: opacity 0.15s ease;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 20px;
}
.ghost-action-link:hover,
.ghost-action-link:active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
}
.dark-mode .ghost-action-link:hover,
.dark-mode .ghost-action-link:active {
  background: rgba(255, 255, 255, 0.08);
}
.ghost-action-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}
.ghost-action-link.danger {
  color: #ff3b30;
  opacity: 0.8;
}
.ghost-action-link.danger:hover {
  opacity: 1;
}

/* Deprecated old button styles (kept for backward compatibility, but not used in v4.0) */
.album-action-btn-primary,
.album-action-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}
.album-action-btn-primary {
  background: var(--accent, #ef4444);
  color: white;
  border: none;
}
.album-action-btn-primary:active {
  transform: scale(0.96);
  opacity: 0.8;
}
.album-action-btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}
.dark-mode .album-action-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
}
.album-action-btn-secondary:active {
  transform: scale(0.96);
  background: rgba(0, 0, 0, 0.1);
}

/* ── Song list card (unchanged) ────────────────────────────── */
.song-list-card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* ── Track number column (unchanged) ──────────────────────── */
.track-num {
  width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ── Swipe rows (unchanged) ───────────────────────────────── */
.song-row-wrap {
  position: relative;
  overflow: hidden;
  background-color: #f2f2f7;
}
.dark-mode .song-row-wrap {
  background-color: #111111;
}
/* position:relative is required for the OSCR.Swipe overlay child */
.song-row-surface {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  background-color: var(--bg-card, #ffffff);
  transition: background-color 0.15s ease;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.dark-mode .song-row-surface {
  background-color: var(--bg-card, #1c1c1e);
}

.song-action-left {
  left: 8px;
  background: linear-gradient(135deg, #34c759, #28a745);
}
.song-action-right {
  right: 8px;
  background: linear-gradient(135deg, #ff3b30, #d11a2a);
}
.song-row-wrap.swiped-left .song-action-left {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
.song-row-wrap.swiped-right .song-action-right {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
.song-row-surface:hover {
  background-color: #f2f2f7;
}
.song-row-surface:active {
  background-color: #e5e5ea;
}
.dark-mode .song-row-surface:hover {
  background-color: #2c2c2e;
}
.dark-mode .song-row-surface:active {
  background-color: #3a3a3c;
}

/* ── Playing bars (unchanged) ────────────────────────────── */
.playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 14px;
  width: 14px;
}
.playing-bars span {
  flex: 1;
  background: #ef4444;
  border-radius: 2px;
  animation: playingPulse 0.8s ease infinite;
}
@keyframes playingPulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

/* ── Context menu for albums (optional, kept from previous) ─ */
.album-ctx-menu {
  position: fixed;
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  width: 220px;
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.98);
}
.dark-mode .album-ctx-menu {
  background: rgba(28, 28, 30, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}
.album-ctx-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}
.album-ctx-header img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}
.album-ctx-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}
.album-ctx-sub {
  font-size: 11px;
  color: var(--text-secondary);
}
.album-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text-primary);
}
.album-ctx-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.album-ctx-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
.dark-mode .album-ctx-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.album-ctx-item.danger {
  color: #ff3b30;
}
.album-ctx-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 4px 0;
}
.dark-mode .album-ctx-divider {
  background: rgba(255, 255, 255, 0.08);
}

/* ── OSCR vertical dropdown (gear menu) ───────────────────── */
.extra-actions-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 6px 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}
.extra-actions-panel.oscr-open {
  display: flex;
}
.extra-actions-panel button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  transition: background 0.12s;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.extra-actions-panel button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.extra-actions-panel button:hover {
  background: rgba(255, 255, 255, 0.12);
}
.extra-actions-panel button:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.98);
}
.extra-actions-panel .danger-btn {
  color: #ffb3b0;
}