/* ===== 1MZ Play — dashboard dourado moderno (Montserrat · #EBB000 · #1B2022) ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden ganha SEMPRE — mesmo quando a classe define display:flex/grid. */
[hidden] { display: none !important; }

:root {
  --gold: #ebb000;
  --gold-deep: #d5a000;
  --gold-soft: rgba(235, 176, 0, 0.14);

  /* tema claro */
  --bg: #eef0f3;
  --panel: #ffffff;
  --card: #f4f5f7;
  --text: #1b2022;
  --muted: #48565b;
  --faint: #9aa6ab;
  --line: #e6e8ec;
  --shadow: 0 12px 34px rgba(27, 32, 34, 0.09);
}
[data-theme="dark"] {
  --bg: #14181a;
  --panel: #1b2022;
  --card: #232a2d;
  --text: #f4f4f2;
  --muted: #9fb0b6;
  --faint: #5d6b70;
  --line: #2a3235;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

html, body { height: 100%; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button { font-family: inherit; }
svg { display: block; }

/* ===== Login ===== */
.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 44px 36px;
  text-align: center;
}
.login-title { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.login-title span { color: var(--gold); }
.login-sub { color: var(--muted); font-weight: 400; font-size: 14px; margin: 6px 0 26px; }
#login-form { display: grid; gap: 12px; }
#login-form input {
  padding: 15px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: 500 14px 'Montserrat', sans-serif;
  outline: none;
  transition: border-color .2s;
}
#login-form input:focus { border-color: var(--gold); }
.btn-primary {
  padding: 15px;
  border: 0; border-radius: 14px;
  background: var(--gold);
  color: #1b2022; font-weight: 700; font-size: 14.5px;
  cursor: pointer;
  transition: transform .12s ease, background .2s, box-shadow .2s;
  box-shadow: 0 8px 22px rgba(235, 176, 0, 0.35);
}
.btn-primary:hover { background: var(--gold-deep); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: .6; }
.login-error { color: #e05252; font-size: 13px; }
.login-hint { color: var(--faint); font-size: 12px; font-weight: 400; margin-top: 20px; }

.logo-badge {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--gold);
  color: #1b2022;
  box-shadow: 0 8px 20px rgba(235, 176, 0, 0.4);
}
.logo-badge svg { width: 24px; height: 24px; }
.logo-badge.big { width: 74px; height: 74px; border-radius: 24px; margin: 0 auto 16px; }
.logo-badge.big svg { width: 38px; height: 38px; }

/* ===== Estrutura ===== */
.app-shell {
  display: grid;
  grid-template-columns: 88px 1fr 330px;
  min-height: 100dvh;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--panel);
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0;
  gap: 26px;
  position: sticky; top: 0; height: 100dvh;
  border-right: 1px solid var(--line);
}
.side-nav { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.side-btn {
  width: 48px; height: 48px;
  border: 0; border-radius: 15px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .18s ease;
}
.side-btn svg { width: 21px; height: 21px; }
.side-btn:hover { color: var(--text); background: var(--card); }
.side-btn.active { background: var(--gold); color: #1b2022; box-shadow: 0 8px 18px rgba(235, 176, 0, 0.4); }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

/* ---- Topbar ---- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel);
  padding: 14px clamp(18px, 3vw, 36px);
  position: sticky; top: 0; z-index: 15;
  border-bottom: 1px solid var(--line);
}
.search-wrap {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--card);
  color: var(--faint);
  transition: box-shadow .2s;
}
.search-wrap:focus-within { box-shadow: 0 0 0 2px var(--gold); }
.search-wrap input {
  flex: 1; border: 0; background: none; outline: none;
  color: var(--text); font: 500 14px 'Montserrat', sans-serif;
}
.round-btn, .ghost-btn {
  border: 0; border-radius: 50%;
  background: var(--card); color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s ease;
}
.round-btn { width: 42px; height: 42px; }
.round-btn svg, .ghost-btn svg { width: 17px; height: 17px; }
.round-btn:hover, .ghost-btn:hover { color: var(--gold-deep); background: var(--gold-soft); }
.round-btn:active, .ghost-btn:active { transform: scale(0.9); }
.round-btn.on, .ghost-btn.on { background: var(--gold-soft); color: var(--gold-deep); }
.ghost-btn { width: 42px; height: 42px; }
.ghost-btn.big { width: 52px; height: 52px; }
.ghost-btn.big svg { width: 21px; height: 21px; }

.user-chip { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold);
  color: #1b2022; font-weight: 800;
  display: grid; place-items: center;
}
.user-meta { display: grid; line-height: 1.3; }
.user-meta span { font-weight: 700; font-size: 13.5px; }
.user-meta small { color: var(--faint); font-weight: 500; font-size: 11px; }

/* ---- Conteúdo ---- */
.content { padding: 28px clamp(18px, 3vw, 36px) 130px; }
.welcome-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.5px; }
.welcome-sub { color: var(--muted); font-weight: 400; font-size: 14px; margin-top: 4px; }

.hero {
  margin-top: 22px;
  border-radius: 24px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #1b2022 30%, #48565b 130%);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::after {
  content: '';
  position: absolute; right: -60px; top: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 176, 0, 0.5), transparent 65%);
}
.hero-pill {
  display: inline-block;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(235, 176, 0, 0.16);
  color: var(--gold);
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
}
.hero-title { margin-top: 14px; font-size: clamp(20px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.4px; }
.hero-sub { margin-top: 8px; font-weight: 400; font-size: 13.5px; color: rgba(255, 255, 255, 0.75); }

.list-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; }
.list-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.list-count { color: var(--faint); font-size: 13px; font-weight: 500; }
.status { color: var(--muted); padding: 30px 0; text-align: center; font-weight: 400; }

