/* ============================================
   SOUNDAURA - AI BGM & SFX Recommender
   webifyaura.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --primary: #7C3AED;
  --primary-light: #8B5CF6;
  --primary-dark: #6D28D9;
  --accent: #06B6D4;
  --bg: #0F0F13;
  --bg2: #18181F;
  --bg3: #1E1E28;
  --border: #2A2A38;
  --text: #F1F1F3;
  --text-muted: #9090A8;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- HEADER ---- */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.logo-text span {
  color: var(--primary-light);
}

.usage-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.usage-badge .dots {
  display: flex;
  gap: 3px;
}

.usage-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.usage-badge .dot.used {
  background: var(--primary-light);
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 48px 24px 32px;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--primary-light);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ---- MAIN CONTAINER ---- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ---- UPLOAD AREA ---- */
.upload-section {
  margin-bottom: 24px;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg2);
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.upload-area h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-area p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.upload-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-btn:hover {
  background: var(--primary-dark);
}

.upload-formats {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

#fileInput {
  display: none;
}

/* ---- PREVIEW ---- */
.preview-area {
  display: none;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.preview-area img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
}

.preview-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.preview-btn {
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}

.preview-btn:hover {
  background: rgba(0,0,0,0.9);
}

/* ---- OPTIONS ---- */
.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.option-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.option-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.option-card select,
.option-card input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.option-card select:focus,
.option-card input:focus {
  border-color: var(--primary);
}

/* ---- ANALYZE BUTTON ---- */
.analyze-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.analyze-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- LOADING ---- */
.loading-area {
  display: none;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 24px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-text {
  font-size: 15px;
  color: var(--text-muted);
}

.loading-steps {
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary-light);
}

/* ---- RESULTS ---- */
.results-area {
  display: none;
  margin-top: 24px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.result-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.new-analysis-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.new-analysis-btn:hover {
  border-color: var(--primary);
}

/* Result Cards */
.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.result-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.icon-scene { background: rgba(6, 182, 212, 0.15); }
.icon-bgm { background: rgba(124, 58, 237, 0.15); }
.icon-sfx { background: rgba(16, 185, 129, 0.15); }
.icon-search { background: rgba(245, 158, 11, 0.15); }

.result-card-title {
  font-size: 16px;
  font-weight: 600;
}

.result-card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Scene Brief */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.scene-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.scene-chip-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.scene-chip-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* BGM */
.bgm-main {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
}

.bgm-description {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}

.bgm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bgm-tag {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
}

/* SFX Stack */
.sfx-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sfx-item {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 3px solid var(--success);
}

.sfx-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 70px;
  padding-top: 1px;
}

.sfx-desc {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

/* Search Queries */
.search-queries {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.query-item {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.query-platform {
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
  min-width: 120px;
}

.query-text {
  font-size: 13px;
  color: var(--text);
  font-family: monospace;
  flex: 1;
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* Negative Prompts */
.negative-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.neg-tag {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #FC8181;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mixing Notes */
.mixing-notes {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  border-left: 3px solid var(--accent);
}

/* Export Bar */
.export-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.export-bar p {
  font-size: 14px;
  color: var(--text-muted);
}

.export-btns {
  display: flex;
  gap: 8px;
}

.export-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.export-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ---- LIMIT MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.modal h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-timer {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 20px;
  font-family: monospace;
}

.modal-close {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
}

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .options-row { grid-template-columns: 1fr; }
  .query-item { flex-direction: column; align-items: flex-start; }
  .export-bar { flex-direction: column; align-items: flex-start; }
  header { padding: 12px 16px; }
}
