/* =========================================
   FILA SPOTIFY — Design System
   ========================================= */

:root {
  --c-bg:         #060606;
  --c-surf:       #111111;
  --c-surf2:      #1a1a1a;
  --c-border:     #282828;
  --c-green:      #1db954;
  --c-green-dim:  rgba(29,185,84,.15);
  --c-green-glow: rgba(29,185,84,.35);
  --c-green-h:    #1ed760;
  --c-purple:     #8b5cf6;
  --c-purple-dim: rgba(139,92,246,.15);
  --c-text:       #ffffff;
  --c-text2:      #a7a7a7;
  --c-text3:      #535353;
  --c-danger:     #e84040;
  --c-warn:       #f59e0b;
  --bnav-h:       4.25rem;
  --safe-b:       env(safe-area-inset-bottom, 0px);
  --r:            .875rem;
  --r-sm:         .5rem;
  --shadow:       0 4px 24px rgba(0,0,0,.6);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: .9375rem;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { border: none; background: none; color: inherit; cursor: pointer; font: inherit; }
img { display: block; }
input, button { outline-offset: 2px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 99px; }

/* =========================================
   FUNDO — blobs animados
   ========================================= */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 22s ease-in-out infinite;
  will-change: transform;
}
.blob-g {
  width: 550px; height: 550px;
  background: radial-gradient(circle, #1db954 0%, #064d22 100%);
  top: -160px; left: -120px;
  animation-delay: 0s;
}
.blob-p {
  width: 650px; height: 650px;
  background: radial-gradient(circle, #7c3aed 0%, #1e1b4b 100%);
  bottom: -220px; right: -160px;
  animation-delay: -9s;
}
@keyframes blob-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(28px,-18px) scale(1.04); }
  66%      { transform: translate(-18px,28px) scale(.97); }
}

/* =========================================
   BOTTOM NAVBAR
   ========================================= */
.bnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--bnav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: stretch;
  z-index: 100;
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  color: var(--c-text3);
  transition: color .2s;
  padding: .5rem .25rem;
  position: relative;
}
.bnav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--c-green);
  border-radius: 0 0 4px 4px;
  opacity: 0;
  transition: opacity .2s;
}
.bnav-item.is-active { color: var(--c-green); }
.bnav-item.is-active::before { opacity: 1; }
.bnav-item:active { opacity: .7; }
.bnav-ico { width: 1.375rem; height: 1.375rem; flex-shrink: 0; }
.bnav-lbl { font-size: .6875rem; font-weight: 500; letter-spacing: .02em; }

/* =========================================
   PAGE WRAPPER (espaço para navbar)
   ========================================= */
.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-bottom: calc(var(--bnav-h) + var(--safe-b) + 1rem);
}
.page-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* =========================================
   LANDING PAGE (index)
   ========================================= */
.lp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1.5rem calc(var(--bnav-h) + var(--safe-b) + 2rem);
  text-align: center;
  gap: 0;
}
.lp-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 2.5rem;
}
.lp-dot {
  width: .75rem; height: .75rem;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 14px var(--c-green-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 8px var(--c-green-glow); }
  50%      { box-shadow: 0 0 22px var(--c-green-glow), 0 0 40px rgba(29,185,84,.2); }
}
.lp-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; }
.lp-sub   { font-size: .875rem; color: var(--c-text2); margin-top: .3rem; }

/* Now playing card */
.np-card {
  width: 100%; max-width: 340px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem;
  margin-bottom: 1.5rem;
  min-height: 72px;
}
.np-art {
  width: 52px; height: 52px;
  border-radius: .5rem;
  background: var(--c-surf2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.np-art img { width: 100%; height: 100%; object-fit: cover; }
.np-art-ico { color: var(--c-text3); width: 24px; height: 24px; }
.np-info { flex: 1; min-width: 0; text-align: left; }
.np-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--c-green); font-weight: 600; margin-bottom: .15rem; }
.np-track { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: .775rem; color: var(--c-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }
.np-bar { margin-top: .5rem; height: 2px; background: var(--c-border); border-radius: 99px; overflow: hidden; }
.np-bar-fill { height: 100%; background: var(--c-green); border-radius: 99px; transition: width .5s linear; }

/* Queue badge */
.lp-queue-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  padding: .35rem .875rem;
  font-size: .8125rem;
  color: var(--c-text2);
  margin-bottom: 1.75rem;
}
.lp-queue-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-green); }

