/* ============================================================
   YYHH Sticky Music Player  —  Mobile-First
   YeniyeniHiphop — dark theme, accent #176c47
   ============================================================ */

/* ── Sidebar nav: hide native scrollbar, keep scroll ── */
.sidebar__nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar__nav::-webkit-scrollbar {
  display: none;
}

/* ── Custom properties ── */
:root {
  --yyhh-bg:        #1a1a1e;
  --yyhh-border:    rgba(255, 255, 255, 0.07);
  --yyhh-accent:    #176c47;
  --yyhh-accent-h:  #1d8a5a;
  --yyhh-wack:      #c0392b;
  --yyhh-text:      #e8e8e8;
  --yyhh-muted:     #888;
  --yyhh-radius:    8px;
  --yyhh-z:         1000;
  --yyhh-transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                     opacity  0.3s ease;

  /* Height changes per breakpoint */
  --yyhh-height: 62px;
}

@media (min-width: 600px) {
  :root { --yyhh-height: 68px; }
}
@media (min-width: 900px) {
  :root { --yyhh-height: 72px; }
}

/* ── Player bar ── */
.yyhh-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--yyhh-height);
  background: var(--yyhh-bg);
  border-top: 1px solid var(--yyhh-border);
  z-index: var(--yyhh-z);

  /* Mobile: cover | info | play | close  — no wrap */
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 10px;

  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(0);
  opacity: 1;
  transition: var(--yyhh-transition);
  user-select: none;
}

/* Hidden state — slides down off screen */
.yyhh-player--hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Visible state */
.yyhh-player--visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Push page content up when player is visible */
body.yyhh-active {
  padding-bottom: var(--yyhh-height);
}

/* ── Cover art ── */
.yyhh-player__cover {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  background: #2a2a30;
}

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

/* ── Track info — fills available space on mobile ── */
.yyhh-player__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;          /* grow to fill gap between cover and controls */
  overflow: hidden;
}

.yyhh-player__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--yyhh-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.yyhh-player__artist {
  font-size: 11px;
  color: var(--yyhh-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ── Controls ── */
.yyhh-player__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.yyhh-player__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--yyhh-text);
  border-radius: 50%;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  padding: 0;
  outline: none;
}

.yyhh-player__btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.yyhh-player__btn:active {
  transform: scale(0.92);
}

.yyhh-player__btn svg {
  fill: currentColor;
  display: block;
}

/* Prev / Next — visible on all sizes; slightly smaller on mobile */
.yyhh-player__btn--prev,
.yyhh-player__btn--next {
  display: flex;
  width: 30px;
  height: 30px;
}

.yyhh-player__btn--prev svg,
.yyhh-player__btn--next svg {
  width: 20px;
  height: 20px;
}

/* Play / Pause button — accent background, always visible */
.yyhh-player__btn--play {
  width: 40px;
  height: 40px;
  background: var(--yyhh-accent);
  color: #fff;
}

.yyhh-player__btn--play:hover {
  background: var(--yyhh-accent-h);
  color: #fff;
}

.yyhh-player__btn--play svg {
  width: 20px;
  height: 20px;
}

/* ── Loading spinner on play button ── */
.yyhh-player--loading .yyhh-player__btn--play {
  position: relative;
  pointer-events: none;
}

.yyhh-player--loading .yyhh-player__btn--play svg {
  opacity: 0;
}

.yyhh-player--loading .yyhh-player__btn--play::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yyhh-spin 0.7s linear infinite;
}

@keyframes yyhh-spin {
  to { transform: rotate(360deg); }
}

/* ── Progress / seek — hidden on mobile ── */
.yyhh-player__progress-wrap {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.yyhh-player__time {
  font-size: 11px;
  color: var(--yyhh-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: center;
}

.yyhh-player__progress {
  flex: 1;
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  cursor: pointer;
}

.yyhh-player__progress:hover {
  height: 6px;
  margin-top: -1px;
}

.yyhh-player__progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--yyhh-accent);
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
  transition: width 0.25s linear;
}

/* Seek range input — invisible but covers the progress track */
.yyhh-player__seek {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: calc(100% + 16px);
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
}

/* ── Volume — hidden on mobile & tablet ── */
.yyhh-player__volume-wrap {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 110px;
}

.yyhh-player__volume-wrap svg {
  width: 16px;
  height: 16px;
  fill: var(--yyhh-muted);
  flex-shrink: 0;
}

.yyhh-player__volume {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.yyhh-player__volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yyhh-accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.yyhh-player__volume::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.yyhh-player__volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yyhh-accent);
  border: none;
  cursor: pointer;
}

/* ── Hype / Wack reactions — hidden always (use track detail page) ── */
.yyhh-player__reactions {
  display: none !important;
}

.yyhh-player__reaction {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  outline: none;
}

.yyhh-player__reaction svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

/* Hype button */
.yyhh-player__reaction--hype {
  color: var(--yyhh-accent);
  border-color: rgba(23, 108, 71, 0.35);
}

.yyhh-player__reaction--hype svg {
  fill: var(--yyhh-accent);
}

.yyhh-player__reaction--hype:hover,
.yyhh-player__reaction--hype.active {
  background: rgba(23, 108, 71, 0.18);
  border-color: var(--yyhh-accent);
}

/* Wack button */
.yyhh-player__reaction--wack {
  color: var(--yyhh-wack);
  border-color: rgba(192, 57, 43, 0.35);
}

.yyhh-player__reaction--wack svg {
  fill: var(--yyhh-wack);
}

.yyhh-player__reaction--wack:hover,
.yyhh-player__reaction--wack.active {
  background: rgba(192, 57, 43, 0.15);
  border-color: var(--yyhh-wack);
}

