/* ========== MUSIC TRACK GRID LAYOUT ========== */
.comments-list[data-content-type="music"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Track Card Grid Item */
.music-track-card {
  padding: 1.25rem !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.music-track-card:hover {
  border-color: var(--line-color);
}

.track-card-cover {
  width: 100%;
  aspect-ratio: 1.5;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.track-card-cover svg.disc-icon {
  width: 40px;
  height: 40px;
  fill: rgba(255, 255, 255, 0.15);
  transition: fill 0.3s ease, transform 0.5s ease;
}

.music-track-card:hover .track-card-cover svg.disc-icon {
  fill: var(--line-color);
  transform: scale(1.1) rotate(15deg);
  filter: drop-shadow(0 0 5px rgba(182, 216, 255, 0.3));
}

.track-card-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 9, 49, 0.65);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.music-track-card:hover .track-card-play-overlay {
  opacity: 1;
}

.track-card-play-overlay svg {
  width: 28px;
  height: 28px;
  fill: var(--star-glow-primary);
  filter: drop-shadow(0 0 8px var(--star-glow-primary));
}

.track-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.track-card-title {
  font-family: "LatoBoldItalic", sans-serif;
  font-size: 1.15rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-card-artist {
  font-family: "LatoLightItalic", sans-serif;
  font-size: 0.85rem;
  color: var(--text-color-secondary);
}

/* ========== FLOATING GLOBAL PLAYER SCREEN ========== */
.global-music-player {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 360px;
  height: 480px;
  max-width: calc(100vw - 4rem);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    150deg,
    rgba(70, 105, 175, 0.15) 0%,
    rgba(2, 9, 49, 0.82) 100%
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 60px rgba(50, 85, 200, 0.04);
  transition:
    width 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
    height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
    transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
    border-radius 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
    opacity 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  pointer-events: none;
}

.global-music-player.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header & Toggle Controls */
.player-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem 0.5rem 1.5rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.player-panel-title-text {
  font-family: "LatoLight", sans-serif;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, filter 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.player-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.player-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Expanded State layout */
.player-expanded-content {
  display: flex;
  flex-direction: column;
  padding: 0 1.5rem 1.5rem 1.5rem;
  gap: 1.2rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.player-cover-art {
  width: 100%;
  aspect-ratio: 1.5;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.player-cover-art svg.music-note-icon {
  width: 56px;
  height: 56px;
  fill: rgba(255, 255, 255, 0.15);
  transition: fill 0.3s ease, transform 0.5s ease;
}

.global-music-player.playing .player-cover-art svg.music-note-icon {
  fill: var(--line-color);
  transform: scale(1.1) rotate(10deg);
  filter: drop-shadow(0 0 10px rgba(182, 216, 255, 0.4));
}

/* Buffering / Loading Indicator inside cover */
.player-buffering-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--star-glow-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 8px var(--star-glow-primary);
  z-index: 6;
}

.player-buffering-indicator.loading {
  opacity: 1;
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
    box-shadow: 0 0 4px var(--star-glow-primary);
  }

  100% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 12px var(--star-glow-primary);
  }
}

.player-song-details {
  text-align: center;
  margin-bottom: 0.25rem;
}

.player-song-details h3 {
  font-family: "LatoBoldItalic", sans-serif;
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
  color: white;
}

.player-song-details .artist {
  font-family: "LatoLightItalic", sans-serif;
  font-size: 0.95rem;
  color: var(--text-color-secondary);
}

/* Seeker styling */
.music-player-seeker-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.music-seeker-svg-container {
  position: relative;
  width: 100%;
  height: 24px;
  cursor: pointer;
  user-select: none;
}

.music-seeker-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.music-seeker-track {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2.5px;
  stroke-linecap: round;
}

.music-seeker-fill {
  stroke: var(--line-color);
  stroke-width: 2.5px;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 5px rgba(182, 216, 255, 0.7));
}

.music-seeker-thumb {
  position: absolute;
  top: 12px;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--star-glow-primary);
  box-shadow: 0 0 8px rgba(250, 243, 148, 0.9);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.15s ease;
}

.music-seeker-svg-container:hover .music-seeker-thumb {
  transform: translate(-50%, -50%) scale(1.3);
}

.music-time-display {
  font-family: "LatoRegular", sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  justify-content: space-between;
  user-select: none;
  padding: 0 2px;
}

/* Expanded controls */
.player-expanded-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
}

.music-play-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.music-play-btn:hover {
  border-color: var(--line-color);
  transform: scale(1.05);
}

.music-play-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
  transition: fill 0.3s ease, transform 0.2s ease;
}

.music-play-btn:hover svg {
  fill: var(--star-glow-primary);
}

.music-play-btn:active {
  transform: scale(0.95);
}

/* Minimized State Bar layout */
.player-minimized-bar {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  gap: 1rem;
}

.minimized-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.minimized-title {
  font-family: "LatoBoldItalic", sans-serif;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
}

.minimized-artist {
  font-family: "LatoLightItalic", sans-serif;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.minimized-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.minimized-play-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.minimized-play-btn:hover {
  transform: scale(1.1);
  color: var(--star-glow-primary);
}

.minimized-play-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.minimized-progress-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--line-color);
  width: 0%;
  box-shadow: 0 -1px 6px rgba(182, 216, 255, 0.6);
}

/* State Classes for Minimized State */
.global-music-player.minimized {
  width: 300px;
  height: 60px;
  border-radius: 16px;
  bottom: 1.5rem;
  right: 1.5rem;
}

.global-music-player.minimized .player-panel-header,
.global-music-player.minimized .player-expanded-content {
  opacity: 0;
  pointer-events: none;
}

.global-music-player.minimized .player-minimized-bar {
  opacity: 1;
  pointer-events: auto;
}

/* ========== BEHIND THE TRACK / STORY OVERLAY ========== */
.player-story-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 9, 49, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 5;
  pointer-events: none;
}

.global-music-player.show-story .player-story-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-story-title {
  font-family: "LatoBoldItalic", sans-serif;
  font-size: 0.95rem;
  color: var(--line-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.25rem;
}

.player-story-text {
  font-family: "LatoLightItalic", sans-serif;
  font-size: 0.85rem;
  color: var(--text-color-primary);
  line-height: 1.45;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 4px;
}

/* Custom Scrollbar for Story description */
.player-story-text::-webkit-scrollbar {
  width: 3px;
}

.player-story-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.player-story-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* Make info button glow when active */
.global-music-player.show-story #player-info-btn {
  opacity: 1;
  color: var(--star-glow-primary);
  filter: drop-shadow(0 0 5px var(--star-glow-primary));
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .global-music-player {
    bottom: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
    max-width: 100%;
    height: 480px;
    border-radius: 24px;
  }

  .global-music-player.minimized {
    bottom: 1rem;
    right: 1rem;
    width: calc(100% - 2rem);
    height: 60px;
    border-radius: 16px;
  }
}