/* ── Utility ── */
.gp-hidden { display: none !important; }
.gp-invisible { visibility: hidden !important; pointer-events: none !important; }

/* ── Z-index layers (centralized) ── */
:root {
  --z-nav-bar: 9998;
  --z-player-bar: 9999;
  --z-now-playing: 10000;
  --z-action-sheet-overlay: 10001;
  --z-action-sheet: 10002;
  --z-popup-modal: 10050;
  --z-signup-banner: 10000;
  --z-toast: 10100;
  --z-offcanvas: 10200;
}

/* ── Global Persistent Player Bar (Spotify-style) ── */
#global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-player-bar);
  background: rgba(24,24,24,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.05);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
#global-player.active { transform: translateY(0); }
#global-player.modal-hidden { transform: translateY(100%) !important; }
.gp-nav.modal-hidden { transform: translateY(100%) !important; }

body.gp-active { padding-bottom: 120px; }

/* ── 3-column layout ── */
.gp-content {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 2fr) minmax(240px, 1fr);
  align-items: center;
  padding: 12px 28px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  height: 110px;
  box-sizing: border-box;
}

/* ── LEFT column ── */
.gp-col-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.gp-artwork {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.gp-info {
  flex: 1;
  min-width: 0;
}
.gp-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.gp-artist {
  font-size: 0.85rem;
  color: #b3b3b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── HD Quality Badge ── */
.gp-quality-badge {
  display: none;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--brand-primary);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  line-height: 1.4;
}
.gp-quality-badge.active { display: inline; }

/* ── CENTER column ── */
.gp-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.gp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Progress row */
.gp-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.gp-time {
  font-size: 0.75rem;
  color: #a7a7a7;
  flex-shrink: 0;
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}
.gp-time-current { text-align: right; }
.gp-time-total { text-align: left; }

.gp-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.gp-progress:hover { height: 6px; }
.gp-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0;
  pointer-events: none;
  transition: background 0.2s;
  position: relative;
}
.gp-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
}
.gp-progress:hover .gp-progress-fill { background: var(--brand-primary); }
.gp-progress:hover .gp-progress-fill::after { opacity: 1; }

