/* ─── albums.css — Album Maker Mode styles ─────────────────────────────── */

/* ── Mode Switcher Pill Nav ─────────────────────────────────────────────── */
.mode-switcher {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 40px;
  padding: 5px;
}

.mode-pill {
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  padding: 6px 16px;
  border-radius: 30px;
  transition: all 0.22s ease;
  white-space: nowrap;
}

.mode-pill:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.mode-pill.active {
  background: rgba(124, 92, 255, 0.35);
  color: #fff;
  border: 1px solid rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 14px rgba(124,92,255,0.3);
}

/* ── Albums Toolbar ─────────────────────────────────────────────────────── */
.albums-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  max-width: 1400px;
}

.albums-heading {
  font-family: Papyrus, fantasy;
  font-size: 1.5rem;
  color: #c8a96b;
  letter-spacing: 1px;
}

.mode-pill--scribe {
  border-left: 1px solid rgba(255,255,255,0.08);
  margin-left: 2px;
  color: rgba(255,255,255,0.45);
}

.mode-pill--scribe:hover {
  color: #fff;
  background: rgba(7, 85, 186, 0.25);
}

  box-shadow: 0 0 18px rgba(124,92,255,0.35);
}

.glow-btn:hover {
  box-shadow: 0 0 28px rgba(124,92,255,0.6);
}

/* ── Albums Grid ────────────────────────────────────────────────────────── */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  max-width: 1400px;
}

/* ── Album Card ─────────────────────────────────────────────────────────── */
.album-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.35s ease forwards;
}

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

.album-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(200,169,107,0.2);
  border-color: rgba(200,169,107,0.3);
}

.album-card-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

/* Mosaic grid for auto-covers */
.mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
}

.mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mosaic-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-card-cover img.full-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-card-name {
  font-family: Papyrus, fantasy;
  font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card-count {
  font-size: 0.75rem;
  opacity: 0.45;
}

/* Shuffle shortcut on card */
.album-card-shuffle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 13px;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-card:hover .album-card-shuffle {
  opacity: 1;
}

.album-card-shuffle:hover {
  background: rgba(200,169,107,0.7);
  transform: scale(1.1);
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  opacity: 0.5;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.hidden { display: none !important; }

/* ── Loading state ──────────────────────────────────────────────────────── */
.grid-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  opacity: 0.4;
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Mosaic fallback ────────────────────────────────────────────────────── */
.mosaic-empty {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ── Song list empty state ──────────────────────────────────────────────── */
.song-list-empty {
  opacity: 0.4;
  text-align: center;
  padding: 30px 0;
  font-style: italic;
}

/* ── View count (hidden by default, revealed on demand) ─────────────────── */
#albumViewCount {
  font-size: 0.75rem;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.2s;
  user-select: none;
}

#albumViewCount:hover { opacity: 0.7; }

/* ── Album Detail View ──────────────────────────────────────────────────── */
#albumDetailView {
  max-width: 960px;
}

.detail-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  padding: 8px 0;
  transition: color 0.2s;
}

.back-btn:hover { color: white; }

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-btn {
  border-color: rgba(255, 80, 80, 0.4) !important;
  color: #ff7070 !important;
}

.danger-btn:hover {
  background: rgba(255, 80, 80, 0.15) !important;
  box-shadow: 0 0 14px rgba(255, 80, 80, 0.3) !important;
}

/* Album Hero Section */
.album-hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.album-cover-wrap {
  position: relative;
  width: 200px;
  min-width: 200px;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

#mosaicCanvas {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  display: block;
}

#albumCoverImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.cover-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 18px;
}

.album-cover-wrap:hover .cover-edit-overlay {
  opacity: 1;
}

.album-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.album-name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.album-name {
  font-family: Papyrus, fantasy;
  font-size: 1.8rem;
  color: #e6e9ff;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.album-name:hover { opacity: 0.75; }

.album-name-input {
  font-family: Papyrus, fantasy;
  font-size: 1.8rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(124,92,255,0.5);
  border-radius: 10px;
  color: #e6e9ff;
  padding: 4px 12px;
  outline: none;
  width: 360px;
  max-width: 90vw;
}

.album-song-count {
  font-size: 0.85rem;
  opacity: 0.45;
}

.play-all-btn {
  margin-top: 8px;
  padding: 10px 22px;
  background: rgba(124, 92, 255, 0.25);
  border: 1px solid rgba(124, 92, 255, 0.55);
  color: #c9d1ff;
  border-radius: 14px;
  font-size: 0.95rem;
  cursor: pointer;
  width: fit-content;
  transition: all 0.2s ease;
}

.play-all-btn:hover {
  background: rgba(124,92,255,0.45);
  box-shadow: 0 0 20px rgba(124,92,255,0.4);
}

/* ── Album Song List ─────────────────────────────────────────────────────── */
.album-song-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.song-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.song-row:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(124,92,255,0.25);
}