/* CTA button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: var(--c-green);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
  padding: 1rem 2rem;
  border-radius: 99px;
  width: 100%; max-width: 320px;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 0 30px rgba(29,185,84,.3);
}
.btn-cta:hover  { background: var(--c-green-h); transform: translateY(-2px); box-shadow: 0 4px 40px rgba(29,185,84,.45); }
.btn-cta:active { transform: translateY(0); }
.btn-cta svg    { width: 20px; height: 20px; }

/* =========================================
   FILA PAGE
   ========================================= */
.fila-header {
  position: sticky;
  top: 0; z-index: 50;
  background: rgba(6,6,6,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.fila-header-title { font-weight: 700; font-size: 1.125rem; }
.fila-header-count { font-size: .8125rem; color: var(--c-text2); }

/* User action banner */
.action-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  margin: .75rem 1rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
}
.action-banner-added  { background: var(--c-green-dim);  border: 1px solid rgba(29,185,84,.3);  color: var(--c-green); }
.action-banner-voted  { background: var(--c-purple-dim); border: 1px solid rgba(139,92,246,.3); color: var(--c-purple); }
.action-banner svg    { width: 18px; height: 18px; flex-shrink: 0; }

/* Add music FAB */
.btn-add-fab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--c-green);
  color: #000;
  font-weight: 700;
  font-size: .875rem;
  padding: .6rem 1.1rem;
  border-radius: 99px;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.btn-add-fab:hover  { background: var(--c-green-h); }
.btn-add-fab:active { transform: scale(.96); }
.btn-add-fab svg    { width: 16px; height: 16px; }
.btn-add-fab:disabled,
.btn-add-fab.disabled { background: var(--c-surf2); color: var(--c-text3); cursor: not-allowed; }

/* Queue item */
.qi-list { list-style: none; padding: 0 1rem; display: flex; flex-direction: column; gap: .5rem; }

.qi {
  display: flex;
  align-items: center;
  gap: .875rem;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: .75rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  position: relative;
  overflow: hidden;
}
.qi::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, var(--c-green-dim) 0%, transparent 100%);
  transition: opacity .25s;
  pointer-events: none;
}
.qi:hover::before { opacity: 1; }
.qi:active { transform: scale(.985); }

.qi.qi-is-added  { border-color: rgba(29,185,84,.5);  background: rgba(29,185,84,.06); }
.qi.qi-is-voted  { border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.06); }
.qi.qi-is-sent   { opacity: .65; }
.qi.qi-no-action { cursor: default; }
.qi.qi-no-action::before { display: none; }

