/* ═══════════════════════════════════════════════════════════════
   RËEL STUDIO — Components CSS
   Cinematic component library
   ═══════════════════════════════════════════════════════════════ */

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: 10px 22px;
  font-family: var(--ff-display); font-size: 11px;
  letter-spacing: 0.15em; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background var(--transition-fast);
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #120c05; font-weight: 600;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 40px rgba(245,201,106,0.55);
  filter: brightness(1.06);
}
.btn-primary:active { transform: translateY(0) scale(0.99); box-shadow: var(--shadow-soft); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text); border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.btn-gold-ghost {
  background: transparent; color: var(--gold);
  border-color: var(--border-gold);
}
.btn-gold-ghost:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245,201,106,0.2);
}

.btn-danger { background: transparent; color: var(--red); border-color: rgba(255,75,107,0.3); }
.btn-danger:hover { background: rgba(255,75,107,0.08); }

.btn-sm  { padding: 6px 14px; font-size: 10px; }
.btn-lg  { padding: 14px 32px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  position: relative;
  background: radial-gradient(circle at 0 0, rgba(255,255,255,0.04), rgba(0,0,0,0.85));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md);
  overflow: hidden;
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med);
}
.card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(245,201,106,0.0), rgba(245,201,106,0.32));
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none; z-index: 0;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: rgba(245,201,106,0.35); }
.card:hover::before { opacity: 1; }
.card-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  position: relative; z-index: 1;
}
.card-body { padding: var(--sp-5); position: relative; z-index: 1; }
.card-footer {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--sp-2);
  position: relative; z-index: 1;
}

/* Song album card */
.card-song, .song-album-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.7));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md);
  transition: transform 0.22s var(--ease-snappy), border-color var(--t-fast), box-shadow 0.22s var(--ease-snappy);
  cursor: default;
}
.card-song:hover, .song-album-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-glow);
}
.card-song .song-art {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, #1a1200, #2a1800);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.card-song .song-info { flex: 1; min-width: 0; }
.card-song .song-title {
  font-family: var(--ff-display); font-size: 12px;
  letter-spacing: 0.05em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-song .song-meta { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* My Songs grid */
.songs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ── FORMS ──────────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-5); }
.field-label {
  display: block; font-family: var(--ff-display);
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--text-muted); margin-bottom: var(--sp-2);
}
.field-input {
  width: 100%; padding: 10px var(--sp-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  font-size: 13px; font-family: var(--ff-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-input:focus { border-color: var(--border-gold); box-shadow: 0 0 0 3px rgba(245,201,106,0.06); }
.field-input::placeholder { color: var(--text-faint); }
textarea.field-input { resize: vertical; min-height: 100px; line-height: 1.6; }
.field-hint { font-size: 11px; color: var(--text-dim); margin-top: var(--sp-1); font-family: var(--ff-serif); font-style: italic; }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; }
.toggle-label { font-size: 12px; color: var(--text-muted); }
.toggle { position: relative; width: 36px; height: 20px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; transition: all var(--t-fast); }
.toggle input:checked + .toggle-track { background: var(--gold-dim); border-color: var(--gold); }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--text-dim); border-radius: 50%; transition: transform var(--t-fast); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); background: var(--gold); }

/* Check wrap */
.check-wrap { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: rgba(245,201,106,0.05); border: 1px solid var(--border-gold); border-radius: var(--r-sm); }
.check-wrap input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; accent-color: var(--gold); cursor: pointer; }
.check-wrap label { font-size: 11px; color: var(--text-muted); line-height: 1.7; cursor: pointer; font-family: var(--ff-serif); }