.yyhh-player__reaction-count {
  color: inherit;
}

/* ── Close button — always visible ── */
.yyhh-player__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--yyhh-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  outline: none;
}

.yyhh-player__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.yyhh-player__close svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ============================================================
   BREAKPOINTS  —  progressive enhancement
   ============================================================ */

/* ── Tablet ≥ 600px: add prev/next + progress bar ── */
@media (min-width: 600px) {
  .yyhh-player {
    gap: 10px;
    padding: 0 14px;
  }

  /* Restore full size at wider breakpoint */
  .yyhh-player__btn--prev,
  .yyhh-player__btn--next {
    width: 34px;
    height: 34px;
  }

  /* Slightly larger play button */
  .yyhh-player__btn--play {
    width: 42px;
    height: 42px;
  }

  /* Cover a touch bigger */
  .yyhh-player__cover {
    width: 44px;
    height: 44px;
  }

  /* Info no longer fills all space — progress takes over */
  .yyhh-player__info {
    flex: 0 0 140px;
    width: 140px;
  }

  /* Show progress bar */
  .yyhh-player__progress-wrap {
    display: flex;
  }
}

/* ── Desktop ≥ 900px: add volume + reactions, full player ── */
@media (min-width: 900px) {
  .yyhh-player {
    gap: 12px;
    padding: 0 16px;
  }

  .yyhh-player__cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
  }

  .yyhh-player__info {
    flex: 0 0 160px;
    width: 160px;
  }

  .yyhh-player__title {
    font-size: 13px;
  }

  .yyhh-player__btn--play {
    width: 44px;
    height: 44px;
  }

  .yyhh-player__btn--play svg {
    width: 22px;
    height: 22px;
  }

  /* Show volume */
  .yyhh-player__volume-wrap {
    display: flex;
  }
}

/* ============================================================
   PLAY BUTTON on track cards (data-play-* elements)
   ============================================================ */
[data-play-id] {
  cursor: pointer;
}

/* Small play overlay on cover images */
.track-card__play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}

.track-card:hover .track-card__play-overlay,
.track-card:focus .track-card__play-overlay {
  opacity: 1;
}

.track-card__play-btn {
  width: 48px;
  height: 48px;
  background: var(--yyhh-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.track-card__play-btn:hover {
  transform: scale(1.1);
}

.track-card__play-btn svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

/* Currently playing indicator */
.yyhh-playing svg.icon-play  { display: none; }
.yyhh-playing svg.icon-pause { display: block !important; }

/* ============================================================
   TOAST notification (for hype/wack feedback)
   ============================================================ */
.yyhh-toast {
  position: fixed;
  bottom: calc(var(--yyhh-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #222227;
  color: #e8e8e8;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  z-index: calc(var(--yyhh-z) + 10);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.yyhh-toast--hype  { border-color: var(--yyhh-accent); color: var(--yyhh-accent); }
.yyhh-toast--wack  { border-color: var(--yyhh-wack);   color: var(--yyhh-wack);   }
.yyhh-toast--error { border-color: #888; }

/* ============================================================
   QUEUE PANEL — slides up from above the sticky player bar
   ============================================================ */
.yyhh-queue-panel {
  position: fixed;
  bottom: var(--yyhh-height);
  left: 0;
  right: 0;
  background: #15151a;
  border-top: 1px solid rgba(255,255,255,.07);
  z-index: calc(var(--yyhh-z) - 1);
  max-height: 340px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  scrollbar-width: thin;
  scrollbar-color: #2a2a30 transparent;
  pointer-events: none;   /* don't intercept clicks when off-screen */
}
.yyhh-queue-panel--open { transform: translateY(0); pointer-events: auto; }

.yyhh-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  position: sticky;
  top: 0;
  background: #15151a;
  z-index: 1;
}
.yyhh-queue-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #555;
}
.yyhh-queue-actions { display: flex; gap: 6px; }
.yyhh-queue-action-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.1);
  color: #555;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.yyhh-queue-action-btn:hover { border-color: rgba(255,255,255,.2); color: #ccc; }
.yyhh-queue-close-btn { padding: 3px 8px; font-size: 14px; }

.yyhh-queue-list { padding: 4px 0 8px; }

.yyhh-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.yyhh-queue-item:hover { background: rgba(255,255,255,.04); }
.yyhh-queue-item--active { background: rgba(23,108,71,.1); }
.yyhh-queue-item--active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--yyhh-accent);
}

.yyhh-queue-item__idx {
  font-size: 10px;
  font-weight: 700;
  color: #333;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.yyhh-queue-item--active .yyhh-queue-item__idx { color: var(--yyhh-accent); }

.yyhh-queue-item__cover {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1e1e24;
}
.yyhh-queue-item__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.yyhh-queue-item__info { flex: 1; min-width: 0; }
.yyhh-queue-item__title {
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yyhh-queue-item--active .yyhh-queue-item__title { color: #25c478; }
.yyhh-queue-item__artist {
  font-size: 11px;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.yyhh-queue-item__remove {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #2e2e38;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  transition: background .12s, color .12s;
}
.yyhh-queue-item:hover .yyhh-queue-item__remove { color: #666; }
.yyhh-queue-item__remove:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }

.yyhh-queue-empty {
  text-align: center;
  padding: 28px 20px;
  color: #333;
  font-size: 12px;
}

/* Queue toggle button — shown inside player bar */
.yyhh-player__queue-toggle { color: var(--yyhh-muted); }
.yyhh-player__queue-toggle.active { color: var(--yyhh-accent); }
