:root {
  --royal: #2a45ff;
  --royal-dark: #1d2fb5;
  --black: #0b0c10;
  --mid: #121722;
  --red: #e63946;
  --ink: #d8e1ff;
  --muted: #9aa4c3;
  --card: #0f1320;
  --border: #1e2a44;
  --glow: 0 12px 40px rgba(42, 69, 255, 0.2);
  --radius: 14px;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: #f4f6ff;
  background: radial-gradient(circle at 20% 20%, rgba(42, 69, 255, 0.08), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(230, 57, 70, 0.08), transparent 28%),
    linear-gradient(135deg, #05070d 0%, #0c0f19 60%, #090b13 100%);
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
}

.hidden {
  display: none;
}

.splash {
  position: relative;
  min-height: 88vh;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-bottom: 22px;
  isolation: isolate;
}

.splash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(5, 7, 13, 0.55), rgba(12, 15, 25, 0.65)),
    radial-gradient(circle at 70% 20%, rgba(42, 69, 255, 0.35), transparent 40%),
    radial-gradient(circle at 25% 80%, rgba(230, 57, 70, 0.22), transparent 32%);
  pointer-events: none;
  z-index: 1;
}

.splash-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) brightness(0.8);
  z-index: 0;
}

.splash-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 48px;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto 64px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand span {
  color: var(--red);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-widget {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s ease;
}

.profile-btn:hover {
  background: rgba(42, 69, 255, 0.1);
  border-color: var(--royal);
}

.profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 160px;
  z-index: 100;
}

.profile-menu.hidden {
  display: none;
}

.profile-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s ease;
}

.profile-menu-item:hover {
  background: rgba(42, 69, 255, 0.2);
}

.profile-menu-item.danger:hover {
  background: rgba(230, 57, 70, 0.2);
}

.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.settings-modal.hidden {
  display: none;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--glow), 0 30px 80px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.settings-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 140, 0, 0.08), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.settings-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.settings-card h2 {
  margin: 0 0 24px;
  font-size: 22px;
  position: relative;
  z-index: 1;
  background: linear-gradient(120deg, #f4f6ff 0%, var(--ink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-card .form {
  position: relative;
  z-index: 1;
}

.settings-card .form-row label {
  color: var(--muted);
  font-size: 12px;
}

.settings-card .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.env-pill {
  padding: 8px 14px;
  background: rgba(42, 69, 255, 0.15);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--glow);
}

.hero {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.lede {
  color: var(--ink);
  margin: 0;
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #eaf0ff;
  background: rgba(42, 69, 255, 0.15);
  border: 1px solid var(--border);
}

.pill-warn {
  background: rgba(230, 57, 70, 0.12);
  border-color: rgba(230, 57, 70, 0.35);
  color: #ffc7cf;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

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

input,
textarea,
select {
  background: #0b0f1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: #f7f9ff;
  font-size: 15px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 1px solid rgba(42, 69, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(42, 69, 255, 0.2);
}

.file-row input {
  padding: 10px;
  background: transparent;
}

.artwork-preview {
  margin-top: 12px;
  padding: 16px;
  background: #0b0f1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.artwork-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.artwork-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artwork-info span {
  font-size: 13px;
  color: var(--muted);
}

.btn-text {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
  text-align: left;
  font-weight: 500;
}

.btn-text:hover {
  text-decoration: underline;
}

/* Upload Status Styles */
.upload-status {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.upload-status.uploading {
  border-color: var(--royal);
  background: rgba(42, 69, 255, 0.05);
}

.upload-status.success {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.05);
}

.upload-status.error {
  border-color: var(--red);
  background: rgba(230, 57, 70, 0.05);
}

.upload-status-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--royal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.upload-status.success .upload-spinner {
  border: none;
  background: #00ff88;
  border-radius: 50%;
  position: relative;
  animation: none;
}

.upload-status.success .upload-spinner::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--black);
  font-weight: bold;
  font-size: 16px;
}

.upload-status.error .upload-spinner {
  border: none;
  background: var(--red);
  border-radius: 50%;
  position: relative;
  animation: none;
}

.upload-status.error .upload-spinner::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 16px;
}

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

.upload-status-text {
  flex: 1;
}

.upload-status-text strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.upload-status-text p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--royal), #00ff88);
  width: 0%;
  transition: width 0.3s ease;
}

.upload-status.error .upload-progress-fill {
  background: var(--red);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  color: #f7f9ff;
  background: #111627;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn.big {
  padding: 14px 18px;
  font-size: 16px;
}

