/* ============================================================
   NOW SPINNING widget — floating bottom-left
   Curated salon playlist, spinning vinyl, expandable list.
   ============================================================ */

.ns-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 950;
  font-family: var(--font-mono, 'Space Mono', monospace);
  color: #fff;
  /* Slide in from below on load */
  animation: nsSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s both;
}
@keyframes nsSlideIn {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.ns-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(8, 6, 10, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 46, 147, 0.5);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  cursor: pointer;
  max-width: 360px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 22px rgba(255, 46, 147, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.ns-pill:hover {
  border-color: var(--pink);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.7),
    0 0 36px rgba(255, 46, 147, 0.5);
  transform: translateY(-2px);
}

/* ---- Vinyl record ---- */
.ns-vinyl {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a2126 0%, #0c0a0c 60%, #000 100%);
  flex-shrink: 0;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.6);
  animation: nsSpin 4s linear infinite;
  transition: transform 0.2s;
}
.ns-widget.paused .ns-vinyl { animation-play-state: paused; }
.ns-vinyl:hover { transform: scale(1.08); }
@keyframes nsSpin { to { transform: rotate(360deg); } }
/* Concentric grooves */
.ns-vinyl-grooves {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at center,
      transparent 0,
      transparent 1.5px,
      rgba(255, 255, 255, 0.05) 1.5px,
      rgba(255, 255, 255, 0.05) 2.5px
    );
}
/* Center label */
.ns-vinyl-label {
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin-top: -8px; margin-left: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink, #ff2e93) 0%, #b026ff 100%);
  box-shadow: 0 0 6px rgba(255, 46, 147, 0.7);
}
.ns-vinyl-hole {
  position: absolute;
  top: 50%; left: 50%;
  width: 3px; height: 3px;
  margin-top: -1.5px; margin-left: -1.5px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ---- Meta (text) ---- */
.ns-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.ns-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--pink, #ff2e93);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.ns-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pink, #ff2e93);
  box-shadow: 0 0 6px var(--pink, #ff2e93);
  animation: nsPulse 1.6s ease-in-out infinite;
}
@keyframes nsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.7); }
}

