/* ==========================================================================
   SmartFlow Tower — Ambient Lobby & Elevator Music Player
   ========================================================================== */

.tower-music-widget {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-body, "Heebo", system-ui, sans-serif);
  user-select: none;
}

/* NOTE: deliberately NO [dir=rtl] flip here. On the tower the chat + WhatsApp
   buttons are pinned bottom-LEFT in BOTH languages (see tower.css
   body.tower-body .chat-widget overrides), so the music bubble must stay
   bottom-RIGHT always — otherwise in Hebrew it lands on top of the WhatsApp
   button (z-index 1100 covers z-index 100). */

/* Floating Music Bubble */
.tower-music-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  outline: none;
  padding: 0;
}

.tower-music-bubble:hover {
  transform: scale(1.08);
  border-color: #38bdf8;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

.tower-music-bubble.is-playing {
  border-color: rgba(245, 158, 11, 0.6);
  color: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.3);
}

.tower-music-bubble svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.tower-music-bubble:hover svg {
  transform: rotate(6deg) scale(1.05);
}

/* Equalizer Bars indicator inside bubble */
.music-bars {
  position: absolute;
  bottom: 8px;
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tower-music-bubble.is-playing .music-bars {
  opacity: 1;
}

.tower-music-bubble.is-playing .default-note-icon {
  transform: translateY(-3px);
}

.music-bar {
  width: 2px;
  background: #f59e0b;
  border-radius: 1px;
  height: 3px;
}

.tower-music-bubble.is-playing .music-bar:nth-child(1) {
  animation: eqBounce 1.2s ease-in-out infinite alternate;
}
.tower-music-bubble.is-playing .music-bar:nth-child(2) {
  animation: eqBounce 0.8s ease-in-out 0.2s infinite alternate;
}
.tower-music-bubble.is-playing .music-bar:nth-child(3) {
  animation: eqBounce 1.0s ease-in-out 0.4s infinite alternate;
}

@keyframes eqBounce {
  0% { height: 2px; }
  100% { height: 10px; }
}

/* Player Mini Popup Card */
.tower-music-card {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 280px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* No RTL flip either — the card opens from the widget's right edge in both
   languages, matching the always-right widget anchor above. */

.tower-music-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.music-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.music-card-title {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: #38bdf8;
  font-weight: 700;
  text-transform: uppercase;
}

.music-card-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}

.music-card-close:hover {
  color: #ffffff;
}

.music-track-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-track-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-track-artist {
  font-size: 0.75rem;
  color: #94a3b8;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.music-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.music-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
}

.music-btn-play {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.music-btn-play:hover {
  background: #0ea5e9;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.6);
  transform: scale(1.05);
}

.music-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #64748b;
}

.music-volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.music-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

.music-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  border: none;
}

@media (max-width: 640px) {
  .tower-music-widget {
    bottom: 84px;
    right: 16px;
  }
  /* (no RTL flip — same always-right rule as desktop) */
  .tower-music-card {
    width: 250px;
  }
}