/* ── MODALS ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  z-index: 800; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg); backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
  width: 100%; max-width: 520px; max-height: 85vh;
  overflow-y: auto; animation: slideUp 0.3s var(--ease-snappy);
}
.modal-header { padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--ff-display); font-size: 16px; letter-spacing: 0.15em; color: var(--gold); }
.modal-close { color: var(--text-dim); font-size: 18px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); transition: all var(--t-fast); }
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: var(--sp-6); }
.modal-footer { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--sp-3); }

/* ── STEPPERS ───────────────────────────────────────────────── */
.stepper { display: flex; align-items: center; padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); flex-shrink: 0; overflow-x: auto; }
.stepper-step { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); cursor: pointer; transition: all var(--t-fast); flex-shrink: 0; }
.step-num { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; font-family: var(--ff-display); color: var(--text-dim); transition: all var(--t-fast); }
.step-label { font-family: var(--ff-display); font-size: 10px; letter-spacing: 0.1em; color: var(--text-dim); transition: all var(--t-fast); }
.stepper-step.active .step-num { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.stepper-step.active .step-label { color: var(--gold); }
.stepper-step.done .step-num { background: var(--gold-glow); border-color: var(--gold); color: var(--gold); }
.stepper-divider { flex: 1; height: 1px; background: var(--border); min-width: 20px; max-width: 60px; }

/* ── WAVEFORM PLAYER ────────────────────────────────────────── */
.waveform-player {
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.85));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.waveform-header { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.waveform-art { width: 48px; height: 48px; border-radius: var(--r-sm); background: linear-gradient(135deg, #1a1200, #2a1800); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.waveform-info { flex: 1; min-width: 0; }
.waveform-title { font-family: var(--ff-serif); font-size: 15px; font-style: italic; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.waveform-meta { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.waveform-body { padding: var(--sp-4) var(--sp-5); }
.waveform-canvas-wrap { position: relative; margin-bottom: var(--sp-3); cursor: pointer; border-radius: var(--r-sm); overflow: hidden; }
#waveform-canvas, #wp-canvas { width: 100%; display: block; }
.waveform-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold); pointer-events: none; }
.waveform-controls { display: flex; align-items: center; gap: var(--sp-4); }
.play-btn { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--amber)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--t-fast); box-shadow: var(--shadow-glow); }
.play-btn:hover { transform: scale(1.08); box-shadow: 0 0 36px rgba(245,201,106,0.5); filter: brightness(1.05); }
.play-btn svg { fill: #120c05; }
.waveform-time { font-family: monospace; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.waveform-volume { flex: 1; max-width: 80px; accent-color: var(--gold); cursor: pointer; }
.waveform-footer { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); display: flex; gap: var(--sp-2); }

/* ── PANEL HEADERS ──────────────────────────────────────────── */
.panel-header { padding: var(--sp-6) var(--sp-6) var(--sp-4); border-bottom: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-shrink: 0; }
/* ── Platform-wide header standard — matches RËEL Soundz™ ───────
   All panel/page titles use plain sans (22px/700) not --ff-display.
   Subtitle uses --ff-display uppercase small label.
   Description uses --ff-serif italic muted. */
.panel-title  { font-family: inherit; font-size: 22px; font-weight: 700; letter-spacing: 0.01em; color: #fff; line-height: 1.2; }
.panel-subtitle { font-family: var(--ff-display); font-size: 11px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-top: var(--sp-1); }
.panel-description { font-family: var(--ff-serif); font-style: italic; font-size: 13px; color: rgba(255,255,255,0.4); margin-top: var(--sp-1); }
.page-title   { font-family: inherit; font-size: 22px; font-weight: 700; letter-spacing: 0.01em; color: #fff; line-height: 1.2; }
.panel-content { padding: var(--sp-5) var(--sp-6); flex: 1; }

/* ── ENGINE SELECTOR ────────────────────────────────────────── */
.engine-selector { display: flex; gap: var(--sp-2); }
.engine-btn {
  flex: 1; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--ff-display); font-size: 11px;
  letter-spacing: 0.1em; color: var(--text-muted);
  text-align: center; cursor: pointer;
  transition: all var(--t-fast); user-select: none;
}
.engine-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.engine-btn.active { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); box-shadow: 0 0 16px rgba(245,201,106,0.15); }
.engine-note { font-size: 10px; color: var(--text-dim); margin-top: var(--sp-2); font-family: var(--ff-serif); font-style: italic; }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.animate-fadein  { animation: fadeIn  0.3s ease forwards; }
.animate-slideup { animation: slideUp 0.4s var(--ease-snappy) forwards; }

/* ── SPOTLIGHT ARTIST SECTION ───────────────────────────────── */
.spotlight-section {
  position: relative; margin-bottom: 28px;
  padding: 32px 32px 40px;
  border-radius: 24px;
  background: radial-gradient(circle at 0 0, rgba(245,201,106,0.1), rgba(5,5,9,0.95));
  box-shadow: var(--shadow-soft);
  overflow: hidden; border: 1px solid rgba(255,255,255,0.05);
}
.spotlight-inner {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  gap: 32px; align-items: center;
}
.spotlight-cover-wrap { position: relative; max-width: 320px; aspect-ratio: 1/1; margin: 0 auto; }
.spotlight-cover-glow {
  position: absolute; inset: -40px;
  background:
    radial-gradient(circle at 30% 0%,   rgba(245,201,106,0.35), transparent 65%),
    radial-gradient(circle at 80% 100%, rgba(144,92,255,0.32),  transparent 65%);
  filter: blur(40px); opacity: 0.85; z-index: 0;
}
.spotlight-cover {
  width: 100%; height: 100%; border-radius: 20px;
  object-fit: cover; box-shadow: var(--shadow-soft);
  position: relative; z-index: 1;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}
.spotlight-cover-wrap:hover .spotlight-cover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-glow); }
.spotlight-label { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; font-family: var(--ff-display); }
.spotlight-title { font-family: var(--ff-display); font-size: 2.6rem; line-height: 1.05; letter-spacing: 0.08em; margin: 0 0 6px; color: var(--text); }
.spotlight-artist { font-size: 1rem; color: var(--text-muted); margin-bottom: 14px; letter-spacing: 0.1em; font-family: var(--ff-display); }
.spotlight-description { font-family: var(--ff-serif); font-style: italic; font-size: 1rem; color: var(--text-muted); max-width: 420px; margin-bottom: 20px; line-height: 1.8; }

