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

:root {
  --bg: #030712;
  --bg-card: #111827;
  --bg-input: #1f2937;
  --border: rgba(255,255,255,0.05);
  --border-hover: rgba(255,255,255,0.2);
  --border-input: #374151;
  --border-focus: #06b6d4;
  --text: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --cyan-bg: rgba(6,182,212,0.1);
  --cyan-border: rgba(6,182,212,0.2);
  --purple: #a855f7;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #facc15;
  --orange: #fb923c;
  --radius-sm: 0.5rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --transition: 0.2s ease;
}

html { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ── Utilities ──────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.gradient-text {
  background: linear-gradient(to right, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(3,7,18,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 1.5rem;
  max-width: 1280px; margin: 0 auto;
}
.nav__logo {
  font-size: 1.125rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.5rem;
}
.nav__links { display: flex; align-items: center; gap: 1.5rem; }
.nav__link { font-size: 0.875rem; color: var(--text-secondary); transition: color var(--transition); }
.nav__link:hover, .nav__link.active { color: var(--text); }
.nav__link--admin {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  transition: border-color var(--transition), background var(--transition);
}
.nav__link--admin:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.05); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 5rem 0 4rem; }
.hero__glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none;
}
.hero__glow--1 {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 600px; height: 600px; background: rgba(6,182,212,0.1);
}
.hero__glow--2 {
  top: 25%; left: 25%;
  width: 400px; height: 400px; background: rgba(168,85,247,0.1);
}
.hero__content { position: relative; text-align: center; max-width: 56rem; margin: 0 auto; padding: 0 1rem; }
.hero__badge {
  display: inline-block; font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cyan); background: var(--cyan-bg);
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  border: 1px solid var(--cyan-border); margin-bottom: 1rem;
}
.hero__title { font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 900; line-height: 1.1; margin-bottom: 1.5rem; }
.hero__desc { font-size: 1.125rem; color: var(--text-secondary); max-width: 42rem; margin: 0 auto 2rem; }
.hero__btns { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 600;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}
.btn--primary { background: var(--cyan); color: #000; }
.btn--primary:hover { background: var(--cyan-light); }
.btn--secondary {
  background: rgba(255,255,255,0.05); color: var(--text);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn--secondary:hover { background: rgba(255,255,255,0.1); }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--download {
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  border: 1px solid var(--border-hover); color: var(--text-secondary); background: transparent;
  transition: all var(--transition);
}
.btn--download:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ── Style Filter ───────────────────────────────────────── */
.style-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.style-btn {
  padding: 0.4375rem 1rem; border-radius: 9999px;
  font-size: 0.875rem; color: var(--text-secondary);
  border: 1px solid var(--border); background: transparent;
  transition: all var(--transition);
}
.style-btn:hover { color: var(--text); border-color: var(--border-hover); }
.style-btn.active { background: var(--cyan); color: #000; border-color: var(--cyan); font-weight: 600; }

/* ── Track Grid ─────────────────────────────────────────── */
.tracks-section { padding: 3rem 0; }
.track-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 640px)  { .track-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .track-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .track-grid { grid-template-columns: repeat(5, 1fr); } }

/* ── Track Card ─────────────────────────────────────────── */
.track-card {
  display: block; position: relative;
  aspect-ratio: 9 / 16; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}
.track-card:hover { transform: scale(1.02); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6); border-color: var(--border-hover); }
.track-card__thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.5s ease;
}
.track-card:hover .track-card__thumb { transform: scale(1.05); }
.track-card__gradient { position: absolute; inset: 0; }
.track-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}
.track-card__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.track-card:hover .track-card__play { opacity: 1; }
.track-card__play-btn {
  width: 3.5rem; height: 3.5rem;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(4px);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.3); transition: background var(--transition);
  color: white; font-size: 1rem;
}
.track-card__play-btn:hover { background: rgba(255,255,255,0.35); }
.track-card__info { position: absolute; bottom: 0; left: 0; right: 0; padding: 0.75rem; }
.track-card__style { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.6); margin-bottom: 0.25rem; }
.track-card__title { font-size: 0.8125rem; font-weight: 600; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.track-card__mood { font-size: 0.6875rem; color: rgba(255,255,255,0.5); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Skeleton ───────────────────────────────────────────── */
.skeleton { background: var(--bg-card); border-radius: var(--radius-lg); aspect-ratio: 9 / 16; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.page-btn {
  min-width: 2.25rem; height: 2.25rem; padding: 0 0.5rem;
  border-radius: var(--radius-sm); font-size: 0.875rem;
  color: var(--text-secondary); border: 1px solid var(--border); background: transparent;
  transition: all var(--transition); display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not([disabled]) { color: var(--text); border-color: var(--border-hover); background: rgba(255,255,255,0.05); }
.page-btn.active { background: var(--cyan); color: #000; border-color: var(--cyan); font-weight: 600; }
.page-btn[disabled] { opacity: 0.3; cursor: not-allowed; }
.page-ellipsis { color: var(--text-muted); padding: 0 0.25rem; }

/* ── Track Detail ───────────────────────────────────────── */
.track-detail { padding: 2rem 0; }
.track-detail__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .track-detail__grid { grid-template-columns: 1fr 1fr; } }
.track-detail__video-wrap { max-width: 22rem; margin: 0 auto; aspect-ratio: 9 / 16; width: 100%; }
.track-detail__meta { display: flex; flex-direction: column; gap: 1.5rem; }
.track-detail__title { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.track-detail__desc { color: var(--text-secondary); line-height: 1.7; }
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 1.5rem; transition: color var(--transition); }
.back-link:hover { color: var(--text); }
.download-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── Mood Tags ──────────────────────────────────────────── */
.mood-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.mood-tag { font-size: 0.75rem; padding: 0.25rem 0.625rem; border-radius: 9999px; border: 1px solid var(--border-hover); color: var(--text-secondary); background: rgba(255,255,255,0.03); }
.mood-tag--cyan { color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-bg); }

/* ── Video Player ───────────────────────────────────────── */
.video-player { position: relative; width: 100%; height: 100%; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-card); }
.video-player__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-player__video { width: 100%; height: 100%; object-fit: cover; display: none; }
.video-player__video.started { display: block; }
.video-player__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--transition);
}
.video-player:hover .video-player__overlay { opacity: 1; }
.video-player__controls { display: flex; align-items: center; gap: 0.75rem; }
.video-player__btn {
  width: 2.5rem; height: 2.5rem;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(4px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.8rem; transition: background var(--transition);
}
.video-player__btn:hover { background: rgba(255,255,255,0.35); }
.video-player__center-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-player__center-btn {
  width: 4rem; height: 4rem;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(4px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.3); color: white; font-size: 1.25rem;
  transition: background var(--transition);
}
.video-player__center-btn:hover { background: rgba(255,255,255,0.35); }

/* ── Audio Player ───────────────────────────────────────── */
.audio-player { border-radius: var(--radius-lg); padding: 1rem; display: flex; align-items: center; gap: 1rem; }
.audio-player__btn {
  width: 2.5rem; height: 2.5rem; background: var(--cyan); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #000; font-size: 0.75rem; transition: background var(--transition);
}
.audio-player__btn:hover { background: var(--cyan-light); }
.audio-player__body { flex: 1; min-width: 0; }
.audio-player__title-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.audio-player__title { font-size: 0.875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-player__progress { position: relative; height: 6px; background: #374151; border-radius: 9999px; cursor: pointer; }
.audio-player__progress-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--cyan); border-radius: 9999px; transition: width 0.1s linear; pointer-events: none; width: 0%; }
.audio-player__times { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Related Tracks ─────────────────────────────────────── */
.related-section { margin-top: 4rem; }
.related-section h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.5rem; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 640px)  { .related-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .related-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── SEO Content ────────────────────────────────────────── */
.seo-content { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.75; }
.seo-content h2 { color: var(--text); font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.seo-content p { margin-bottom: 1rem; }

/* ── Admin ──────────────────────────────────────────────── */
.admin-layout { padding: 2rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.admin-layout > h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-card__label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-card__value { font-size: 1.5rem; font-weight: 700; }
.stat-card__value--warn { color: var(--red); }
.stat-card__sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
@media (min-width: 1024px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.admin-section > h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Form ───────────────────────────────────────────────── */
.form-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-label { font-size: 0.875rem; color: var(--text-secondary); }
.form-input, .form-select {
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  color: var(--text); font-size: 0.875rem; width: 100%;
  transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--border-focus); }
.form-input::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-input); }
.platform-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.platform-btn {
  padding: 0.25rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.875rem;
  border: 1px solid #4b5563; color: var(--text-secondary); background: transparent;
  transition: all var(--transition); cursor: pointer;
}
.platform-btn.active { background: var(--cyan); border-color: var(--cyan); color: #000; font-weight: 600; }

/* ── Jobs Table ─────────────────────────────────────────── */
.jobs-wrap { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; }
.jobs-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.jobs-table th { text-align: left; padding: 0.75rem 1rem; color: var(--text-muted); border-bottom: 1px solid #1f2937; font-weight: 500; }
.jobs-table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(31,41,55,0.5); }
.jobs-table tr:last-child td { border-bottom: none; }
.jobs-table tr:hover td { background: rgba(31,41,55,0.3); }
.status--completed { color: var(--green); }
.status--failed { color: var(--red); }
.status--running { color: var(--yellow); }
.status--pending { color: var(--text-muted); }
.status--retrying { color: var(--orange); }
.jobs-empty { text-align: center; color: var(--text-muted); padding: 2rem; }
.font-mono { font-family: 'Courier New', monospace; }

/* ── Toast ──────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.75rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.5rem; min-width: 16rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3); animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast--success { background: #064e3b; color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.toast--error   { background: #450a0a; color: var(--red);   border: 1px solid rgba(248,113,113,0.2); }

/* ── Loading ────────────────────────────────────────────── */
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 6rem; }
.spinner { width: 2rem; height: 2rem; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error / Empty ──────────────────────────────────────── */
.error-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.error-state h2 { font-size: 1.25rem; color: var(--text); margin-bottom: 0.5rem; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 2rem 1.5rem; text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 3rem; }

/* ── Logout nav button ──────────────────────────────────── */
.nav__link--logout {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.nav__link--logout:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.05); color: var(--text); }

/* ── Login page ─────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 56px - 80px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%; max-width: 400px;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-title { font-size: 1.5rem; font-weight: 700; }
.login-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--red);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.login-form { display: flex; flex-direction: column; gap: 1rem; }
