/* TrimPlayer web player — "Aurora" theme.
   Premium dark, glassmorphic, with a signature violet→blue gradient accent. */

:root {
  --bg: #0b0d12;
  --bg-2: #0e1118;
  --panel: rgba(23, 27, 36, 0.72);
  --panel-solid: #171b24;
  --panel-2: rgba(255, 255, 255, 0.04);
  --hover: rgba(255, 255, 255, 0.06);
  --text: #eef1f6;
  --muted: #97a0b0;
  --faint: #5c6473;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --accent: #7c5cff;
  --accent-2: #4f8cff;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #4f8cff 100%);
  --heart: #ff5d8f;
  --ok: #38e0a0;

  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

.view { min-height: 100vh; height: 100vh; }
.muted { color: var(--muted); }
.error { color: #ff7a7a; font-size: 14px; margin: 4px 2px 0; }
[hidden] { display: none !important; }

::selection { background: rgba(124, 92, 255, 0.35); }

/* ---------- Ambient aurora background ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(79, 140, 255, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 0% 110%, rgba(124, 92, 255, 0.12), transparent 60%),
    var(--bg);
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}
.aurora-blob.a1 { width: 460px; height: 460px; left: -120px; top: -80px;
  background: radial-gradient(circle, #7c5cff, transparent 70%); animation: float1 22s ease-in-out infinite; }
.aurora-blob.a2 { width: 520px; height: 520px; right: -140px; top: 20%;
  background: radial-gradient(circle, #4f8cff, transparent 70%); animation: float2 26s ease-in-out infinite; }
.aurora-blob.a3 { width: 420px; height: 420px; left: 30%; bottom: -160px;
  background: radial-gradient(circle, #ff5d8f, transparent 70%); opacity: 0.28; animation: float1 30s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px, 40px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px, 30px); } }

/* ---------- Auth ---------- */
#auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .5s ease both;
}
.auth-card {
  background: var(--panel);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px 30px;
  width: min(400px, 94vw);
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.brandmark {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: grid; place-items: center;
  background: var(--accent-grad);
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.45);
  font-size: 34px;
}
.brandmark-glyph { filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.auth-h1 { margin: 0 0 8px; font-size: 27px; font-weight: 800; letter-spacing: -0.02em; }
.auth-sub { font-size: 14px; line-height: 1.55; margin: 0 6px 24px; }

.auth-tabs {
  position: relative;
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  color: var(--muted);
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  z-index: 1;
  transition: color .25s;
}
.auth-tab.active { color: #fff; }
.auth-tab-ind {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--accent-grad);
  border-radius: 9px;
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.4);
  transition: transform .3s cubic-bezier(.3,.9,.3,1);
}
.auth-tabs.signup .auth-tab-ind { transform: translateX(100%); }

#auth-form { display: flex; flex-direction: column; gap: 12px; }
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
  background: rgba(124, 92, 255, 0.06);
}
.field-icon { font-size: 14px; opacity: .7; }
.field input {
  flex: 1;
  padding: 13px 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.field input::placeholder { color: var(--faint); }

.btn-primary {
  margin-top: 4px;
  padding: 13px;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.38);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 30px rgba(124, 92, 255, 0.5); }
.btn-primary:active { transform: translateY(0); }
.auth-foot { font-size: 12.5px; margin: 18px 0 0; }

/* Social sign-in */
#social-auth { margin-bottom: 6px; }
.google-btn-host { display: flex; justify-content: center; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 2px; color: var(--faint); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ---------- App shell ---------- */
#app-view { display: flex; flex-direction: column; animation: fadeIn .4s ease both; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.6);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.brand-glyph {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-grad); font-size: 15px;
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.4);
}
.spacer { flex: 1; }

.sync-pill {
  font-size: 12px; color: var(--ok);
  background: rgba(56, 224, 160, 0.1);
  border: 1px solid rgba(56, 224, 160, 0.25);
  padding: 4px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.sync-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.sync-pill:empty { display: none; }
.user-chip { font-size: 13px; }

.ghost {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s, transform .12s;
}
.ghost:hover { background: var(--hover); color: var(--text); transform: translateY(-1px); }
.ghost-heart { color: var(--heart); border-color: rgba(255, 93, 143, 0.3); }
.ghost-heart:hover { background: rgba(255, 93, 143, 0.12); color: var(--heart); }

.columns {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  overflow: hidden;
  padding-bottom: 108px; /* room for player bar */
}
.sidebar { padding: 22px 18px; border-right: 1px solid var(--border); overflow-y: auto; }
.content { padding: 22px 28px; overflow-y: auto; }
.section-h {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint); margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}

.list { list-style: none; margin: 0; padding: 0; }

/* Subscriptions */
.sidebar .list li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 12px;
  cursor: default; transition: background .18s;
  animation: rise .4s ease both;
}
.sidebar .list li:hover { background: var(--hover); }
.avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
  box-shadow: var(--shadow-md);
}
.sub-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Queue */
.queue li {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.2,.8,.2,1), border-color .2s, background .2s, box-shadow .2s;
  animation: rise .45s ease both;
}
.queue li:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.queue li.playing { border-color: rgba(124, 92, 255, 0.55); background: rgba(124, 92, 255, 0.08); }
.cover {
  width: 56px; height: 56px; flex: 0 0 56px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.18), transparent 50%); }