/* Spotlight mini player */
.spotlight-player {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 999px;
}

@media (max-width: 900px) {
  .spotlight-inner { grid-template-columns: 1fr; }
  .spotlight-cover-wrap { max-width: 240px; }
}

/* ── CINEMATIC PANEL CONTENT WRAPPER ────────────────────────── */
/* Applied to scrollable content areas inside panels */
.cinematic-panel {
  background: transparent;
  min-height: 100%;
}

.cinematic-section {
  background: linear-gradient(145deg, rgba(255,255,255,0.025), rgba(0,0,0,0.5));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 16px;
  overflow: hidden;
}

/* Studio Pro panel glass surface */
.studio-glass {
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.7));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

/* Animated meter bars */
.meter-bar {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--violet));
  transition: width 0.6s var(--ease-snappy);
  box-shadow: 0 0 8px rgba(245,201,106,0.3);
}

/* Energy map canvas */
.energy-canvas {
  width: 100%;
  border-radius: var(--r-sm);
  display: block;
}

/* Upload drop zone */
.drop-zone {
  border: 2px dashed rgba(245,201,106,0.25);
  border-radius: var(--r-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(245,201,106,0.02);
}
.drop-zone:hover {
  border-color: rgba(245,201,106,0.5);
  background: rgba(245,201,106,0.05);
  box-shadow: 0 0 24px rgba(245,201,106,0.08);
}
.drop-zone.drag-over {
  border-color: var(--gold);
  background: rgba(245,201,106,0.08);
}

/* Production note cards */
.note-card {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--gold);
  background: rgba(245,201,106,0.04);
  margin-bottom: 8px;
  animation: slideUp 0.3s var(--ease-snappy) forwards;
}
.note-card.note-warning { border-left-color: var(--amber); background: rgba(245,120,60,0.04); }
.note-card.note-info    { border-left-color: var(--violet); background: rgba(144,92,255,0.04); }
.note-card.note-good    { border-left-color: var(--green);  background: rgba(75,225,165,0.04); }

/* Emotional profile cards */
.profile-card {
  padding: 20px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.7));
  cursor: pointer;
  transition: all 0.22s var(--ease-snappy);
  position: relative;
  overflow: hidden;
}
.profile-card::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(245,201,106,0), rgba(245,201,106,0.3));
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: rgba(245,201,106,0.3); }
.profile-card:hover::before { opacity: 1; }
.profile-card.selected { border-color: var(--gold); background: linear-gradient(145deg, rgba(245,201,106,0.08), rgba(0,0,0,0.7)); }

/* ══ Global Color + Contrast Patch (Patch 4) ══════════════════ */
.price-card,
.bundle-card,
.service-card,
.addon-card,
.studio-glass,
.card-song {
  background: linear-gradient(
    180deg,
    rgba(20,18,12,0.96),
    rgba(8,8,6,0.98)
  ) !important;
  border: 1px solid rgba(215,184,79,0.28) !important;
}

.price-card:hover,
.bundle-card:hover,
.service-card:hover,
.addon-card:hover {
  border-color: rgba(240,217,118,0.55) !important;
  background: linear-gradient(
    180deg,
    rgba(28,24,14,0.98),
    rgba(10,9,6,0.98)
  ) !important;
}

/* Patch 4C — Card text */
.price-tier-name,
.bundle-name,
.service-name,
.addon-name {
  color: #F0D976;
}

.price-features li,
.bundle-features li,
.service-desc {
  color: #D8CFB8;
}

/* Patch 4B — How It Works step numbers */
.how-step-num,
.step-num {
  background: rgba(215,184,79,0.28);
  color: #F0D976;
}
.how-step-num:hover,
.step-num:hover {
  background: rgba(240,217,118,0.42);
}

/* Patch 1B/1E — Global min-width: 0 safety */
.panel-module,
.cover-workspace,
.voice-workspace,
.visuals-workspace,
.preview-container,
.studio-glass {
  min-width: 0;
}

/* Patch 1E/1F — Width safety */
.workspace-container,
.preview-panel,
.generation-section,
.card-wrapper {
  width: 100%;
  max-width: 100%;
}

/* ══ Patch 3 — Artist Identity Pill Safety ════════════════════ */
.mv-gender-pill,
.mv-body-pill,
.mv-skin-pill,
.mv-hair-pill,
.mv-presence-pill,
[data-group] {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 5;
}

/* ══ Patch 1I — Global Box Sizing Safety ══════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
}

img, video, canvas, iframe {
  max-width: 100%;
  height: auto;
}