/* ---- Lista de músicas ---- */
.song-list { display: grid; gap: 7px; }
.sec-header { font-weight: 800; font-size: 15px; margin: 18px 4px 6px; }
.row {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel);
  border-radius: 16px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .15s;
}
.row:hover { box-shadow: var(--shadow); }
.row:active { transform: scale(0.995); }
.row.playing { background: var(--gold-soft); box-shadow: inset 0 0 0 1.5px var(--gold); }
.row-num { width: 30px; color: var(--faint); font-weight: 700; font-size: 12.5px; }
.row.playing .row-num { color: var(--gold-deep); }
.row-cover {
  width: 46px; height: 46px; border-radius: 13px; object-fit: cover;
  background: var(--card);
  display: grid; place-items: center;
  color: var(--faint);
  overflow: hidden;
  flex: none;
}
.row-cover svg { width: 20px; height: 20px; }
.row-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main { min-width: 0; flex: 1 1 40%; }
.row-artist {
  flex: 1 1 25%;
  color: var(--muted); font-weight: 500; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-time { color: var(--faint); font-size: 12px; font-weight: 600; width: 44px; text-align: right; }
.row-actions { display: flex; gap: 8px; }
.row-btn {
  width: 36px; height: 36px;
  border: 1.5px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--gold-deep);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s ease;
}
.row-btn svg { width: 14px; height: 14px; }
.row-btn:hover { background: var(--gold); border-color: var(--gold); color: #1b2022; }
.row.playing .row-btn { background: var(--gold); border-color: var(--gold); color: #1b2022; }

.empty { text-align: center; padding: 70px 20px; color: var(--faint); }
.empty-icon { display: grid; place-items: center; margin-bottom: 14px; color: var(--gold); }
.empty h2 { color: var(--text); font-weight: 800; margin-bottom: 8px; }
.empty p { font-weight: 400; line-height: 1.65; font-size: 14px; color: var(--muted); }

/* ---- Painel direito ---- */
.right-panel {
  background: var(--panel);
  padding: 26px 22px;
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  border-left: 1px solid var(--line);
}
.panel-title { font-size: 16.5px; font-weight: 800; letter-spacing: -0.2px; margin-bottom: 14px; }
.panel-title.center { text-align: center; }
.artist-list { display: grid; }
.artist-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--line);
}
.artist-row:last-child { border-bottom: 0; }
.artist-row:hover { background: var(--card); }
.artist-ava {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card);
  object-fit: cover;
  display: grid; place-items: center;
  color: var(--gold-deep); font-weight: 800; font-size: 15px;
  flex: none;
}
.artist-meta { flex: 1; min-width: 0; }
.artist-meta b { font-size: 13px; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-meta small { color: var(--faint); font-weight: 500; font-size: 11px; }
.artist-go {
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--gold);
  color: #1b2022; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .12s;
}
.artist-go:hover { transform: scale(1.08); }