.queue .q-main { flex: 1; min-width: 0; }
.queue .q-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .q-sub { font-size: 13px; margin-top: 2px; }
.queue .q-actions { display: flex; gap: 6px; }
.q-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 9px;
  width: 34px; height: 34px;
  cursor: pointer; font-size: 13px;
  transition: background .18s, color .18s, border-color .18s;
}
.q-icon:hover { background: rgba(255, 93, 143, 0.14); color: var(--heart); border-color: rgba(255,93,143,.3); }
.q-progress {
  height: 4px; background: rgba(255, 255, 255, 0.08);
  border-radius: 999px; margin-top: 9px; overflow: hidden;
}
.q-progress > i { display: block; height: 100%; background: var(--accent-grad); border-radius: 999px; }

.badge {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px; font-size: 11px; color: var(--muted);
  letter-spacing: 0;
}
.badge:empty { display: none; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; animation: fadeIn .5s ease both; }
.empty-glyph {
  width: 80px; height: 80px; margin: 0 auto 18px;
  border-radius: 24px; display: grid; place-items: center;
  font-size: 36px; background: var(--panel-2); border: 1px solid var(--border);
  opacity: .8;
}
.empty-title { font-size: 17px; font-weight: 700; margin: 0 0 6px; }

/* ---------- Now-playing bar ---------- */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(280px, 2fr) minmax(120px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: rgba(14, 17, 24, 0.82);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.4);
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both;
  z-index: 30;
}
.np-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.np-art {
  width: 50px; height: 50px; flex: 0 0 50px;
  border-radius: 12px; position: relative; overflow: hidden;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 16px;
  box-shadow: var(--shadow-md);
}
.np-meta { min-width: 0; }
.np-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-podcast { font-size: 12.5px; margin-top: 2px; }

/* Equalizer (shown only while playing) */
.np-eq { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding: 11px; background: rgba(0,0,0,.42); }
.player-bar.playing .np-eq { display: flex; }
.np-eq i { width: 4px; height: 30%; background: #fff; border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.np-eq i:nth-child(2) { animation-delay: .2s; }
.np-eq i:nth-child(3) { animation-delay: .4s; }
.np-eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%,100% { height: 22%; } 50% { height: 88%; } }

.np-controls { display: flex; align-items: center; gap: 14px; }
.np-btn {
  flex: 0 0 auto;
  background: var(--accent-grad);
  color: #fff; border: none;
  border-radius: 50%;
  width: 46px; height: 46px; font-size: 17px;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.45);
  transition: transform .12s, filter .2s;
}
.np-btn:hover { transform: scale(1.06); filter: brightness(1.08); }
.np-btn:active { transform: scale(.97); }
.np-bar-row { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }

.np-seek {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.np-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.45);
  transition: transform .12s;
}
.np-seek::-webkit-slider-thumb:hover { transform: scale(1.18); }
.np-seek::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(124,92,255,.45); }
.np-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 96px; text-align: right; }

.np-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.np-skip {
  background: rgba(56, 224, 160, 0.16);
  color: var(--ok);
  border: 1px solid rgba(56, 224, 160, 0.3);
  font-weight: 700; font-size: 11.5px;
  padding: 5px 11px; border-radius: 999px;
  animation: popIn .25s ease both;
}
.np-toggle {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 13px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.np-toggle.active {
  color: var(--ok); border-color: rgba(56, 224, 160, 0.4);
  background: rgba(56, 224, 160, 0.12);
  box-shadow: 0 0 16px rgba(56, 224, 160, 0.2);
}

/* ---------- Support overlay ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(5, 6, 10, 0.66);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
  animation: fadeIn .25s ease both;
}
.support-card {
  position: relative;
  background: var(--panel);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 32px 30px;
  width: min(450px, 94vw);
  line-height: 1.6;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: rise .4s cubic-bezier(.2,.8,.2,1) both;
}
.support-card p { margin: 14px 0; color: var(--muted); font-size: 14.5px; }
.support-card strong { color: var(--text); }
.support-heart {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 20px; display: grid; place-items: center;
  font-size: 30px; color: #fff;
  background: linear-gradient(135deg, #ff5d8f, #ff8f5d);
  box-shadow: 0 12px 30px rgba(255, 93, 143, 0.45);
  animation: heartbeat 1.8s ease-in-out infinite;
}
.support-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.support-badge {
  margin-top: 18px; padding: 12px 14px;
  background: rgba(255, 93, 143, 0.1);
  border: 1px solid rgba(255, 93, 143, 0.22);
  border-radius: 12px; font-size: 13px; color: var(--text);
}
.support-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); width: 32px; height: 32px; border-radius: 9px;
  font-size: 14px; cursor: pointer; transition: background .2s, color .2s;
}
.support-close:hover { background: var(--hover); color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 128px; left: 50%; transform: translateX(-50%);
  background: rgba(23, 27, 36, 0.95);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  padding: 12px 18px; border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1) both;
  z-index: 60; max-width: 90vw;
}

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.12); } 28% { transform: scale(1); } 42% { transform: scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; padding-bottom: 150px; }
  .sidebar { display: none; }
  .player-bar { grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; }
  .np-right { justify-content: flex-start; }
  .np-time { min-width: 0; }
  .user-chip { display: none; }
}
