/* ============================================================
   Harmonix — Sync Float Panel
   Floating modal anchored bottom-right, mobile-friendly
   ============================================================ */

#hx-sync-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

#hx-sync-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#hx-sync-float {
  position: fixed;
  bottom: calc(var(--player-shell-height, var(--player-height, 80px)) + 12px);
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - var(--player-shell-height, var(--player-height, 80px)) - 80px);
  overflow-y: auto;
  background: rgba(8, 14, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 901;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.hx-sync-float-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky;
  top: 0;
  background: rgba(8, 14, 28, 0.98);
  border-radius: 16px 16px 0 0;
  z-index: 1;
  cursor: grab;
  user-select: none;
}

#hx-sync-float.dragging .hx-sync-float-header {
  cursor: grabbing;
}

.hx-sync-float-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text, #e8eaf0);
  flex: 1;
}

.hx-sync-float-title i {
  color: #89a8ff;
  font-size: 14px;
}

.hx-sync-title-beta {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.hx-sync-float-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #8090aa);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.hx-sync-float-close:hover {
  color: var(--text, #e8eaf0);
  background: rgba(255, 255, 255, 0.08);
}

.hx-sync-float-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.hx-sync-float-body .hx-sync-queue {
  max-height: min(30vh, 240px);
}

.hx-session-btn {
  color: var(--text-muted, #8090aa);
  transition: color 0.15s;
}

.hx-session-btn:hover,
.hx-session-btn[aria-pressed="true"] {
  color: #89a8ff;
}

.hx-session-btn[aria-pressed="true"] i {
  animation: hx-session-pulse 2s ease-in-out infinite;
}

.hx-sync-mode-row {
  align-items: center;
  justify-content: space-between;
}

.hx-sync-mode-label {
  font-size: 11px;
  color: #a6b4cf;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
}

.hx-sync-mode-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.hx-sync-mode-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #9fb1d9;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.hx-sync-mode-btn:hover {
  color: #dfe8ff;
}

.hx-sync-mode-btn.is-active {
  background: rgba(137, 168, 255, 0.25);
  color: #e7eeff;
}

.hx-sync-mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hx-sync-icon-btn:disabled,
.hx-sync-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes hx-session-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 768px) {
  #hx-sync-float {
    bottom: var(--player-shell-height, var(--player-height, 80px));
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
  }

  .hx-sync-float-header {
    cursor: default;
  }

  .hx-sync-float-body .hx-sync-queue {
    max-height: min(34vh, 320px);
  }
}