.qi-rank {
  width: 1.75rem;
  text-align: center;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--c-text3);
  flex-shrink: 0;
}
.qi-rank.top1 { color: var(--c-green); }
.qi-rank.top2 { color: #d4af37; }
.qi-rank.top3 { color: #cd7f32; }

.qi-art {
  width: 48px; height: 48px;
  border-radius: .375rem;
  background: var(--c-surf2);
  flex-shrink: 0;
  overflow: hidden;
}
.qi-art img { width: 100%; height: 100%; object-fit: cover; }

.qi-info { flex: 1; min-width: 0; }
.qi-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-sub  { font-size: .75rem; color: var(--c-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }

.qi-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0; }
.qi-votes {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .875rem;
  font-weight: 700;
  color: var(--c-text2);
}
.qi-votes svg { width: 15px; height: 15px; }
.qi.qi-is-voted .qi-votes { color: var(--c-purple); }
.qi.qi-is-added .qi-votes { color: var(--c-text3); }

.qi-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .45rem;
  border-radius: 99px;
}
.qi-badge-added { background: var(--c-green-dim);  color: var(--c-green);  border: 1px solid rgba(29,185,84,.3); }
.qi-badge-voted { background: var(--c-purple-dim); color: var(--c-purple); border: 1px solid rgba(139,92,246,.3); }
.qi-badge-sent  { background: rgba(245,158,11,.12); color: var(--c-warn);  border: 1px solid rgba(245,158,11,.3); }

/* Vote pulse animation */
@keyframes vote-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.qi-vote-anim { animation: vote-pulse .3s ease; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--c-text3);
}
.empty-state svg  { width: 48px; height: 48px; margin: 0 auto 1rem; }
.empty-state h2   { font-size: 1.125rem; color: var(--c-text2); margin-bottom: .5rem; }
.empty-state p    { font-size: .875rem; }

/* =========================================
   PERFIL / LOGIN
   ========================================= */
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  padding: 1.5rem 1rem 1rem;
}

/* Auth forms */
.auth-card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1.25rem;
  margin: 0 1rem .75rem;
}
.auth-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .125rem;
}
.auth-card .auth-hint {
  font-size: .8125rem;
  color: var(--c-text2);
  margin-bottom: 1rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  margin-bottom: .875rem;
}
.form-input {
  width: 100%;
  background: var(--c-surf2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font: inherit;
  font-size: .9375rem;
  padding: .75rem 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { outline: none; border-color: var(--c-green); box-shadow: 0 0 0 3px var(--c-green-dim); }
.form-input::placeholder { color: var(--c-text3); }

.btn-primary {
  width: 100%;
  background: var(--c-green);
  color: #000;
  font-weight: 700;
  font-size: .9375rem;
  padding: .8rem;
  border-radius: 99px;
  transition: background .2s, transform .15s;
}
.btn-primary:hover  { background: var(--c-green-h); }
.btn-primary:active { transform: scale(.98); }

.btn-ghost {
  width: 100%;
  background: transparent;
  color: var(--c-text);
  font-weight: 600;
  font-size: .9375rem;
  padding: .8rem;
  border-radius: 99px;
  border: 1px solid var(--c-border);
  transition: background .2s, border-color .2s;
}
.btn-ghost:hover  { background: var(--c-surf2); border-color: var(--c-text3); }
.btn-ghost:active { transform: scale(.98); }

.form-error {
  font-size: .8125rem;
  color: var(--c-danger);
  margin-top: .5rem;
  display: none;
}
.form-error.visible { display: block; }

/* Profile card */
.profile-card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin: 0 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-green) 0%, #0d6e34 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}
.profile-name   { font-weight: 700; font-size: 1.125rem; }
.profile-role   { font-size: .8125rem; color: var(--c-text2); margin-top: .15rem; }
.profile-admin  { color: var(--c-green); font-weight: 600; }

.info-card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin: 0 1rem .75rem;
}
.info-card h3     { font-size: .875rem; font-weight: 700; color: var(--c-text2); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.info-row         { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .375rem 0; }
.info-row + .info-row { border-top: 1px solid var(--c-border); }
.info-row-label   { font-size: .875rem; color: var(--c-text2); }
.info-row-val     { font-size: .875rem; font-weight: 600; }
.badge-on         { color: var(--c-green); }
.badge-off        { color: var(--c-text3); }

.btn-danger {
  width: 100%;
  background: transparent;
  color: var(--c-danger);
  font-weight: 600;
  font-size: .9375rem;
  padding: .8rem;
  border-radius: 99px;
  border: 1px solid rgba(232,64,64,.35);
  transition: background .2s;
}
.btn-danger:hover { background: rgba(232,64,64,.1); }

/* =========================================
   SELECIONAR PAGE
   ========================================= */
.sel-header {
  position: sticky;
  top: 0; z-index: 50;
  background: rgba(6,6,6,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.sel-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--c-surf2);
  color: var(--c-text);
  flex-shrink: 0;
  transition: background .2s;
}
.btn-back:hover { background: var(--c-surf); }
.btn-back svg   { width: 18px; height: 18px; }
.sel-title { font-weight: 700; font-size: 1.125rem; flex: 1; }

.search-wrap {
  position: relative;
}
.search-ico {
  position: absolute;
  left: .875rem; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text3);
  width: 18px; height: 18px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--c-surf2);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  color: var(--c-text);
  font: inherit;
  font-size: .9375rem;
  padding: .7rem 1rem .7rem 2.75rem;
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus { outline: none; border-color: var(--c-green); box-shadow: 0 0 0 3px var(--c-green-dim); }
.search-input::placeholder { color: var(--c-text3); }

