/* Newwest Listening Session — light theme with brand fonts */

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  --nw-bg:           #f5f4f0;
  --nw-fg:           #0a0a0a;
  --nw-card-bg:      rgba(0,0,0,0.03);
  --nw-card-border:  rgba(0,0,0,0.08);
  --nw-input-bg:     rgba(0,0,0,0.04);
  --nw-input-border: rgba(0,0,0,0.1);
  --nw-muted:        rgba(0,0,0,0.45);
  --nw-subtle:       rgba(0,0,0,0.25);
  --nw-label:        rgba(0,0,0,0.35);
  --nw-divider:      rgba(0,0,0,0.07);
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
body {
  background: var(--nw-bg);
  color: var(--nw-fg);
  font-family: 'Founders Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.nw-page h1,
.nw-page h2 {
  font-family: 'Canela', Georgia, serif;
  font-weight: 300;
}

/* ─── Layout helpers ─────────────────────────────────────────────────────── */
.nw-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.nw-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px;
}

.nw-container-wide {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.nw-card {
  background: var(--nw-card-bg);
  border: 1px solid var(--nw-card-border);
  border-radius: 16px;
  padding: 24px;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.nw-input {
  width: 100%;
  background: var(--nw-input-bg);
  border: 1px solid var(--nw-input-border);
  color: var(--nw-fg);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.nw-input::placeholder {
  color: var(--nw-label);
}

.nw-input:focus {
  border-color: rgba(0,0,0,0.3);
}

.nw-input[color-scheme] {
  color-scheme: light;
}

.nw-textarea {
  resize: none;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.nw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  border: none;
  font-family: inherit;
  text-decoration: none;
}

.nw-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nw-btn-primary {
  background: #0a0a0a;
  color: #fff;
}

.nw-btn-primary:hover:not(:disabled) {
  background: rgba(0,0,0,0.8);
}

.nw-btn-ghost {
  background: transparent;
  color: var(--nw-muted);
  border: 1px solid rgba(0,0,0,0.15);
}

.nw-btn-ghost:hover:not(:disabled) {
  color: var(--nw-fg);
  border-color: rgba(0,0,0,0.25);
}

.nw-btn-danger {
  background: transparent;
  color: rgba(180,40,40,0.7);
  border: 1px solid rgba(180,40,40,0.15);
}

.nw-btn-danger:hover:not(:disabled) {
  color: rgb(180,40,40);
}

.nw-btn-warning {
  background: transparent;
  color: rgba(160,110,0,0.8);
  border: 1px solid rgba(160,110,0,0.2);
}

.nw-btn-warning:hover:not(:disabled) {
  color: rgb(140,90,0);
}

.nw-btn-success {
  background: transparent;
  color: rgba(40,140,80,0.8);
  border: 1px solid rgba(40,140,80,0.2);
}

.nw-btn-success:hover:not(:disabled) {
  color: rgb(30,120,65);
}

.nw-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.nw-btn-full {
  width: 100%;
}

/* ─── Status badges ──────────────────────────────────────────────────────── */
.nw-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nw-status--draft { color: rgba(160,110,0,0.85); }
.nw-status--live  { color: rgba(30,120,65,0.9); }
.nw-status--ended { color: var(--nw-subtle); }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.nw-progress-track {
  height: 2px;
  background: rgba(0,0,0,0.1);
  border-radius: 99px;
  overflow: hidden;
}

.nw-progress-fill {
  height: 100%;
  background: rgba(0,0,0,0.5);
  border-radius: 99px;
  transition: width 0.1s linear;
}

.nw-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--nw-subtle);
}

/* ─── Cover art ──────────────────────────────────────────────────────────── */
.nw-cover {
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.nw-cover-lg {
  width: 240px;
  height: 240px;
  border-radius: 20px;
}

.nw-cover-sm {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.nw-cover-md {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

/* ─── Track list item ────────────────────────────────────────────────────── */
.nw-track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  background: transparent;
  text-align: left;
  width: 100%;
  color: inherit;
  font-family: inherit;
}

.nw-track-item:hover {
  background: rgba(0,0,0,0.04);
}

.nw-track-item.active {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
}

.nw-track-item.dragging {
  opacity: 0.4;
  border-color: rgba(0,0,0,0.15);
}

.nw-track-info {
  flex: 1;
  min-width: 0;
}

.nw-track-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--nw-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nw-track-artist {
  font-size: 12px;
  color: var(--nw-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.nw-track-meta {
  font-size: 11px;
  color: var(--nw-subtle);
  margin-top: 2px;
}

/* ─── Session list card ──────────────────────────────────────────────────── */
.nw-session-card {
  background: var(--nw-card-bg);
  border: 1px solid var(--nw-card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

.nw-session-card:last-child {
  margin-bottom: 0;
}

/* ─── Pulse dot ──────────────────────────────────────────────────────────── */
.nw-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: nwPulse 2s ease-in-out infinite;
}

.nw-pulse--green  { background: rgba(30,140,70,0.85); }
.nw-pulse--yellow { background: rgba(180,130,0,0.85); }

@keyframes nwPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ─── Header row ─────────────────────────────────────────────────────────── */
.nw-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

/* ─── Spacing utilities ──────────────────────────────────────────────────── */
.nw-space-y    > * + * { margin-top: 12px; }
.nw-space-y-sm > * + * { margin-top: 6px; }
.nw-space-y-lg > * + * { margin-top: 20px; }

/* ─── Text ───────────────────────────────────────────────────────────────── */
.nw-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nw-label);
}

.nw-muted {
  color: var(--nw-muted);
  font-size: 13px;
}

.nw-small {
  font-size: 12px;
  color: var(--nw-muted);
}

.nw-italic {
  font-style: italic;
  color: var(--nw-muted);
}

/* ─── Error / success ────────────────────────────────────────────────────── */
.nw-error   { color: rgba(160,40,40,0.9); font-size: 13px; margin-top: 4px; }
.nw-success { color: rgba(30,130,70,0.9); font-size: 13px; margin-top: 4px; }

/* ─── Flex utilities ─────────────────────────────────────────────────────── */
.nw-flex           { display: flex; }
.nw-flex-col       { display: flex; flex-direction: column; }
.nw-items-center   { align-items: center; }
.nw-justify-between{ justify-content: space-between; }
.nw-gap-2  { gap: 8px; }
.nw-gap-3  { gap: 12px; }
.nw-gap-4  { gap: 16px; }
.nw-flex-1 { flex: 1; }
.nw-flex-wrap { flex-wrap: wrap; }
.nw-min-w-0 { min-width: 0; }

/* ─── Section heading ────────────────────────────────────────────────────── */
.nw-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nw-section-count {
  font-weight: 400;
  font-size: 13px;
  color: var(--nw-muted);
}

/* ─── Divider ────────────────────────────────────────────────────────────── */
.nw-divider {
  border: none;
  border-top: 1px solid var(--nw-divider);
  margin: 20px 0;
}

/* ─── Source toggle (add track) ──────────────────────────────────────────── */
.nw-source-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--nw-card-border);
  border-radius: 10px;
  padding: 4px;
}

.nw-source-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--nw-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.nw-source-btn.is-active {
  background: #fff;
  color: var(--nw-fg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ─── Audio upload ───────────────────────────────────────────────────────── */
.nw-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  border: 2px dashed rgba(0,0,0,0.12);
  border-radius: 12px;
  cursor: pointer;
  color: var(--nw-muted);
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  flex-direction: column;
}

.nw-upload-label:hover {
  border-color: rgba(0,0,0,0.25);
  background: rgba(0,0,0,0.02);
}

.nw-upload-label.has-file {
  border-color: rgba(30,140,70,0.4);
  background: rgba(30,140,70,0.04);
  color: rgba(30,140,70,0.9);
}

.nw-upload-input {
  display: none;
}

.nw-upload-progress {
  height: 3px;
  background: rgba(0,0,0,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.nw-upload-progress-fill {
  height: 100%;
  background: rgba(0,0,0,0.5);
  border-radius: 99px;
  transition: width 0.2s;
}

/* ─── Audio player ───────────────────────────────────────────────────────── */
.nw-audio-player {
  width: 100%;
  height: 40px;
  border-radius: 99px;
  accent-color: #0a0a0a;
  margin-top: 8px;
}

/* ─── Comment ticker (guest view) ────────────────────────────────────────── */
.nw-comment-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 20px;
  pointer-events: none;
  z-index: 50;
}

.nw-comment-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245,244,240,0.92);
  border: 1px solid rgba(0,0,0,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 99px;
  padding: 8px 16px;
  max-width: 480px;
  margin: 0 auto;
  animation: nwSlideUp 0.3s ease;
}

@keyframes nwSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Background blur art ────────────────────────────────────────────────── */
.nw-bg-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  filter: blur(40px);
  transform: scale(1.1);
  transition: background-image 1s ease;
  pointer-events: none;
}

/* ─── Guest view ─────────────────────────────────────────────────────────── */
.nw-guest-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nw-guest-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 24px 100px;
  flex: 1;
}

/* ─── Curator layout ─────────────────────────────────────────────────────── */
.nw-curator-shell {
  display: flex;
  min-height: 100vh;
}

.nw-curator-main {
  flex: 1;
  padding: 32px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nw-curator-sidebar {
  width: 300px;
  border-left: 1px solid var(--nw-divider);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

/* ─── Player controls ────────────────────────────────────────────────────── */
.nw-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.nw-ctrl-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--nw-muted);
  transition: color 0.15s;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.nw-ctrl-btn:hover:not(:disabled) {
  color: var(--nw-fg);
}

.nw-ctrl-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.nw-ctrl-btn-play {
  background: #0a0a0a;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.nw-ctrl-btn-play:hover {
  background: rgba(0,0,0,0.85);
  color: #fff;
}

/* ─── Constellation ──────────────────────────────────────────────────────── */
.nw-constellation-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.nw-constellation-header {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
}

.nw-constellation-svg {
  width: 100%;
  height: 100vh;
  display: block;
}

/* ─── Tooltip ────────────────────────────────────────────────────────────── */
.nw-tooltip {
  position: absolute;
  pointer-events: none;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 180px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  transform: translate(-50%, -110%);
}

.nw-tooltip-title  { font-size: 12px; font-weight: 600; color: var(--nw-fg); }
.nw-tooltip-artist { font-size: 11px; color: var(--nw-muted); margin-top: 2px; }
.nw-tooltip-guest  { font-size: 11px; color: var(--nw-label); margin-top: 4px; }
.nw-tooltip-note   { font-size: 11px; color: var(--nw-muted); font-style: italic; margin-top: 2px; }
.nw-tooltip-hint   { font-size: 10px; color: var(--nw-subtle); margin-top: 6px; }

/* ─── Login modal ────────────────────────────────────────────────────────── */
.nw-login-box {
  width: 100%;
  max-width: 360px;
}

.nw-login-box h1 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.nw-login-box p {
  font-size: 13px;
  color: var(--nw-muted);
  margin: 0 0 32px;
}

/* ─── Search results ─────────────────────────────────────────────────────── */
.nw-search-results {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.nw-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: inherit;
  transition: background 0.1s;
  font-family: inherit;
}

.nw-search-result:hover {
  background: rgba(0,0,0,0.05);
}

/* ─── Drag handle ────────────────────────────────────────────────────────── */
.nw-draggable       { cursor: grab; }
.nw-draggable:active{ cursor: grabbing; }

/* ─── Char counter ───────────────────────────────────────────────────────── */
.nw-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--nw-subtle);
  margin-top: 2px;
}

