/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6c63ff;
  --primary-dark: #574fd6;
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --text: #e8e8f0;
  --text-muted: #888;
  --border: #2a2a4a;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

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

/* ── Navbar ──────────────────────────────────────────────────────────── */
.navbar {
  background: rgba(15,15,26,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.navbar nav { display: flex; gap: 20px; align-items: center; }
.navbar nav a { color: var(--text-muted); transition: color .2s; font-size: .95rem; }
.navbar nav a:hover { color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  transition: background .2s, transform .1s;
  display: inline-block;
  border: none; cursor: pointer;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; border-radius: 10px; }

.btn-outline {
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all .2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-download {
  display: inline-flex; align-items: center; gap: 8px;
  background: #22c55e; color: #fff;
  padding: 10px 20px; border-radius: 8px; font-weight: 600;
  transition: background .2s;
}
.btn-download:hover { background: #16a34a; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 80px 20px; }
.hero h1 { font-size: 3rem; font-weight: 700; margin-bottom: 16px; }
.hero-subtitle { color: var(--text-muted); font-size: 1.2rem; margin-bottom: 32px; }

/* ── Features ────────────────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; padding: 40px 20px; }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: transform .2s;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

/* ── Video Player ─────────────────────────────────────────────────────── */
.dark-page { background: #000; }
.player-wrapper { max-width: 960px; margin: 0 auto; padding: 20px; }

.video-container { border-radius: 12px; overflow: hidden; background: #000; position: relative; }
.video-player { width: 100%; display: block; max-height: 75vh; }
.video-container.portrait .video-player { max-height: 90vh; max-width: 480px; margin: 0 auto; }

.player-info { padding: 20px 0; }
.player-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.video-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 16px; }
.video-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.credit { color: var(--text-muted); font-size: .85rem; }
.duration { color: var(--text-muted); font-size: .9rem; }

/* ── Platform badges ─────────────────────────────────────────────────── */
.platform-badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: .8rem; font-weight: 600;
}
.platform-youtube { background: #ff000022; color: #ff4444; border: 1px solid #ff444433; }
.platform-tiktok  { background: #00f2ea22; color: #00f2ea; border: 1px solid #00f2ea33; }
.platform-vk      { background: #2787f522; color: #2787f5; border: 1px solid #2787f533; }
.platform-soundcloud { background: #ff550022; color: #ff5500; border: 1px solid #ff550033; }
.platform-apple_music { background: #fc3c4422; color: #fc3c44; border: 1px solid #fc3c4433; }

/* ── Music Player ─────────────────────────────────────────────────────── */
.music-page { background: linear-gradient(135deg, #0f0f1a 0%, #1a0a2e 100%); }
.music-player-wrapper { max-width: 560px; margin: 40px auto; padding: 20px; }

.album-art {
  width: 100%; aspect-ratio: 1;
  border-radius: 16px;
  background-size: cover; background-position: center;
  box-shadow: 0 20px 60px rgba(108,99,255,.4);
  margin-bottom: 28px;
}
.album-art.no-art {
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
}

.music-info { text-align: center; margin-bottom: 24px; }
.track-title { font-size: 1.5rem; font-weight: 700; margin-top: 10px; }

.custom-player {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.play-btn {
  background: var(--primary); color: #fff;
  border: none; border-radius: 50%;
  width: 56px; height: 56px; font-size: 1.2rem; cursor: pointer;
  align-self: center; transition: background .2s;
}
.play-btn:hover { background: var(--primary-dark); }

.progress-container {
  background: var(--border); border-radius: 4px; height: 6px; cursor: pointer; position: relative;
}
.progress-bar { background: var(--primary); height: 100%; border-radius: 4px; transition: width .1s linear; }

.time-display { font-size: .85rem; color: var(--text-muted); text-align: center; }
.volume-container { display: flex; align-items: center; gap: 8px; }
.volume-container input { flex: 1; accent-color: var(--primary); }

.audio-actions { text-align: center; margin-top: 20px; }

/* ── Dashboard ───────────────────────────────────────────────────────── */
.dashboard { padding: 40px 20px; }
.dashboard-header {
  display: flex; align-items: center; gap: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 28px;
}
.user-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 1.8rem; font-weight: 700; flex-shrink: 0;
}
.user-info h2 { font-size: 1.4rem; }
.username, .joined { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }

.section-title { font-size: 1.2rem; margin-bottom: 16px; }
.downloads-list { display: flex; flex-direction: column; gap: 12px; }

.download-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  transition: background .2s, transform .1s;
}
.download-card:hover { background: var(--bg-card-hover); transform: translateX(4px); }

.dl-thumb {
  width: 72px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.no-thumb {
  width: 72px; height: 52px; border-radius: 8px;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.dl-info { flex: 1; min-width: 0; }
.dl-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: .8rem; color: var(--text-muted); }
.dl-type { font-size: 1.3rem; }

.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* ── Auth ─────────────────────────────────────────────────────────────── */
.auth-wrapper { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding: 20px; }
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px; text-align: center;
  max-width: 400px; width: 100%;
}
.auth-card h1 { font-size: 2rem; margin-bottom: 12px; }
.auth-card p { color: var(--text-muted); margin-bottom: 24px; }
.alert { background: #ff444422; border: 1px solid #ff444444; border-radius: 8px; padding: 12px; margin-bottom: 16px; color: #ff8080; }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; color: var(--text-muted); font-size: .85rem; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 2rem; }
  .dashboard-header { flex-direction: column; text-align: center; }
}