.btn.shimmer {
  background: linear-gradient(
    90deg,
    #ff8c00 0%,
    #ff9f1c 25%,
    #ff8c00 50%,
    #ff9f1c 75%,
    #ff8c00 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2.5s ease-in-out infinite;
  border: 1px solid rgba(255, 140, 0, 0.6);
  box-shadow: 0 0 30px rgba(255, 140, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

@keyframes shimmer {
  0%, 100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 0%;
  }
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(120deg, var(--royal) 0%, var(--royal-dark) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(42, 69, 255, 0.35);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.danger {
  background: var(--red);
  border-color: rgba(230, 57, 70, 0.5);
}

.btn.tiny {
  padding: 6px 10px;
  font-size: 12px;
}

.helper-text {
  font-size: 12px;
  color: var(--muted);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #0c101c;
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-title {
  margin: 0 0 4px;
  font-size: 16px;
}

.item-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.item-badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(42, 69, 255, 0.12);
  border: 1px solid var(--border);
  color: var(--ink);
}

.item-desc {
  margin: 6px 0 8px;
  color: #d8ddf3;
  font-size: 14px;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.item-vinyl-icon {
  color: #ff8c00;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.player-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.player-modal.hidden {
  display: none;
}

.player-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.player-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.player-vinyl {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.player-vinyl svg {
  width: 180px;
  height: 180px;
  filter: drop-shadow(0 10px 30px rgba(255, 140, 0, 0.2));
  animation: spin 8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.player-info {
  text-align: center;
  margin-bottom: 20px;
}

.player-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.player-artist {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.player-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn.small {
  padding: 8px 10px;
  font-size: 14px;
}

.progress-bar {
  height: 4px;
  background: rgba(42, 69, 255, 0.3);
  border-radius: 2px;
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  height: 100%;
  background: #ff8c00;
  border-radius: 2px;
  width: 0%;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.player-playlist {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.player-playlist h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.playlist-items {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.playlist-item {
  padding: 8px 10px;
  background: #0c101c;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.playlist-item:hover {
  background: #121b2e;
  border-color: var(--border);
}

.playlist-item.active {
  background: rgba(42, 69, 255, 0.15);
  border-color: var(--royal);
}

.playlist-item-title {
  font-size: 13px;
  margin: 0;
}

.playlist-item-artist {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 0;
}

/* ==================== PRODUCER SECTION ==================== */

.producer-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.producer-section.hidden {
  display: none;
}

/* ==================== ANALYTICS CARD ==================== */

.analytics-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--card) 0%, rgba(42, 69, 255, 0.08) 100%);
  border: 1px solid rgba(42, 69, 255, 0.25);
  box-shadow: 0 10px 40px rgba(42, 69, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.analytics-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(42, 69, 255, 0.1), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.analytics-card .card-header {
  position: relative;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.stat {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat:hover {
  background: rgba(42, 69, 255, 0.1);
  border-color: rgba(42, 69, 255, 0.4);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #ff8c00;
  margin: 0;
  font-family: 'Courier New', monospace;
}

.stat-name {
  font-size: 14px;
  color: var(--ink);
  margin: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== PROFILE SETUP MODAL ==================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 997;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--glow), 0 30px 80px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 140, 0, 0.08), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  background: linear-gradient(120deg, #f4f6ff 0%, var(--ink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-slug-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0b0f1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
}

.profile-slug-input span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.profile-slug-input input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 0;
  color: #f7f9ff;
  font-size: 15px;
}

.profile-slug-input input:focus {
  outline: none;
  box-shadow: none;
}

.genre-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.genre-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.genre-checkboxes label:hover {
  background: rgba(42, 69, 255, 0.1);
  border-color: rgba(42, 69, 255, 0.4);
}

.genre-checkboxes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--royal);
}

#profile-visible {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--royal);
}

.modal-content .form {
  position: relative;
  z-index: 1;
}

.modal-content .form-row label {
  color: var(--muted);
  font-size: 12px;
}

.modal-content .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */

@media (max-width: 720px) {
  body {
    padding: 16px;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .splash-overlay {
    padding: 28px;
  }

  .splash-title {
    font-size: 32px;
  }

  .player-card {
    max-width: 100%;
    border-radius: 16px;
  }

  .player-vinyl svg {
    width: 140px;
    height: 140px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    padding: 20px;
  }

  .modal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-header h2 {
    font-size: 18px;
  }
}