/* ─── Loading spinner ────────────────────────────────────────────────────── */
.nw-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: rgba(0,0,0,0.5);
  border-radius: 50%;
  animation: nwSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes nwSpin {
  to { transform: rotate(360deg); }
}

/* ─── Comment card ───────────────────────────────────────────────────────── */
.nw-comment-card {
  background: var(--nw-card-bg);
  border: 1px solid var(--nw-card-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.nw-comment-card:last-child {
  margin-bottom: 0;
}

/* ─── Truncate ───────────────────────────────────────────────────────────── */
.nw-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.nw-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─── Bottom sheet (constellation track detail) ──────────────────────────── */
.nw-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nw-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nw-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 101;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px 20px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 70vh;
  overflow-y: auto;
}

.nw-sheet.is-open {
  transform: translateY(0);
}

.nw-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(0,0,0,0.12);
  border-radius: 99px;
  margin: 12px auto 0;
}

.nw-sheet-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nw-sheet-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.nw-sheet-cover {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0,0,0,0.06);
}

.nw-sheet-info {
  flex: 1;
  min-width: 0;
}

.nw-sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--nw-fg);
  margin: 0;
  line-height: 1.3;
}

.nw-sheet-artist {
  font-size: 13px;
  color: var(--nw-muted);
  margin-top: 3px;
}

.nw-sheet-guest {
  font-size: 12px;
  color: var(--nw-label);
  margin-top: 8px;
}

.nw-sheet-note {
  font-size: 13px;
  color: var(--nw-muted);
  font-style: italic;
  line-height: 1.5;
  padding: 12px 14px;
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  border-left: 2px solid rgba(0,0,0,0.1);
}

.nw-sheet-spotify-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1DB954;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 99px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.nw-sheet-spotify-btn:hover {
  opacity: 0.88;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .nw-grid-2 {
    grid-template-columns: 1fr;
  }

  .nw-curator-shell {
    flex-direction: column;
  }

  .nw-curator-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--nw-divider);
  }
}
