/* ==========================================================================
   HERCARE LOFI SOUNDSCAPE & AMBIENT MUSIC PLAYER
   Glassmorphic Floating Widget with Spinning Vinyl & Audio Waveform
   ========================================================================== */

#hercare-lofi-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(14, 14, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(244, 63, 94, 0.35);
  border-radius: 24px;
  box-shadow: 0 16px 45px -10px rgba(0, 0, 0, 0.9), 0 0 30px rgba(244, 63, 94, 0.2);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-primary), 'Sora', sans-serif;
  max-width: 440px;
}

#hercare-lofi-player:hover {
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.95), 0 0 40px rgba(244, 63, 94, 0.3);
}

/* Minimized State */
#hercare-lofi-player.minimized {
  padding: 10px 14px;
  border-radius: 9999px;
}

#hercare-lofi-player.minimized .lofi-info-cluster,
#hercare-lofi-player.minimized .lofi-secondary-controls {
  display: none !important;
}

/* Vinyl Disc */
.lofi-vinyl-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  cursor: pointer;
}

.lofi-vinyl-disc {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #F43F5E 15%, #181824 16%, #0a0a0f 65%, #242436 90%, #030306 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lofi-vinyl-disc::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #030306;
  border: 2px solid #F43F5E;
}

.lofi-vinyl-disc.spinning {
  animation: spinVinyl 5s linear infinite;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Info Cluster */
.lofi-info-cluster {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
}

.lofi-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lofi-phase-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid #F43F5E;
  color: #FB7185;
  background: rgba(244, 63, 94, 0.12);
}

.lofi-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.lofi-mood {
  font-size: 0.6875rem;
  color: #94A3B8;
  white-space: nowrap;
}

/* Controls Cluster */
.lofi-controls-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lofi-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lofi-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  transform: scale(1.06);
}

.lofi-btn.play-btn {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #FB7185 0%, #F43F5E 100%);
  border: none;
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
}

.lofi-btn.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.6);
}

/* Secondary controls (Rain, Volume, Minimize) */
.lofi-secondary-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 10px;
}

.lofi-toggle-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lofi-toggle-btn:hover {
  transform: scale(1.15);
}

/* Volume Slider */
.lofi-volume-slider {
  width: 55px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.lofi-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #F43F5E;
  cursor: pointer;
  box-shadow: 0 0 6px #F43F5E;
}

/* Equalizer Bars */
.lofi-eq-container {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-left: 4px;
}

.lofi-eq-bar {
  width: 3px;
  height: 3px;
  background: #F43F5E;
  border-radius: 2px;
  transition: height 0.15s ease;
}

.lofi-eq-bar.animating:nth-child(1) { animation: eqPulse 0.6s ease-in-out infinite alternate; }
.lofi-eq-bar.animating:nth-child(2) { animation: eqPulse 0.45s ease-in-out infinite alternate 0.1s; }
.lofi-eq-bar.animating:nth-child(3) { animation: eqPulse 0.75s ease-in-out infinite alternate 0.2s; }
.lofi-eq-bar.animating:nth-child(4) { animation: eqPulse 0.5s ease-in-out infinite alternate 0.15s; }

@keyframes eqPulse {
  0% { height: 3px; }
  100% { height: 14px; background: #FB7185; }
}

@media (max-width: 768px) {
  /* On Mobile: Sits statically at the end of the page right above the footer */
  #hercare-lofi-player {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    margin: 40px auto 30px !important;
    width: calc(100% - 32px) !important;
    max-width: 480px !important;
    z-index: 10 !important;
    border-radius: 24px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(244, 63, 94, 0.25) !important;
    justify-content: space-between;
  }

  .lofi-title {
    max-width: 140px;
  }
}