/* Search results */
.sel-results { list-style: none; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.sel-status  { text-align: center; padding: 1.5rem 1rem; font-size: .875rem; color: var(--c-text3); }

.sr {
  display: flex;
  align-items: center;
  gap: .875rem;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: .75rem;
  transition: background .2s;
}
.sr:hover { background: var(--c-surf2); }
.sr-art {
  width: 44px; height: 44px;
  border-radius: .375rem;
  background: var(--c-surf2);
  flex-shrink: 0;
  overflow: hidden;
}
.sr-art img { width: 100%; height: 100%; object-fit: cover; }
.sr-info { flex: 1; min-width: 0; }
.sr-name { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub  { font-size: .75rem; color: var(--c-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }

.btn-add-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .9rem;
  border-radius: 99px;
  background: transparent;
  border: 1px solid var(--c-green);
  color: var(--c-green);
  font-weight: 700;
  font-size: .8125rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.btn-add-track:hover    { background: var(--c-green); color: #000; }
.btn-add-track:disabled { border-color: var(--c-text3); color: var(--c-text3); cursor: not-allowed; background: transparent; }
.btn-add-track svg      { width: 13px; height: 13px; }
.btn-add-track.adding   { opacity: .6; cursor: wait; }
.btn-add-track.added    { border-color: var(--c-text3); color: var(--c-text3); pointer-events: none; }

/* =========================================
   ADMIN strip (dentro de perfil)
   ========================================= */
.admin-card {
  background: rgba(29,185,84,.05);
  border: 1px solid rgba(29,185,84,.2);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin: 0 1rem .75rem;
}
.admin-card h3   { font-size: .875rem; color: var(--c-green); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem; }
.admin-card p    { font-size: .8125rem; color: var(--c-text2); margin-bottom: .875rem; line-height: 1.5; }
.admin-card .row { display: flex; flex-wrap: wrap; gap: .5rem; }

.btn-spotify {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.1rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: .875rem;
  transition: background .2s, transform .15s;
}
.btn-spotify-on  { background: var(--c-green); color: #000; }
.btn-spotify-on:hover { background: var(--c-green-h); }
.btn-spotify-off { background: var(--c-surf2); color: var(--c-danger); border: 1px solid rgba(232,64,64,.3); }
.btn-spotify-off:hover { background: rgba(232,64,64,.1); }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--bnav-h) + var(--safe-b) + .75rem);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--c-surf2);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  padding: .65rem 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--c-text);
  box-shadow: var(--shadow);
  z-index: 200;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.t-ok  { border-color: rgba(29,185,84,.4);  color: var(--c-green); }
.toast.t-err { border-color: rgba(232,64,64,.4);  color: var(--c-danger); }

/* Loading spinner */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Misc */
.divider { height: 1px; background: var(--c-border); margin: .75rem 1rem; }
.text-dim { color: var(--c-text3); }
.text-sm  { font-size: .8125rem; }
.mt-1     { margin-top: .5rem; }
.mt-2     { margin-top: 1rem; }