.ns-track-wrap {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.ns-track {
  font-size: 12px;
  color: #fff;
  display: inline-block;
  animation: nsTrackIn 0.5s ease-out both;
}
@keyframes nsTrackIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ns-track strong {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ns-track em {
  font-style: normal;
  opacity: 0.7;
  font-size: 11px;
}
.ns-track .ns-sep {
  margin: 0 6px;
  opacity: 0.4;
}

/* ---- Toggle button ---- */
.ns-toggle {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.15s;
  font-family: inherit;
}
.ns-toggle:hover {
  border-color: var(--pink, #ff2e93);
  color: var(--pink, #ff2e93);
  background: rgba(255, 46, 147, 0.08);
}
.ns-widget.expanded .ns-toggle {
  background: var(--pink, #ff2e93);
  color: #000;
  border-color: var(--pink, #ff2e93);
  font-size: 18px;
}

/* ---- Dismiss button (top-right, hides whole widget) ---- */
.ns-dismiss {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 3;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 46, 147, 0.55);
  background: rgba(7, 5, 8, 0.95);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  font-family: inherit;
  padding: 0;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.18s, transform 0.18s, color 0.15s, background 0.15s, border-color 0.15s;
  pointer-events: none;
}
.ns-widget:hover .ns-dismiss,
.ns-widget.expanded .ns-dismiss,
.ns-dismiss:focus-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.ns-dismiss:hover {
  background: var(--pink, #ff2e93);
  border-color: var(--pink, #ff2e93);
  color: #000;
}
/* Touch: always visible (no hover) */
@media (hover: none) {
  .ns-dismiss { opacity: 1; transform: scale(1); pointer-events: auto; }
}

/* ---- Restore button (when dismissed, tiny floating ♪) ---- */
.ns-restore {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 998;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 46, 147, 0.55);
  background: rgba(7, 5, 8, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--pink, #ff2e93);
  font-size: 18px;
  cursor: pointer;
  display: grid; place-items: center;
  font-family: inherit;
  padding: 0;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
  animation: nsRestoreIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ns-restore:hover {
  background: var(--pink, #ff2e93);
  color: #000;
  transform: scale(1.08);
}
@keyframes nsRestoreIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
@media (max-width: 640px) {
  .ns-restore {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 40px; height: 40px;
    font-size: 16px;
  }
}

/* ---- Expanded panel ---- */
.ns-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: rgba(10, 7, 12, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 46, 147, 0.5);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.7),
    0 0 32px rgba(255, 46, 147, 0.3);
  animation: nsPanelIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}
@keyframes nsPanelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.ns-panel-head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ns-panel-title {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}
.ns-panel-sub {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--pink, #ff2e93);
  text-transform: uppercase;
  margin-top: 2px;
}
.ns-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.ns-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 12px;
  color: #fff;
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.ns-row:hover { background: rgba(255, 255, 255, 0.04); }
.ns-row.active {
  border-left-color: var(--pink, #ff2e93);
  background: rgba(255, 46, 147, 0.08);
}
.ns-num {
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
}
.ns-row.active .ns-num {
  color: var(--pink, #ff2e93);
  opacity: 1;
}
.ns-row-track {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ns-row-artist {
  font-size: 10px;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-style: italic;
  white-space: nowrap;
}
.ns-panel-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  display: flex;
  gap: 8px;
}
.ns-foot-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
}
.ns-foot-btn:hover {
  border-color: var(--pink, #ff2e93);
  color: var(--pink, #ff2e93);
}
.ns-spotify-link:hover {
  border-color: #1db954;
  color: #1db954;
}

/* ---- Spotify embed inside the panel ---- */
.ns-spotify-wrap {
  padding: 12px 16px 4px;
}
.ns-spotify {
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #181818;
}

/* ---- Mobile: move to TOP, just under the nav ---- */
@media (max-width: 640px) {
  .ns-widget {
    left: 10px;
    right: 10px;
    bottom: auto;
    top: 70px; /* sits just below the fixed nav */
  }
  .ns-pill {
    max-width: none;
    padding: 6px 12px 6px 6px;
  }
  .ns-vinyl { width: 38px; height: 38px; }
  .ns-track strong { font-size: 11px; }
  .ns-track em { display: none; }
  .ns-track .ns-sep { display: none; }
  /* Panel drops DOWN below the pill on mobile (not up). */
  .ns-panel {
    width: calc(100vw - 20px);
    left: 0; right: 0;
    bottom: auto;
    top: calc(100% + 10px);
    transform-origin: top left;
    max-height: 60vh;
  }
  /* Slide in from above on mobile */
  .ns-widget {
    animation: nsSlideInTop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s both;
  }
}
@keyframes nsSlideInTop {
  from { transform: translateY(-120%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Hide on print */
@media print {
  .ns-widget { display: none; }
}

/* Disco mode — vinyl glows harder, label cycles colors */
body.disco .ns-vinyl {
  animation: nsSpin 1.4s linear infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 16px rgba(255, 46, 147, 0.6),
    0 0 28px rgba(0, 231, 255, 0.4);
}
body.disco .ns-vinyl-label {
  animation: nsLabelDisco 1.6s steps(5) infinite;
}
@keyframes nsLabelDisco {
  0%   { background: linear-gradient(135deg, #ff2e93, #b026ff); }
  25%  { background: linear-gradient(135deg, #00e7ff, #b026ff); }
  50%  { background: linear-gradient(135deg, #c6ff3f, #00e7ff); }
  75%  { background: linear-gradient(135deg, #f7c948, #ff2e93); }
  100% { background: linear-gradient(135deg, #ff1f3d, #f7c948); }
}