/* ---- Cartão "A tocar agora" ----
   Regras estritas de simetria: flex vertical centrado; TODOS os filhos
   partilham o mesmo eixo central e a mesma largura útil (100%). */
.np-card {
  background: var(--card);
  border-radius: 24px;
  padding: 22px 20px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.np-card > * { width: 100%; }
.np-cover-wrap { position: relative; width: 85%; margin: 4px auto 16px; }
.np-cover-wrap.big { width: min(72vw, 340px); }
.np-glow {
  position: absolute; inset: 6%;
  width: 88%; height: 88%;
  object-fit: cover;
  filter: blur(36px) saturate(1.5);
  opacity: 0.7;
}
.np-glow[src=""], .np-glow:not([src]) { display: none; }
.np-cover-frame {
  position: relative;
  width: 100%; aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(140deg, var(--line), var(--card));
  display: grid; place-items: center;
  color: var(--faint);
}
.np-cover-frame .np-cover-fallback { width: 34%; height: 34%; opacity: .6; }
.np-cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.np-cover[src=""], .np-cover:not([src]) { display: none; }
.m-cover[src=""], .m-cover:not([src]) { visibility: hidden; }
.np-tt { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-ta { color: var(--muted); font-weight: 500; font-size: 12.5px; margin: 3px 0 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Controlos: linha completa, espaçamento matemático — o play fica no centro
   exato porque os 2 botões de cada lado têm larguras iguais. */
.np-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.gold-play {
  width: 56px; height: 56px;
  aspect-ratio: 1 / 1;
  flex: none;
  border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--gold); color: #1b2022;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(235, 176, 0, 0.5);
  transition: transform .12s ease, background .2s;
}
.gold-play svg { width: 22px; height: 22px; }
.gold-play:hover { background: var(--gold-deep); }
.gold-play:active { transform: scale(0.92); }
.gold-play.big { width: 72px; height: 72px; }
.gold-play.big svg { width: 28px; height: 28px; }
.gold-play.small { width: 44px; height: 44px; box-shadow: 0 6px 16px rgba(235, 176, 0, 0.4); }
.gold-play.small svg { width: 17px; height: 17px; }

/* Barras: tempo e volume com larguras IDÊNTICAS; os tempos alinham com as
   extremidades da barra (mesma largura fixa dos dois lados). */
.np-seek { display: flex; align-items: center; gap: 10px; width: 100%; margin: 16px 0 6px; }
.np-seek.wide { width: min(78vw, 380px); }
.t-cur, .t-dur { color: var(--faint); font-size: 11px; font-weight: 600; width: 34px; flex: none; }
.t-cur { text-align: left; }
.t-dur { text-align: right; }
.vol-row {
  display: flex; align-items: center; gap: 10px;
  color: var(--faint);
  width: 100%;
  /* 34px (etiqueta) + 10px (gap) − 26px (ícone+gap) = barra alinhada com a de tempo */
  padding: 0 44px 0 18px;
  margin-top: 8px;
}
.vol-row svg { flex: none; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 5px; border-radius: 3px;
  background: var(--line);
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--gold);
  border: 2.5px solid var(--panel);
  box-shadow: 0 2px 8px rgba(235, 176, 0, 0.6);
}
input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border: 2.5px solid var(--panel); border-radius: 50%;
  background: var(--gold);
}

/* ---- Letras + coração de favorita ---- */
.row-fav { color: var(--gold); display: grid; place-items: center; }
.row-fav svg { width: 15px; height: 15px; }

