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

:root {
  --primary: #6c63ff;
  --primary-dark: #574fd6;
  --secondary: #ff6584;
  --bg: #0d0d14;
  --bg2: #13131f;
  --bg3: #1a1a2e;
  --card: #16162a;
  --border: rgba(255,255,255,0.07);
  --text: #f0f0f8;
  --text-muted: #8888aa;
  --success: #1db954;
  --error: #ff4d6d;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 700; color: var(--text); text-decoration: none; }
.logo i { color: var(--primary); font-size: 1.5rem; }
.logo b { color: var(--primary); }
nav { display: flex; gap: 28px; }
nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 90px 0 60px;
  background: radial-gradient(ellipse at 60% 0%, rgba(108,99,255,0.18) 0%, transparent 70%),
              radial-gradient(ellipse at 10% 80%, rgba(255,101,132,0.1) 0%, transparent 60%);
  text-align: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  color: #a89dff;
  padding: 6px 16px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; margin-bottom: 24px;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; margin-bottom: 18px; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { font-size: 1.08rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 40px; }

/* Search Box */
.search-box {
  display: flex; gap: 12px; max-width: 760px; margin: 0 auto 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}
.input-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; color: var(--text-muted); font-size: 0.95rem; }
.input-wrap input {
  width: 100%; background: transparent;
  border: none; outline: none;
  color: var(--text); font-size: 1rem; font-family: 'Inter', sans-serif;
  padding: 12px 42px 12px 40px;
}
.input-wrap input::placeholder { color: var(--text-muted); }
.clear-btn {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.9rem; padding: 4px 6px;
  border-radius: 6px; display: none;
}
.clear-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-download {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; cursor: pointer;
  font-size: 0.97rem; font-weight: 600; font-family: 'Inter', sans-serif;
  padding: 12px 28px; border-radius: 10px;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-download:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-download:active { transform: translateY(0); }
.btn-download:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Platform Pills */
.platform-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.platform-pills span {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.82rem; color: var(--text-muted);
}
.platform-pills span i { font-size: 0.9rem; }

/* Result Area */
#resultArea { margin: 32px 0; }

.loading-box {
  text-align: center; padding: 48px 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.25);
  padding: 18px 22px; border-radius: var(--radius); color: var(--error);
}

.result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.result-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(108,99,255,0.06);
}
.result-header .platform-tag {
  display: flex; align-items: center; gap: 6px;
  background: rgba(108,99,255,0.15);
  color: #a89dff; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
}
.result-header h3 { font-size: 1rem; font-weight: 600; }

.result-body { padding: 22px; }

/* Thumbnail */
.thumb-wrap { margin-bottom: 20px; border-radius: 12px; overflow: hidden; max-height: 320px; background: #000; text-align: center; }
.thumb-wrap img { max-width: 100%; max-height: 320px; object-fit: contain; }

/* Download Links */
.dl-links { display: flex; flex-direction: column; gap: 10px; }
.dl-link {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  text-decoration: none; color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}
.dl-link:hover { background: rgba(108,99,255,0.1); border-color: rgba(108,99,255,0.3); }
.dl-link-left { display: flex; align-items: center; gap: 12px; }
.dl-link-left i { font-size: 1.2rem; color: var(--primary); }
.dl-link-info span { display: block; font-size: 0.92rem; font-weight: 600; }
.dl-link-info small { font-size: 0.78rem; color: var(--text-muted); }
.dl-btn {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; font-family: 'Inter', sans-serif;
  padding: 8px 16px; border-radius: 8px; text-decoration: none;
  transition: opacity 0.2s;
}
.dl-btn:hover { opacity: 0.85; }

/* Audio result */
.audio-result { display: flex; flex-direction: column; gap: 14px; }
.audio-info { display: flex; align-items: center; gap: 16px; }
.audio-cover { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.audio-meta h3 { font-size: 1rem; font-weight: 700; }
.audio-meta p { font-size: 0.85rem; color: var(--text-muted); }

/* Platforms Section */
.platforms { padding: 80px 0; }
.platforms h2, .how h2 { text-align: center; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 48px; }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.platform-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 16px;
  text-align: center; transition: transform 0.2s, border-color 0.2s;
}
.platform-card:hover { transform: translateY(-4px); border-color: rgba(108,99,255,0.3); }
.platform-card i { font-size: 2rem; margin-bottom: 10px; }
.platform-card span { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.platform-card small { color: var(--text-muted); font-size: 0.78rem; }

/* How to use */
.how { padding: 80px 0; background: var(--bg2); }
.steps { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.step {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 28px;
  text-align: center; flex: 1; min-width: 180px; max-width: 260px;
  position: relative;
}
.step-num {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
}
.step i { font-size: 2rem; color: var(--primary); margin-bottom: 14px; }
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 0.85rem; color: var(--text-muted); }
.step-arrow { color: var(--text-muted); font-size: 1.2rem; }

/* Footer */
footer {
  text-align: center; padding: 48px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
footer .logo { justify-content: center; margin-bottom: 12px; }
footer p { color: var(--text-muted); font-size: 0.88rem; margin-top: 6px; }
footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-note { font-size: 0.78rem; margin-top: 8px; }

/* Source badge */
.source-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.source-badge.own { background: rgba(29,185,84,0.12); color: #1db954; border: 1px solid rgba(29,185,84,0.25); }
.source-badge.fallback { background: rgba(255,165,0,0.12); color: #ffa500; border: 1px solid rgba(255,165,0,0.25); }

/* Result meta */
.result-meta { margin-bottom: 16px; }
.result-title { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 4px; word-break: break-word; }
.result-author { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }

/* Responsive */
@media (max-width: 640px) {
  .search-box { flex-direction: column; }
  .btn-download { justify-content: center; }
  .step-arrow { transform: rotate(90deg); }
  nav { display: none; }
}
