/* -------------------------------------------------------
   SonicConverter Analyzer — Dark production-studio aesthetic
   ------------------------------------------------------- */

:root {
  --bg: rgb(20, 18, 19);
  --surface: #1a1818;
  --card: #231f20;
  --border: #3a3636;
  --text: #e8e8f0;
  --text-dim: #888899;
  --accent: #D8E166;
  --accent-light: #B5C851;
  --accent-glow: rgba(216, 225, 102, 0.25);
  --success: #B0C936;
  --danger: #ff6b6b;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-image: url('bg.png');
  background-repeat: repeat;
  background-color: rgb(20, 18, 19);
  background-size: auto;
  background-position: center;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
/* ---- HERO LOGO (Animated Pie) ---- */
.hero-logo {
  width: 240px;
  height: 180px;
  margin: 0 auto 28px;
}
.hero-logo svg {
  width: 100%;
  height: 100%;
}
.hero-logo #Main_Pie > .path-trace {
  stroke: #000;
  stroke-width: 16;
  fill: none;
}

/* Fill classes for the pie SVG */
.hero-logo .cls-1 { fill: #a0cc33; }
.hero-logo .cls-2 { fill: #c5d979; }
.hero-logo .cls-3 { fill: #c4e64d; }
.hero-logo .cls-4 { fill: #bbc38b; }
.hero-logo .cls-5 { fill: #878e42; }
.hero-logo .cls-6 { fill: #000; }
.hero-logo #Main_Pie > path:not([class]) { fill: #000; }
.hero-logo #Lime path { fill: #a0cc33; }
.hero-logo #Lime_Splooge path { fill: #c4e64d; }
.hero-logo #Notes path { fill: #000; }

/* Lime base pulsing animation */
@keyframes saturateLime {
  0% { fill: #a0cc33; }
  50% { fill: #c8ff41; }
  100% { fill: #a0cc33; }
}
.hero-logo .lime-base {
  animation: saturateLime 4s ease-in-out infinite;
}

/* Splooge pulsing animation */
@keyframes pulseSplooge {
  0% { transform: scale(0.5); fill: #a0cc33; }
  50% { transform: scale(1.1); fill: #c4e64d; }
  100% { transform: scale(0.5); fill: #a0cc33; }
}
.hero-logo .splooge {
  animation: pulseSplooge 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.hero-logo #splooge1 { transform-origin: 1440px 762px; animation-delay: 0s; }
.hero-logo #splooge2 { transform-origin: 820px 800px; animation-delay: 0.4s; }
.hero-logo #splooge3 { transform-origin: 504px 770px; animation-delay: 0.8s; }
.hero-logo #splooge4 { transform-origin: 634px 980px; animation-delay: 1.2s; }
.hero-logo #splooge5 { transform-origin: 940px 977px; animation-delay: 1.6s; }
.hero-logo #splooge6 { transform-origin: 1140px 990px; animation-delay: 2s; }

/* Notes rocking animation */
@keyframes rockNote {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}
.hero-logo .note {
  transform-origin: center;
  animation: rockNote 2s linear infinite;
}
.hero-logo #Note_1 { transform-origin: 607px 896px; animation-delay: 0s; }
.hero-logo #Note_2 { transform-origin: 712px 980px; animation-delay: 0.2s; }
.hero-logo #Note_3 { transform-origin: 941px 870px; animation-delay: 0.4s; }
.hero-logo #Note_4 { transform-origin: 1053px 1051px; animation-delay: 0.6s; }
.hero-logo #Note_5 { transform-origin: 1206px 831px; animation-delay: 0.8s; }
.hero-logo #Note_6 { transform-origin: 1273px 973px; animation-delay: 1s; }
.hero-logo #Note_7 { transform-origin: 1550px 1069px; animation-delay: 1.2s; }

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-light);
  border: 1px solid var(--accent);
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #1a1a2e;
  border: none;
  padding: 14px 36px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--accent-light);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface);
}
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--text-dim);
  border-color: var(--border);
}

/* ---- SECTIONS ---- */
.section {
  margin-top: 48px;
}
.section h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.section-sub {
  color: var(--text-dim);
  margin-bottom: 24px;
}
.section-centered {
  text-align: center;
}
.section-centered h2,
.section-centered .section-sub {
  text-align: center;
}

.hidden { display: none !important; }

/* ---- FORM ---- */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
}
.form-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text);
}
.form-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus {
  border-color: var(--accent);
}
.form-card .btn-primary {
  width: 100%;
  margin-top: 8px;
}
.form-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 12px;
}

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(216, 225, 102, 0.06);
}
.upload-icon {
  color: var(--accent-light);
  margin-bottom: 12px;
}
.upload-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}
.upload-hint {
  font-size: 13px;
  color: var(--text-dim);
}

.genre-picker {
  margin-top: 16px;
  text-align: center;
}
.genre-picker label {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: 8px;
}
.genre-picker select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
}
.selected-file span {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 16px;
}