.lyr-toggle {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 600 12.5px 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all .15s ease;
}
.lyr-toggle:hover { border-color: var(--gold); color: var(--gold-deep); }
.lyr-toggle.on { background: var(--gold); border-color: var(--gold); color: #1b2022; }

.lyrics-box {
  position: relative; /* offsetTop das linhas medido DENTRO da caixa (scroll certo) */
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding: 14px 10px;
  border-radius: 16px;
  background: var(--panel);
  display: grid; gap: 7px;
  text-align: center;
  scroll-behavior: smooth;
}
.lyrics-box.wide { width: min(78vw, 380px); max-height: 26vh; background: var(--card); }
.lyr-line { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.5; transition: color .2s, font-size .2s; }
.lyr-line.cur { color: var(--gold-deep); font-weight: 800; font-size: 14.5px; }

/* ---- Extras do leitor: Letra/Som, tradução ----
   Lado a lado, mesma altura e padding, centrados no mesmo eixo. */
.np-extra {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}
.np-extra .lyr-toggle {
  flex: 1 1 0;
  max-width: 150px;
  justify-content: center;
  padding: 10px 0;
}
.lyr-toggle.sm { margin-top: 0; padding: 8px 14px; font-size: 12px; }
.lyr-actions {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.trans-lang {
  padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text);
  font: 600 12px 'Montserrat', sans-serif;
  outline: none; cursor: pointer;
}
.lyr-sub { color: var(--gold-deep); font-size: 12px; font-weight: 600; margin-top: 1px; }
.lyr-line.cur .lyr-sub, .lyr-line.cur + .lyr-sub { color: var(--gold-deep); }

/* ---- Painel de som (Boost + EQ) ---- */
.sound-modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(27, 32, 34, 0.55);
  padding: 20px;
}
.sound-card {
  width: min(400px, 100%);
  max-height: 86dvh; overflow-y: auto;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.sound-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sound-head h3 { font-size: 18px; font-weight: 800; }
.sound-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
}
.sound-row b { font-size: 14px; font-weight: 800; display: block; }
.sound-row small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.pill-toggle {
  padding: 9px 16px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 700 12px 'Montserrat', sans-serif;
  cursor: pointer; white-space: nowrap;
  transition: all .15s ease;
}
.pill-toggle.on { background: var(--gold); border-color: var(--gold); color: #1b2022; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.pill {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 600 12px 'Montserrat', sans-serif;
  cursor: pointer; white-space: nowrap;
  transition: all .15s ease;
}
.pill:hover { border-color: var(--gold); color: var(--gold-deep); }
.pill.on { background: var(--gold); border-color: var(--gold); color: #1b2022; }
.sound-hint { display: block; color: var(--gold-deep); font-weight: 600; font-size: 11.5px; margin-top: 6px; }
.eq-sliders { display: grid; gap: 10px; margin-top: 12px; }
.eq-band { display: flex; align-items: center; gap: 12px; }
.eq-band label { width: 44px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: right; }
.eq-band output { width: 44px; color: var(--gold-deep); font-size: 11px; font-weight: 700; }
#eq-sec { border-top: 1px solid var(--line); margin-top: 8px; }

/* ---- Barra mobile + overlay ---- */
.mbar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 10px 14px;
}
.m-cover { width: 46px; height: 46px; border-radius: 13px; object-fit: cover; background: var(--card); flex: none; }
.m-info { flex: 1; min-width: 0; line-height: 1.35; }
.m-info div { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-info small { color: var(--faint); font-weight: 500; font-size: 11px; }

.now-playing {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px;
  background: var(--bg);
}
.np-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}
.np-title { font-weight: 800; font-size: 22px; letter-spacing: -0.3px; text-align: center; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 14px; }
.np-artist { color: var(--muted); font-weight: 500; font-size: 14px; }
/* Ecrã cheio: controlos com a MESMA largura da barra de tempo — simetria total. */
.now-playing .np-controls { margin-top: 12px; width: min(78vw, 380px); }
.now-playing .np-extra { width: min(78vw, 380px); }
.np-controls .ghost-btn { flex: none; }

/* ===== Responsivo ===== */
/* Ecrã largo: o Now Playing vive no painel direito — barra mobile desnecessária. */
@media (min-width: 1081px) {
  .mbar, .now-playing { display: none !important; }
}
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 78px 1fr; }
  .right-panel { display: none; }
}
@media (max-width: 700px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 12px; right: 12px; bottom: 86px; top: auto;
    height: auto; z-index: 25;
    flex-direction: row; justify-content: space-between;
    padding: 8px 14px; border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
  }
  .sidebar .logo-badge { display: none; }
  .side-nav { flex-direction: row; margin: 0; gap: 2px; }
  .side-bottom { flex-direction: row; margin: 0; gap: 2px; }
  .side-btn { width: 44px; height: 44px; }
  .content { padding-bottom: 200px; }
  .user-meta { display: none; }
  .row-artist { display: none; }
  .hero { padding: 28px 24px; }
}