.song-row.playing {
  background: rgba(124,92,255,0.12);
  border-color: rgba(124,92,255,0.4);
}

.song-row-num {
  width: 22px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.35;
  flex-shrink: 0;
}

.song-row.playing .song-row-num {
  opacity: 0;
}

.song-row-playing-icon {
  display: none;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  animation: pulseEq 1.2s ease-in-out infinite;
}

.song-row.playing .song-row-playing-icon {
  display: block;
}

@keyframes pulseEq {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

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

.song-row-info {
  flex: 1;
  min-width: 0;
}

.song-row-title {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-row-group {
  font-size: 0.75rem;
  opacity: 0.4;
  margin-top: 2px;
}

/* Drag handle */
.song-row-drag {
  cursor: grab;
  opacity: 0.25;
  font-size: 1rem;
  padding: 0 4px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.song-row:hover .song-row-drag { opacity: 0.6; }

.song-row-remove {
  background: none;
  border: none;
  color: rgba(255, 100, 100, 0.5);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.song-row:hover .song-row-remove {
  opacity: 1;
}

.song-row-remove:hover {
  color: #ff5555;
  background: rgba(255,80,80,0.1);
}

/* drag-over highlight */
.song-row.drag-over {
  border-color: #c8a96b;
  background: rgba(200,169,107,0.1);
}

.add-songs-btn {
  margin-top: 8px;
}

/* ── Song Picker Overlay ─────────────────────────────────────────────────── */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 12, 0.7);
  backdrop-filter: blur(14px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.picker-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.picker-container {
  background: rgba(18, 18, 28, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  width: 90%;
  max-width: 660px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  overflow: hidden;
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 14px;
  flex-shrink: 0;
}

.picker-header h3 {
  font-family: Papyrus, fantasy;
  font-size: 1.1rem;
  color: #c8a96b;
}

.picker-header h3 span {
  color: #e6e9ff;
}

.picker-search {
  margin: 0 24px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 14px;
  color: #e6e9ff;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.picker-search:focus {
  border-color: rgba(124,92,255,0.5);
}

.picker-sections {
  overflow-y: auto;
  flex: 1;
  padding: 0 24px;
}

.picker-group-label {
  font-family: Papyrus, fantasy;
  font-size: 0.82rem;
  color: #c8a96b;
  opacity: 0.7;
  padding: 12px 0 6px;
  letter-spacing: 0.5px;
}

.picker-song-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.picker-song-row:hover {
  background: rgba(255,255,255,0.05);
}

.picker-song-row.selected {
  background: rgba(124,92,255,0.14);
}

.picker-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
  background: transparent;
}

.picker-song-row.selected .picker-checkbox {
  background: #7C5CFF;
  border-color: #7C5CFF;
}

.picker-song-row.selected .picker-checkbox::after {
  content: "✓";
  color: white;
}

.picker-song-cover {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
}

.picker-song-title {
  flex: 1;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Already-in-album indicator */
.picker-song-row.already-in {
  opacity: 0.35;
  pointer-events: none;
}

.already-badge {
  font-size: 0.7rem;
  background: rgba(124,92,255,0.2);
  border: 1px solid rgba(124,92,255,0.3);
  color: #c9d1ff;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

.picker-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

#pickerSelectedCount {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ── Export Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 45, 0.95);
  border: 1px solid rgba(124,92,255,0.4);
  color: #c9d1ff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .album-hero { flex-direction: column; }
  .album-cover-wrap { width: 160px; min-width: 160px; }
  .album-name { font-size: 1.4rem; }
  .detail-topbar { flex-direction: column; align-items: flex-start; }
}

/* ── Suppress old standalone contribute-link (now inside pill nav) ───────── */
.contribute-link { display: none !important; }

/* ── Keep top-bar centred with pill nav as the sole right element ────────── */
.top-bar {
  justify-content: center;
  gap: 0;
}

.top-bar .app-title {
  flex: 1;
}