/* ---- LOADER ---- */
.loader {
  text-align: center;
  padding: 60px 0;
}
.loader h2 {
  margin-bottom: 8px;
}
.loader-sub {
  color: var(--text-dim);
  font-size: 14px;
}
.loader-ring {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- RESULTS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 4px;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.result-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.card-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* EQ bars */
.eq-chart {
  margin-top: 16px;
}
.eq-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.eq-label {
  width: 80px;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.eq-bar-bg {
  flex: 1;
  height: 20px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
.eq-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
  transition: width 0.6s ease;
}
.eq-value {
  width: 50px;
  text-align: right;
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
  padding-left: 8px;
}

/* Emotion tags */
.emotion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.emotion-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 6px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
}
.emotion-score {
  font-size: 12px;
  opacity: 0.7;
}

/* Matches table */
.matches-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
.matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.matches-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.matches-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.matches-table tr:hover td {
  background: rgba(216, 225, 102, 0.04);
}
.match-sim {
  color: var(--accent-light);
  font-weight: 700;
}
.match-artist a {
  color: var(--text);
  text-decoration: none;
}
.match-artist a:hover {
  color: var(--accent-light);
}
.match-tier {
  text-transform: capitalize;
  color: var(--text-dim);
}
.match-genre {
  color: var(--text-dim);
  font-size: 12px;
}
.match-emotions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mini-tag {
  background: var(--surface);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

/* Recommendations */
.rec-list {
  list-style: none;
  margin-top: 12px;
}
.rec-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.rec-list li:last-child { border-bottom: none; }
.rec-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* CTA */
.cta-card {
  background: linear-gradient(135deg, rgba(216,225,102,0.15), rgba(181,200,81,0.08));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-bottom: 16px;
}
.cta-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.cta-card p {
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ---- OPTIONAL LABEL ---- */
.optional-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

/* ---- GENRE CALLOUT ---- */
.genre-callout {
  background: var(--card);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.genre-callout-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.genre-callout-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.2;
}
.genre-callout-detail {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ---- CONVERSION CARD ---- */
.conversion-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.conversion-card h3 {
  font-size: 18px;
  margin-bottom: 16px;
}
.conversion-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.conversion-stat {
  text-align: center;
  padding: 16px 24px;
  background: var(--surface);
  border-radius: 8px;
  min-width: 120px;
}
.conversion-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.2;
}
.conversion-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 4px;
}
.conversion-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.conversion-opportunity {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}
.fan-number {
  font-weight: 700;
  color: var(--accent-light);
}

/* Conversion column in matches table */
.match-conversion {
  color: var(--success);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .container { padding: 16px 16px 48px; }
  .hero { padding: 48px 0 40px; }
  .form-card { padding: 24px 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .result-card { padding: 20px 16px; }
}

/* ---- FLOATING PIES (Asteroids-style drift) ---- */
.floating-pie {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: -1;
  will-change: transform;
  transition: opacity 0.3s ease;
}
