/**
 * Premium Sticky Player - Layout Frame
 *
 * The player lives in its own layout frame at the bottom of the viewport.
 * Body becomes a full-height flex column: content scrolls, player stays put.
 * No position:fixed, no z-index wars, no overlap with FAB or footer.
 */

/* Layout frame: body is viewport-height flex column */
body.player-active {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Main content scrolls within its frame */
body.player-active main,
body.player-active .feed-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Footer hides when player is active to reclaim space */
body.player-active > footer {
  display: none;
}

/* Player: normal-flow flex child, always at bottom */
.sticky-player {
  display: none;
  height: 72px;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.98) 0%, rgba(18, 18, 24, 0.98) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3), 0 -1px 3px rgba(255, 51, 102, 0.1);
  padding: 0 12px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}

.sticky-player.active {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Artwork */
.sticky-player__artwork {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff3366 0%, #ff6b35 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

/* Info (title + creator) */
.sticky-player__info {
  flex: 1;
  min-width: 0;
}

.sticky-player__title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}

.sticky-player__creator {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Copy URL button */
.sticky-player__btn--copy {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* Transport controls (prev, play, next) */
.sticky-player__controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* All buttons */
.sticky-player__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.sticky-player__btn:hover {
  color: #ffffff;
}

.sticky-player__btn:active {
  transform: scale(0.9);
}

/* Play button - accent */
.sticky-player__btn--play {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #ff3366 0%, #ff6b35 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.sticky-player__btn--play:hover {
  box-shadow: 0 6px 16px rgba(255, 51, 102, 0.5);
}

/* Progress bar */
.sticky-player__progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: height 0.15s;
}

.sticky-player__progress:hover {
  height: 6px;
}

.sticky-player__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3366 0%, #ff6b35 100%);
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.sticky-player__progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.15s;
}

.sticky-player__progress:hover .sticky-player__progress-fill::after {
  opacity: 1;
}

/* Time display */
.sticky-player__time {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  min-width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ============================================
   Responsive - Mobile (hide actions + time)
   ============================================ */
@media (max-width: 768px) {
  .sticky-player {
    height: 64px;
    padding: 0 8px;
  }

  .sticky-player__artwork {
    width: 44px;
    height: 44px;
  }

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

  .sticky-player__btn--copy {
    display: none;
  }

  .sticky-player__time {
    display: none;
  }

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

  .sticky-player__btn {
    width: 36px;
    height: 36px;
  }
}

/* ============================================
   Responsive - Tablet+ (more breathing room)
   ============================================ */
@media (min-width: 769px) {
  .sticky-player {
    padding: 0 16px;
  }

  .sticky-player.active {
    gap: 14px;
  }

  .sticky-player__controls {
    gap: 6px;
  }
}