/* ── RIGHT column ── */
.gp-col-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Buttons ── */
.gp-btn {
  background: none;
  border: none;
  color: #a7a7a7;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.1s;
}
.gp-btn:hover { color: #fff; }
.gp-btn svg { width: 27px; height: 27px; fill: currentColor; }

/* Play button - Spotify circle */
.gp-btn.gp-play-btn {
  background: #fff;
  color: #000;
  width: 48px;
  height: 48px;
  padding: 0;
}
.gp-btn.gp-play-btn:hover {
  transform: scale(1.06);
  background: #fff;
  color: #000;
  box-shadow: 0 4px 12px rgba(255,255,255,0.15);
}
.gp-btn.gp-play-btn svg { width: 27px; height: 27px; fill: #000; }

/* Like button - player bar */
.gp-like-btn svg { width: 27px; height: 27px; fill: none; stroke: #a7a7a7; stroke-width: 2; }
.gp-like-btn:hover svg { stroke: #fff; }
.gp-like-btn.liked svg { fill: var(--color-like); stroke: var(--color-like); }

/* Minimize button (top-right corner of player bar) */
.gp-minimize-btn {
  position: absolute;
  top: 2px;
  right: 6px;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 2px;
  z-index: 1;
  line-height: 0;
}
.gp-minimize-btn:hover { color: #fff; }
.gp-minimize-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* AirPlay button on player bar */
.gp-btn.gp-airplay-btn { color: #a7a7a7; }
.gp-btn.gp-airplay-btn:hover { color: #fff; }
.gp-btn.gp-airplay-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* Restore player button (floating, visible when minimized) */
.gp-restore-btn {
  display: none;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: var(--z-player-bar);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.gp-restore-btn:hover { transform: scale(1.1); }
.gp-restore-btn svg { width: 24px; height: 24px; fill: currentColor; }
/* When nav bar visible on mobile, lift restore btn above it */
body.gp-nav-visible .gp-restore-btn { bottom: 72px; }

.gp-speed {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 2px 6px;
  color: #a7a7a7;
}
.gp-speed:hover { color: #fff; border-color: #fff; }

/* Non-paid: speed button shows as premium hint (click → toast upsell) */
.gp-speed-disabled {
  opacity: 0.5;
  cursor: pointer;
}

/* ── Bar speed picker (mirrors popup speed picker) ── */
.gp-bar-speed-wrap { position: relative; }
.gp-bar-speed-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 8px 4px;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 10;
  min-width: 64px;
}
.gp-bar-speed-picker.open { display: flex; }
.gp-bar-speed-picker button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.gp-bar-speed-picker button:hover { background: rgba(255,255,255,0.1); color: #fff; }
.gp-bar-speed-picker button.active { color: var(--brand-primary); }

/* ── Volume ── */
.gp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gp-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.gp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.gp-volume-wrap:hover .gp-volume-slider::-webkit-slider-thumb { opacity: 1; }
.gp-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}
.gp-volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #fff var(--volume-pct, 100%), rgba(255,255,255,.15) var(--volume-pct, 100%));
  border-radius: 2px;
  height: 4px;
}
.gp-volume-wrap:hover .gp-volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--brand-primary) var(--volume-pct, 100%), rgba(255,255,255,.15) var(--volume-pct, 100%));
}

/* ── Queue button badge ── */
.gp-queue-btn { position: relative; }
.gp-queue-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--brand-primary);
  color: #000;
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.gp-queue-badge:empty { display: none; }

/* ── Queue panel (hidden — replaced by Now Playing popup) ── */
.gp-queue-panel { display: none; }

.gp-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
  color: #a7a7a7;
}
.gp-queue-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.gp-queue-item.active { background: var(--brand-primary-muted); color: #fff; }

.gp-queue-item .gp-qi-num {
  font-size: 0.7rem;
  color: #666;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.gp-queue-item.active .gp-qi-num { color: var(--brand-primary); }

.gp-queue-item .gp-qi-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.gp-queue-item .gp-qi-info { flex: 1; min-width: 0; overflow: hidden; }
.gp-queue-item .gp-qi-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-queue-item .gp-qi-artist {
  font-size: 0.68rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-queue-item .gp-qi-remove {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  transition: all 0.2s;
}
.gp-queue-item .gp-qi-remove:hover { color: #e94560; background: rgba(233,69,96,.1); }
.gp-queue-item .gp-qi-remove svg { width: 14px; height: 14px; fill: currentColor; }
.gp-queue-item.active .gp-qi-remove { visibility: hidden; }

/* ── Mobile (<640px) ── */
@media (max-width: 640px) {
  body.gp-active { padding-bottom: 64px; }
  body.gp-nav-visible { padding-bottom: 56px; }
  body.gp-nav-visible.gp-active { padding-bottom: 120px; }

  .gp-content {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    height: 64px;
    position: relative;
  }

  /* Mobile progress bar on top via pseudo-element */
  .gp-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: var(--gp-progress, 0%);
    background: var(--brand-primary);
    transition: width 0.3s linear;
  }

  .gp-artwork { width: 46px; height: 46px; border-radius: 6px; }

  .gp-col-left {
    flex: 1;
    min-width: 0;
  }

  /* Hide desktop center column on mobile, show like button */
  .gp-col-center { display: none; }
  .gp-like-btn { display: flex; }

  /* Smaller text on mobile */
  .gp-title { font-size: 0.8125rem; }
  .gp-artist { font-size: 0.75rem; }

  /* Right col: simplified mobile controls */
  .gp-col-right { gap: 0; }
  .gp-volume-wrap,
  .gp-bar-speed-wrap,
  .gp-airplay-btn,
  .gp-minimize-btn,
  .gp-queue-btn { display: none; }

  /* Show play + next on mobile right */
  .gp-col-right .gp-play-btn,
  .gp-col-right .gp-next-btn { display: flex; }

  /* Hide prev on mobile */
  .gp-col-right .gp-prev-btn { display: none; }
}

/* ── Mobile: move play/next controls to right col ── */
/* On mobile, the center col is hidden. We need play/next visible.
   Since they're in center col (hidden on mobile), we clone them via JS.
   OR we use CSS to show specific buttons.
   Approach: On mobile, unhide the .gp-col-right play/next that are actually
   in .gp-col-center. We'll handle this with JS mobile clone approach. */

/* Mobile play controls injected by JS */
.gp-mobile-controls {
  display: none;
}
@media (max-width: 640px) {
  .gp-mobile-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }
  .gp-mobile-controls .gp-btn { padding: 6px; }
  .gp-mobile-controls .gp-btn svg { width: 24px; height: 24px; }
  .gp-mobile-controls .gp-play-btn {
    background: #fff;
    color: #000;
    width: 32px;
    height: 32px;
    padding: 0;
  }
  .gp-mobile-controls .gp-play-btn svg { width: 20px; height: 20px; fill: #000; }

  /* Hide the col-right entirely on mobile since we use mobile-controls */
  .gp-col-right { display: none; }
}

/* ══════════════════════════════════════════════════════
   Now Playing Popup (Spotify mobile expanded view)
   ══════════════════════════════════════════════════════ */

/* ── Overlay ── */
.gp-popup {
  position: fixed;
  inset: 0;
  z-index: var(--z-now-playing);
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
}
.gp-popup.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Blurred background ── */
.gp-popup-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.3);
  transform: scale(1.3);
}
.gp-popup-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

/* ── Inner container ── */
.gp-popup-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 24px 32px;
  overflow-y: auto;
  max-height: 100vh;
  box-sizing: border-box;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  will-change: transform;
}
.gp-popup.open .gp-popup-inner {
  transform: translateY(0);
  opacity: 1;
}

/* ── Header ── */
.gp-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 24px;
}
.gp-popup-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.gp-popup-close:hover { opacity: 1; }
.gp-popup-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.gp-popup-share {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
  width: 28px;
}
.gp-popup-share:hover { opacity: 1; }

/* ── Artwork ── */
.gp-popup-artwork {
  width: 280px;
  height: 280px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  background: var(--bg-surface);
  margin-bottom: 32px;
}

/* ── Info + bookmark ── */
.gp-popup-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-bottom: 24px;
}
.gp-popup-info-text {
  flex: 1;
  min-width: 0;
}
.gp-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gp-popup-artist {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}
/* ── Progress bar ── */
.gp-popup-progress {
  width: 100%;
  margin-bottom: 24px;
}
.gp-popup-pbar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  transition: height 0.15s;
}
.gp-popup-pbar:hover { height: 6px; }
.gp-popup-pfill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0;
  pointer-events: none;
  transition: background 0.2s;
}
.gp-popup-pbar:hover .gp-popup-pfill { background: var(--brand-primary); }
.gp-popup-pthumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.gp-popup-pbar:hover .gp-popup-pthumb { opacity: 1; }
.gp-popup-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
}

/* ── Controls ── */
.gp-popup-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}
.gp-popup-prev,
.gp-popup-next {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  display: flex;
  transition: transform 0.1s, opacity 0.2s;
  opacity: 0.8;
}
.gp-popup-prev:hover,
.gp-popup-next:hover { opacity: 1; }
.gp-popup-prev svg,
.gp-popup-next svg { width: 36px; height: 36px; fill: currentColor; }

.gp-popup-play {
  background: #fff;
  border: none;
  color: #000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.gp-popup-play:hover { transform: scale(1.06); }
.gp-popup-play svg { width: 28px; height: 28px; fill: #000; }

/* Speed button + picker (in controls row) */
.gp-popup-speed-wrap { position: relative; }
.gp-popup-speed {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 36px;
  text-align: center;
}
.gp-popup-speed:hover { border-color: #fff; color: #fff; }

/* Non-paid: disable popup speed button (uses .gp-speed-disabled class) */
.gp-popup-speed-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 8px 4px;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 10;
  min-width: 64px;
}
.gp-popup-speed-picker.open { display: flex; }
.gp-popup-speed-picker button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.gp-popup-speed-picker button:hover { background: rgba(255,255,255,0.1); color: #fff; }
.gp-popup-speed-picker button.active { color: var(--brand-primary); }

/* AirPlay button */
.gp-popup-airplay {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  display: flex;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.gp-popup-airplay:hover { opacity: 1; }
.gp-popup-airplay svg { width: 24px; height: 24px; fill: currentColor; }

/* Like button - popup */
.gp-popup-like { background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0; }
.gp-popup-like svg { width: 24px; height: 24px; fill: none; stroke: rgba(255,255,255,0.7); stroke-width: 2; }
.gp-popup-like:hover svg { stroke: #fff; }
.gp-popup-like.liked svg { fill: var(--color-like); stroke: var(--color-like); }

/* AI Insights - shared label */
.gp-ai-label {
  font-family: 'Inter Variable', system-ui, sans-serif;
  font-weight: 900; font-size: 20px; letter-spacing: -1px;
  color: rgba(255,255,255,0.5);
}

/* AI Insights button - popup */
.gp-popup-ai { background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0; margin-left: 4px; }
.gp-popup-ai .gp-ai-label { font-size: 22px; }
.gp-popup-ai:hover .gp-ai-label { color: var(--brand-primary); }
.gp-popup-ai.disabled { opacity: 0.3; cursor: not-allowed; }

/* AI Insights button - bar */
.gp-ai-btn { margin-left: 2px; }
.gp-ai-btn:hover .gp-ai-label { color: var(--brand-primary); }
.gp-ai-btn.disabled { opacity: 0.3; cursor: not-allowed; }
.gp-ai-btn.disabled:hover .gp-ai-label { color: rgba(255,255,255,0.5); }
@media (max-width: 640px) {
  .gp-ai-btn { display: none; }
}

/* AI Insights toast */
.insights-toast {
  position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%);
  background: rgba(30,30,30,0.95); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; opacity: 0; transition: opacity 0.3s; z-index: 10000;
  pointer-events: none; white-space: nowrap; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
}
.insights-toast.show { opacity: 1; }

/* ── Popup tabs ── */
.gp-popup-tabs {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.gp-popup-tab-header {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.gp-popup-tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.gp-popup-tab:hover { color: rgba(255,255,255,0.7); }
.gp-popup-tab.active { color: #fff; border-bottom-color: var(--brand-primary); }
.gp-popup-tab.gp-tab-disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.gp-popup-tab-pane { display: none; }
.gp-popup-tab-pane.active { display: block; }

/* ── Queue actions ── */
.gp-popup-queue-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px 0;
}
.gp-popup-qclear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
.gp-popup-qclear:hover { color: var(--brand-primary); background: var(--brand-primary-muted); }
.gp-popup-qlist {
  max-height: none;
  overflow-y: auto;
}
.gp-popup-qlist::-webkit-scrollbar { width: 4px; }
.gp-popup-qlist::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Reuse queue item styles in popup — larger thumbs */
.gp-popup-qlist .gp-queue-item { border-radius: 6px; }
.gp-popup-qlist .gp-qi-thumb { width: 58px; height: 58px; border-radius: 6px; }
.gp-popup-qlist .gp-qi-title { font-size: 0.98rem; }
.gp-popup-qlist .gp-qi-artist { font-size: 0.82rem; }

/* ── Liked list ── */
.gp-popup-liked-empty {
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
  padding: 32px 0;
}
.gp-popup-liked-list {
  max-height: none;
  overflow-y: auto;
}
.gp-popup-liked-list::-webkit-scrollbar { width: 4px; }
.gp-popup-liked-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.gp-popup-liked-list .gp-queue-item { border-radius: 6px; }
.gp-popup-liked-list .gp-qi-thumb { width: 58px; height: 58px; border-radius: 6px; }
.gp-popup-liked-list .gp-qi-title { font-size: 0.98rem; }
.gp-popup-liked-list .gp-qi-artist { font-size: 0.82rem; }
.gp-qi-unlike {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  transition: all 0.2s;
}
.gp-qi-unlike svg { width: 18px; height: 18px; fill: var(--color-like); stroke: var(--color-like); }
.gp-qi-unlike:hover { background: rgba(239,68,68,0.15); }
.gp-qi-unlike:hover svg { fill: #f87171; stroke: #f87171; }
.gp-popup-liked-playall {
  display: block;
  width: calc(100% - 32px);
  margin: 12px auto;
  padding: 10px;
  background: var(--brand-primary-muted);
  border: 1px solid rgba(233,69,96,0.3);
  border-radius: 8px;
  color: var(--brand-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.gp-popup-liked-playall:hover { background: rgba(233,69,96,0.25); }

/* ── History list (reuse liked styles) ── */
.gp-popup-history-empty {
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
  padding: 32px 0;
}
.gp-popup-history-list {
  max-height: none;
  overflow-y: auto;
}
.gp-popup-history-list .gp-queue-item { border-radius: 6px; }
.gp-popup-history-list .gp-qi-thumb { width: 58px; height: 58px; border-radius: 6px; }
.gp-popup-history-list .gp-qi-title { font-size: 0.98rem; }
.gp-popup-history-list .gp-qi-artist { font-size: 0.82rem; }

/* ── Drag handle (queue reorder) ── */
.gp-qi-drag {
  background: none;
  border: none;
  color: #555;
  cursor: grab;
  padding: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  transition: all 0.2s;
  touch-action: none;
}
.gp-qi-drag:hover { color: #fff; background: rgba(255,255,255,.1); }
.gp-qi-drag:active { cursor: grabbing; }
.gp-qi-drag svg { width: 18px; height: 18px; fill: currentColor; }
.gp-queue-item.active .gp-qi-drag { visibility: hidden; }
.gp-queue-item.dragging { opacity: 0.5; background: rgba(233,69,96,.15); border-radius: 6px; }
.gp-qi-placeholder { background: rgba(233,69,96,.08); border: 1px dashed rgba(233,69,96,.3); border-radius: 6px; }

/* ── Three-dot more button (queue + liked items) ── */
.gp-qi-more {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  transition: all 0.2s;
}
.gp-qi-more:hover { color: #fff; background: rgba(255,255,255,.1); }
.gp-qi-more svg { width: 18px; height: 18px; fill: currentColor; }
.gp-queue-item.active .gp-qi-more { visibility: hidden; }

/* ── Three-dot on spotify cards ── */
.spotify-card .sc-more-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2;
}
.spotify-card .sc-more-btn svg { width: 18px; height: 18px; fill: currentColor; }
.spotify-card:hover .sc-more-btn,
.spotify-card .sc-more-btn:focus { opacity: 1; transform: translateY(0); }
@media (max-width: 640px) {
  .spotify-card .sc-more-btn { opacity: 1; transform: translateY(0); }
}

/* ── Three-dot on post cards ── */
.post-card .sc-more-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2;
}
.post-card .sc-more-btn svg { width: 18px; height: 18px; fill: currentColor; }
.post-card:hover .sc-more-btn,
.post-card .sc-more-btn:focus { opacity: 1; transform: translateY(0); }
@media (max-width: 640px) {
  .post-card .sc-more-btn { opacity: 1; transform: translateY(0); }
}

/* ── Tag page: vertical card layout on mobile ── */
@media (max-width: 639px) {
  .tag-posts {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 0 1rem !important;
  }
  .tag-posts > * {
    border-top: none !important;
  }
  .tag-posts .blog-layout {
    flex-direction: column;
    padding: 0;
    gap: 0.5rem;
  }
  .tag-posts .blog-layout > a:first-child {
    min-width: 100%;
    max-width: 100%;
  }
  .tag-posts .blog-layout > a:first-child img {
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 340px;
  }
  .tag-posts .card-title {
    font-size: 1rem;
    line-height: 1.375rem;
    text-align: center;
  }
  .tag-posts .card-excerpt {
    display: block;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.125rem;
  }
}

/* ── Three-dot on podcast hero ── */
.podcast-hero-more {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.podcast-hero-more:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.podcast-hero-more svg { width: 20px; height: 20px; fill: currentColor; }

/* ══════════════════════════════════════════════════════
   Action Sheet (context menu)
   ══════════════════════════════════════════════════════ */
.gp-action-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-action-sheet-overlay);
  background: rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.gp-action-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.gp-action-sheet {
  position: fixed;
  z-index: var(--z-action-sheet);
  background: var(--bg-surface);
  border-radius: 12px;
  overflow: hidden;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

/* Desktop: centered modal */
@media (min-width: 641px) {
  .gp-action-sheet {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s;
  }
  .gp-action-sheet-overlay.open .gp-action-sheet {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Mobile: bottom sheet */
@media (max-width: 640px) {
  .gp-action-sheet {
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .gp-action-sheet-overlay.open .gp-action-sheet {
    transform: translateY(0);
  }
}

/* Action sheet header */
.gp-as-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gp-as-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #181818;
}
.gp-as-info { flex: 1; min-width: 0; overflow: hidden; }
.gp-as-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-as-artist {
  font-size: 0.75rem;
  color: #b3b3b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Action sheet options */
.gp-as-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  font-family: inherit;
}
.gp-as-option:hover { background: rgba(255,255,255,0.08); }
.gp-as-option svg { width: 22px; height: 22px; flex-shrink: 0; }
.gp-as-option.destructive { color: #e94560; }

/* ── Body scroll lock ── */
body.gp-popup-open { overflow: hidden; }

/* ── Mobile Navigation Bar (Spotify-style, members only) ── */
.gp-nav { display: none; }

@media (max-width: 640px) {
  .gp-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav-bar);
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    background: rgba(18,18,18,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
  }

  .gp-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  .gp-nav-item:hover,
  .gp-nav-item.active { color: #fff; }
  .gp-nav-item svg { flex-shrink: 0; }

  /* Player bar sits above nav bar */
  #global-player.active { bottom: 54px; }

  /* Hide nav when popup is open */
  body.gp-popup-open .gp-nav { display: none; }
}

/* ── Mobile popup ── */
@media (max-width: 640px) {
  .gp-popup-inner {
    max-width: none;
    padding: 16px 20px 32px;
    transform: translateY(100%);
    opacity: 1;
  }
  .gp-popup.open .gp-popup-inner {
    transform: translateY(0);
  }

  .gp-popup-artwork {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    max-width: 320px;
  }
}

/* ── Premium Info Popup (action-sheet style) ── */
.pm-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0);z-index:var(--z-popup-modal);align-items:center;justify-content:center;transition:background .3s ease}
.pm-overlay.open{display:flex;background:rgba(0,0,0,.7)}
.pm-sheet{background:var(--bg-surface);color:#fff;border-radius:16px;width:calc(100% - 32px);max-width:420px;padding:12px 24px 28px;transform:scale(.9);opacity:0;transition:transform .25s cubic-bezier(.32,.72,0,1),opacity .2s;max-height:85vh;overflow-y:auto}
.pm-overlay.open .pm-sheet{transform:scale(1);opacity:1}
.pm-handle{width:40px;height:4px;background:#666;border-radius:2px;margin:0 auto 16px}
.pm-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.pm-label{font-size:.8rem;font-weight:600;color:rgba(255,255,255,.7);text-transform:uppercase;letter-spacing:1px}
.pm-close{background:none;border:none;color:#fff;opacity:.7;cursor:pointer;padding:4px;display:flex;transition:opacity .2s}
.pm-close:hover{opacity:1}
.pm-loading{text-align:center;color:#888;padding:24px 0;font-size:.88rem}

/* Plan card */
.pm-card{background:#1a1a1a;border-radius:12px;padding:20px;margin-bottom:20px;position:relative}
.pm-card-badge{font-size:.68rem;font-weight:600;color:rgba(255,255,255,.5);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}
.pm-card-plan{font-size:.85rem;font-weight:600;color:var(--brand-primary);display:flex;align-items:center;gap:6px}
.pm-card-plan::before{content:'';display:inline-block;width:8px;height:8px;background:var(--brand-primary);border-radius:50%}
.pm-card-tier{font-size:1.5rem;font-weight:800;line-height:1.2;margin-top:4px}
.pm-card-expiry{color:#888;font-size:.8rem;margin-top:8px}
.pm-card-actions{display:flex;gap:8px;margin-top:14px}
.pm-btn-renew{display:inline-block;background:linear-gradient(135deg,#e94560,#c23152);color:#fff;padding:8px 20px;border-radius:50px;font-weight:700;font-size:.8rem;text-decoration:none;text-align:center;transition:transform .15s}
.pm-btn-renew:hover{transform:translateY(-1px)}
/* Benefits */
.pm-section-title{font-weight:700;font-size:.95rem;margin-bottom:12px}
.pm-benefits{background:#1a1a1a;border-radius:12px;padding:16px 20px;margin-bottom:20px}
.pm-benefit{padding:8px 0;font-size:.88rem;color:#ccc;display:flex;align-items:center;gap:10px}
.pm-check{color:var(--brand-primary);font-weight:700;font-size:1rem}
.pm-divider{height:1px;background:#444;margin:20px 0}
.pm-btn-explore{display:block;text-align:center;color:#b3b3b3;font-size:.85rem;font-weight:600;text-decoration:none;padding:12px;border:1px solid #444;border-radius:50px;transition:all .15s;margin-top:16px}
.pm-btn-explore:hover{color:#fff;border-color:#fff}


@media(max-width:640px){
  .pm-sheet{bottom:0;left:0;right:0;position:fixed;max-width:none;width:100%;border-radius:16px 16px 0 0;transform:translateY(100%);transition:transform .3s cubic-bezier(.32,.72,0,1);max-height:85vh;padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}
  .pm-overlay{align-items:flex-end}
  .pm-overlay.open .pm-sheet{transform:translateY(0)}
}

/* ── Insights Profile (embedded in Premium popup) ── */
.ip-desc{color:#999;font-size:.8rem;line-height:1.5;margin:0 0 16px}
.ip-form{display:flex;flex-direction:column;gap:6px}
.ip-label{font-size:.75rem;font-weight:600;color:rgba(255,255,255,.6);text-transform:uppercase;letter-spacing:.5px;margin-top:6px}
.ip-input{background:#1a1a1a;border:1px solid #333;border-radius:8px;color:#fff;padding:10px 12px;font-size:.88rem;font-family:inherit;outline:none;transition:border-color .2s}
.ip-input:focus{border-color:var(--brand-primary)}
.ip-input::placeholder{color:#555}
.ip-textarea{resize:vertical;min-height:48px}
.ip-save{background:linear-gradient(135deg,#e94560,#c23152);color:#fff;border:none;border-radius:50px;padding:12px 24px;font-weight:700;font-size:.88rem;cursor:pointer;margin-top:12px;transition:transform .15s}
.ip-save:hover{transform:translateY(-1px)}

/* ── Signup Banner (anonymous only, Spotify-style) ── */
.signup-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: var(--z-signup-banner);
  background: linear-gradient(90deg, #af2896, #509bf5);
  padding: 12px 24px;
}
.signup-banner-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.signup-banner-title { font-size: .85rem; font-weight: 700; color: #fff; margin: 0; }
.signup-banner-desc { font-size: .75rem; color: rgba(255,255,255,.85); margin: 2px 0 0; }
.signup-banner-btn {
  background: #fff; color: #000; font-weight: 700;
  padding: 10px 28px; border-radius: 50px; border: none;
  font-size: .875rem; cursor: pointer; white-space: nowrap;
  transition: transform .15s, background .15s;
}
.signup-banner-btn:hover { transform: scale(1.04); background: #f0f0f0; }
.signup-banner-close {
  position: absolute; top: 4px; right: 8px;
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 2px 6px;
  transition: color .15s;
}
.signup-banner-close:hover { color: #fff; }
body.gp-popup-open .signup-banner { display: none; }
body.gp-active .signup-banner { display: none; }

body:has(.signup-banner) { padding-bottom: 56px; }

@media (max-width: 640px) {
  .signup-banner { padding: 10px 16px 65px; bottom: 0; }
  .signup-banner-inner { flex-direction: column; text-align: center; gap: 8px; }
  .signup-banner-btn { width: 100%; padding: 12px; }
}

