/* 1. TOKENS & TEMA */
:root {
  --bg: #f2f1ed;
  --surface: #ffffff;
  --raised: #e8e7e1;
  --card: #ffffff;
  --card-h: #f7f6f2;
  --border: rgba(0, 0, 0, 0.09);
  --border-m: rgba(0, 0, 0, 0.15);
  --accent: #c8963e;
  --accent-l: #e0b060;
  --accent-d: rgba(200, 150, 62, 0.12);
  --accent-g: rgba(200, 150, 62, 0.3);
  --text: #18170f;
  --text-m: #4a4840;
  --text-d: #6b6960;
  --player-bg: rgba(242, 241, 237, 0.94);
  --nav-bg: rgba(242, 241, 237, 0.97);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --red: #d94f4f;
  --green: #4a9e6a;
}

[data-theme="dark"] {
  --bg: #0d0e14;
  --surface: #121318;
  --raised: #181a22;
  --card: #1a1c26;
  --card-h: #1f2130;
  --border: rgba(255, 255, 255, 0.07);
  --border-m: rgba(255, 255, 255, 0.13);
  --accent: #c8963e;
  --accent-l: #e0b060;
  --accent-d: rgba(200, 150, 62, 0.13);
  --accent-g: rgba(200, 150, 62, 0.3);
  --text: #eeede6;
  --text-m: #b0b0b0;
  --text-d: #808080ff;
  --player-bg: rgba(13, 14, 20, 0.95);
  --nav-bg: rgba(13, 14, 20, 0.97);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
}

/* 2. PRELOADER */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-content {
  text-align: center;
}

.loader-logo {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: pulse 1.8s infinite ease-in-out;
  box-shadow: 0 10px 30px rgba(200, 150, 62, 0.3);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* 3. RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Geist', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

button {
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: 'Geist', sans-serif;
  border: none;
  outline: none;
  background: none;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-m);
  border-radius: 99px;
}

/* â•â•â•â•â•â• RANGE â•â•â•â•â•â• */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background: transparent;
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--border-m) var(--pct, 0%));
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -5.5px;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.1s;
}

input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* â•â•â•â•â•â• LAYOUT â•â•â•â•â•â• */
.shell {
  display: flex;
  /* 100vh no mobile é MAIOR que a área visível (barra de endereço), o que
     deixa o app ultrapassar o viewport e o topo escorregar para debaixo da
     barra do navegador. 100dvh acompanha o viewport dinâmico (segue o
     fallback 100vh em navegadores antigos). */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* â•â•â•â•â•â• SIDEBAR â•â•â•â•â•â• */
.sidebar {
  width: 252px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: background 0.25s;
  padding-bottom: 88px;
}

@media (max-width: 767px) {
  .sidebar {
    display: none;
  }
}

.s-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
}

.s-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex;
  align-items: center;
  justify-content: center;
}

.s-logo-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}

.s-nav {
  padding: 2px 10px;
}

.s-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-d);
  margin-bottom: 1px;
  transition: color 0.12s, background 0.12s;
  text-align: left;
}

.s-btn:hover {
  color: var(--text-m);
  background: var(--raised);
}

.s-btn.active {
  color: var(--accent);
  background: var(--accent-d);
  font-weight: 600;
}

.s-btn.pl-item {
  padding-left: 26px;
  font-size: 12.5px;
  font-weight: 400;
}

.s-btn.pl-item.active {
  color: var(--accent);
  font-weight: 500;
}

.s-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 14px;
}

.s-sec {
  padding: 8px 18px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
}

.accordion-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.12s;
  user-select: none;
  padding-right: 14px;
}

.accordion-header:hover {
  color: var(--text);
}

.accordion-header.active {
  color: var(--accent);
}

.acc-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.accordion-header.active .acc-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.accordion-content.hidden {
  display: none !important;
}

.s-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.s-scroll.artists {
  max-height: 160px;
}

.art-btn {
  display: block;
  width: 100%;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-d);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s, background 0.12s;
}

.art-btn:hover {
  color: var(--text-m);
  background: var(--raised);
}

.s-bottom {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
}

.s-scan-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-d);
  border: 1px solid var(--border);
  transition: all 0.12s;
}

.s-scan-btn:hover {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

.ico-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-d);
  transition: all 0.12s;
  line-height: 1;
}

.ico-btn:hover {
  color: var(--text-m);
  background: var(--raised);
  border-color: var(--border-m);
}

.ico-btn.on {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

/* â•â•â•â•â•â• MAIN â•â•â•â•â•â• */
.main {
  flex: 1;
  overflow-y: auto;
  /* Nada de encadear a rolagem com a página/navegador: evita que o topo
     (barra sticky de filtros) se desloque sob a barra do navegador. */
  overscroll-behavior: contain;
  min-width: 0;
  padding-bottom: 90px;
}

@media (max-width: 767px) {
  .main {
    padding-bottom: calc(60px + 144px + env(safe-area-inset-bottom, 0px) + 40px);
  }
}

.v-hdr {
  padding: 0px 25px 0px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--player-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 767px) {
  .v-hdr {
    padding: 0px 16px 0px;
  }
}

.v-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}

@media (max-width: 767px) {
  .v-title {
    font-size: 20px;
  }
}

.v-sub {
  font-size: 11.5px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
}

.v-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tog-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-d);
  transition: all 0.12s;
}

.tog-btn:hover {
  color: var(--text-m);
  background: var(--raised);
}

.tog-btn.on {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

/* â•â•â•â•â•â• SONG GRID â•â•â•â•â•â• */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
}

/* Relatório admin: cards e linhas precisam do mesmo respiro lateral do grid. */
#reportsContent {
  padding: 4px 24px 24px;
}

@media (max-width: 767px) {
  #reportsContent {
    padding: 4px 12px 20px;
  }
}

/* ══ Drag & drop dos destaques (ordem da landing — admin) ══ */
.feat-dnd {
  cursor: grab;
}
.feat-dnd:active {
  cursor: grabbing;
}
.feat-dnd.dragging {
  opacity: 0.35;
}
.feat-dnd.drop-before {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}
.feat-dnd.drop-after {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

@media (max-width: 767px) {
  .song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .song-card {
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }
}

@media (min-width: 1280px) {
  .song-grid {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  }
}

.song-card {
  background: var(--card);
  border-radius: 13px;
  padding: 11px;
  cursor: pointer;
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.14s, transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.song-card:hover {
  background: var(--card-h);
  transform: translateY(-2px);
  border-color: var(--border-m);
  box-shadow: var(--shadow);
}

.song-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-g), var(--shadow);
}

.c-cover {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--raised);
  margin-bottom: 10px;
  position: relative;
}

.c-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.c-cover-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--raised);
}

.c-overlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  pointer-events: none;
}

.song-card.active .c-overlay,
.song-card.playing .c-overlay,
.song-card.active-paused .c-overlay {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .song-card:hover .c-overlay {
    opacity: 1;
  }
}


.c-play-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 18px rgba(200, 150, 62, 0.45);
  transform: scale(0.88);
  transition: transform 0.14s;
  color: var(--bg);
}

.song-card.active .c-play-ico,
.song-card.playing .c-play-ico,
.song-card.active-paused .c-play-ico {
  transform: scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .song-card:hover .c-play-ico {
    transform: scale(1);
  }
}

.c-play-ico.loading {
  color: #000;
}

@media (max-width: 520px) {
  .visible-mobile { display: inline; }
  .hidden-mobile { display: none; }
}

@media (min-width: 521px) {
  .visible-mobile { display: none; }
  .hidden-mobile { display: inline; }
}

.c-acts, .c-acts-l {
  position: absolute;
  top: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.14s;
  z-index: 2;
}

.c-acts { right: 7px; }
.c-acts-l { left: 7px; }

.song-card.active .c-acts,
.song-card.playing .c-acts,
.song-card.active-paused .c-acts,
.song-card.active .c-acts-l,
.song-card.playing .c-acts-l,
.song-card.active-paused .c-acts-l,
.song-card.admin-actions .c-acts,
.song-card.admin-actions .c-acts-l {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .song-card:hover .c-acts,
  .song-card:hover .c-acts-l {
    opacity: 1;
  }
}

.c-act {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border-m);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d); /* Cor padrão acinzentada */
  font-size: 9px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
  backdrop-filter: blur(6px);
}

.c-act.pub-btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.c-act.pub-btn.on {
  color: var(--green) !important;
}

.c-act.pub-btn.off {
  color: var(--red) !important;
}

.c-act.pub-btn.on:hover,
.c-act.pub-btn.off:hover {
  color: inherit; /* Isso fará com que o hover use a lógica do .c-act padrão se necessário, mas queremos manter verde/vermelho? O usuário disse: "sempre que aparecer o ícone... verde/vermelho mesmo quando tiver hover" */
}



.c-act.loading {
  opacity: 0.7;
  cursor: progress;
}

.c-act.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.c-act.on {
  color: #fff; /* Branco quando ativado */
}

.c-act.off {
  color: #fff; /* Manter branco também quando não publicado */
}

.c-act:hover {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

/* publicar/despublicar: manter cor do ícone (verde/vermelho) mesmo em hover */
.c-act.pub-btn.on:hover {
  color: var(--green) !important;
  background: transparent !important;
  border-color: rgba(74, 158, 106, 0.2) !important;
}

.c-act.pub-btn.off:hover {
  color: var(--red) !important;
  background: transparent !important;
  border-color: rgba(217, 79, 79, 0.2) !important;
}

/* botão featured (página inicial): estrela dourada quando ativo */
.c-act.feat-btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.c-act.feat-btn.on {
  color: #f5a623 !important;
}

.c-act.feat-btn.off {
  color: #666 !important;
}

.c-act.feat-btn.on:hover {
  color: #f5a623 !important;
  background: transparent !important;
  border-color: rgba(245, 166, 35, 0.2) !important;
}

.c-act.feat-btn.off:hover {
  color: #f5a623 !important;
  background: transparent !important;
  border-color: rgba(245, 166, 35, 0.2) !important;
}

/* ══════════ MENU DE AÇÕES DO CARD (admin: botão único ⋮) ══════════ */
.c-menu-wrap {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.14s;
}

.song-card.active .c-menu-wrap,
.song-card.playing .c-menu-wrap,
.song-card.active-paused .c-menu-wrap,
.song-card.admin-actions .c-menu-wrap {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .song-card:hover .c-menu-wrap {
    opacity: 1;
  }
}

/* template oculto — o menu real é flutuante, anexado ao body via JS */
.c-menu {
  display: none;
}

.c-dots {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border-m);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}

.c-dots:hover {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

.c-dots.active {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

/* opções do menu flutuante do card: fonte menor que o menu da lista */
#cardMenuFloat .li-m-btn {
  font-size: 11px;
  padding: 6px 10px;
  gap: 7px;
}

#cardMenuFloat .li-m-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.c-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0px;
  line-height: 1.2;
}

.c-artist {
  font-size: 11.5px;
  color: var(--text-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.c-time {
  font-size: 10px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
  line-height: 1;
}

.c-eq {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  z-index: 2;
}

.song-card.playing:not(.loading) .c-eq {
  display: flex;
}

.eq-b {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.eq-b:nth-child(1) {
  animation: eq 0.55s 0s ease-in-out infinite alternate;
}

.eq-b:nth-child(2) {
  animation: eq 0.55s 0.18s ease-in-out infinite alternate;
}

.eq-b:nth-child(3) {
  animation: eq 0.55s 0.09s ease-in-out infinite alternate;
}

@keyframes eq {
  from {
    height: 2px;
  }

  to {
    height: 12px;
  }
}

/* â•â•â•â•â•â• LIST MODE â•â•â•â•â•â• */
.song-list-wrap {
  padding: 0 20px 20px;
}

@media (max-width: 767px) {
  .song-list-wrap {
    padding: 0 12px 16px;
  }
}

.s-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.s-list-item:hover {
  background: var(--card);
  border-color: var(--border);
}

.s-list-item.active {
  background: var(--card);
  border-color: var(--accent);
}

.li-cov {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  flex-shrink: 0;
  background: var(--raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.li-cov img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.li-info {
  flex: 1;
  min-width: 0;
}

.li-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-sub {
  font-size: 11.5px;
  color: var(--text-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.li-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.li-acts .li-dots-wrap {
  opacity: 1;
}

.li-act {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  color: var(--text-d);
  transition: color 0.1s, background 0.1s;
}

.li-act:hover {
  color: var(--accent);
  background: var(--accent-d);
}

.li-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-d);
  transition: color 0.1s, background 0.1s;
}

.li-dots:hover {
  color: var(--text-m);
  background: var(--raised);
}

.li-dots.active {
  color: var(--accent);
  background: var(--accent-d);
}

.li-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 100;
  min-width: 140px;
  display: none;
  flex-direction: column;
}

.li-menu.show {
  display: flex;
}

.li-m-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  transition: background 0.1s;
  text-align: left;
}

.li-m-btn:hover {
  background: var(--raised);
}

.li-time {
  font-size: 11px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  flex-shrink: 0;
}

/* â•â•â•â•â•â• SEARCH â•â•â•â•â•â• */
.search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 24px 20px;
}

@media (max-width: 767px) {
  .search-wrap {
    margin: 0 16px 16px;
  }
}

.search-ico-pos {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-d);
  pointer-events: none;
}

.search-inp {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px 11px 40px;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-inp:focus {
  border-color: var(--accent-g);
  box-shadow: 0 0 0 3px var(--accent-d);
}

.search-inp::placeholder {
  color: var(--text-d);
}

/* â•â•â•â•â•â• PLAYER â•â•â•â•â•â• */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--player-bg);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-top: 1px solid var(--border);
  transition: background 0.25s;
}

/* Desktop player: compact bar */
.p-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 0 18px;
  gap: 10px;
}

@media (max-width: 767px) {
  .p-desktop {
    display: none;
  }
}

/* Mobile player: tall panel above bottom nav */
.p-mobile {
  display: none;
  flex-direction: column;
  padding: 14px 18px 12px;
}

@media (max-width: 767px) {
  .player {
    bottom: 60px;
  }

  .p-mobile {
    display: flex;
  }
}

/* Mobile top row: cover + info + play */
.pm-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pm-cov {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}

.pm-cov img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pm-cov-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--raised);
}

.pm-cov.glow {
  box-shadow: 0 2px 14px var(--accent-g);
}

.pm-text {
  flex: 1;
  min-width: 0;
}

.pm-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-artist {
  font-size: 11.5px;
  color: var(--text-d);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile progress row */
.pm-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pm-time {
  font-size: 10px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  width: 28px;
  flex-shrink: 0;
}

.pm-time.r {
  text-align: right;
}

.pm-bar {
  flex: 1;
}

/* Mobile controls row */
.pm-ctrls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.pm-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.pm-play:active {
  transform: scale(0.93);
}

.pm-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d);
  padding: 6px;
  border-radius: 8px;
  transition: color 0.12s;
}

.pm-ctrl:hover,
.pm-ctrl:active {
  color: var(--text-m);
}

.pm-ctrl.on {
  color: var(--accent);
}

/* Desktop shared styles */
.p-info {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 30%;
  min-width: 180px;
}

.p-cov {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
}

.p-cov img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-cov-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-cov.glow {
  box-shadow: 0 3px 20px var(--accent-g);
}

.p-text {
  min-width: 0;
}

.p-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.p-artist {
  font-size: 11.5px;
  color: var(--text-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
  margin-top: 1px;
}

.p-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  max-width: 560px;
}

.p-ctrls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d);
  padding: 4px;
  border-radius: 7px;
  transition: color 0.12s;
}

.ctrl:hover {
  color: var(--text-m);
}

.ctrl.on {
  color: var(--accent);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.play-btn:hover {
  transform: scale(1.07);
}

.play-btn:active {
  transform: scale(0.95);
}

.p-prog {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
}

.p-time {
  font-size: 10.5px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  width: 30px;
  flex-shrink: 0;
}

.p-time.r {
  text-align: right;
}

.p-bar {
  flex: 1;
}

.p-right {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 30%;
  min-width: 180px;
  justify-content: flex-end;
}

.vol-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.vol-bar {
  width: 78px;
}

@media (max-width: 1023px) {
  .vol-row {
    display: none;
  }
}

/* â•â•â•â•â•â• MOBILE NAV â•â•â•â•â•â• */
.mob-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 10px;
  transition: background 0.25s;
}

@media (max-width: 767px) {
  .mob-nav {
    display: flex;
  }
}

.mob-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-d);
  font-size: 9.5px;
  font-weight: 600;
  padding: 0 8px;
  transition: color 0.12s;
}

.mob-btn.active {
  color: var(--accent);
}

/* ════ VISUALIZER ════ */
.vis-bg-container {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(12px);
    opacity: 0.3;
    z-index: 1;
}
#visBody {
    position: relative;
    z-index: 2;
}
.vis-fs .ly-hdr {
    justify-content: center;
}
.vis-fs .ly-info {
    text-align: center;
}
#visPanel.vis-fs .vis-ctrls {
    display: none !important;
}
.vis-hdr-centered { /* Placeholder para futuras edições se necessário */ }
/* (Rest of visualizer CSS ...) */
#lyricsPanel {
  position: fixed;
  inset: 0;
  bottom: 88px;
  z-index: 60;
  background: var(--player-bg);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  display: flex;
  flex-direction: column;
  transition: opacity 0.22s, transform 0.22s;
  border-top: 1px solid var(--border);
}

#lyricsPanel.off {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

@media (max-width: 767px) {
  #lyricsPanel {
    bottom: 213px;
    /* 60px (nav) + 153px (player mobile approx) */
  }
}

.ly-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

@media (max-width: 767px) {
  .ly-hdr {
    padding: 14px 16px;
  }
}

.ly-info {
  min-width: 0;
}

.ly-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ly-artist {
  font-size: 12px;
  color: var(--text-d);
  margin-top: 2px;
}

.ly-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--text-d);
  transition: all 0.12s;
}

.ly-close:hover {
  color: var(--text);
  background: var(--card);
}

.ly-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.ly-layout {
  display: flex;
  min-height: 100%;
}

.ly-side {
  width: 400px;
  padding: 60px 0 60px 60px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.ly-img-box {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--raised);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-m);
}

.ly-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ly-img-box:hover img {
  transform: scale(1.05);
}

.ly-img-ph {
  color: var(--text-d);
  opacity: 0.5;
}

.ly-main {
  flex: 1;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
}

#lyricsContent {
  font-size: 19px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  opacity: 0.95;
  font-family: 'Geist', sans-serif;
  max-width: 600px;
}

@media (max-width: 1100px) {
  .ly-side {
    width: 320px;
    padding: 40px 0 40px 40px;
  }

  .ly-main {
    padding: 40px 50px;
  }

  #lyricsContent {
    font-size: 17px;
  }
}

@media (max-width: 767px) {
  .ly-layout {
    flex-direction: column;
  }

  .ly-side {
    width: 100%;
    padding: 30px 20px 0;
    position: static;
  }

  .ly-img-box {
    width: 200px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  .ly-main {
    padding: 30px 20px;
    text-align: left;
    align-items: flex-start;
  }

  #lyricsContent {
    font-size: 15px;
    line-height: 1.6;
    max-width: none;
    font-weight: 400;
  }
}

/* â•â•â•â•â•â• MODALS â•â•â•â•â•â• */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-bg.open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transition: background 0.25s;
}

.accordion-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
  user-select: none;
}

.accordion-header:hover {
  color: var(--text);
}

.accordion-header.active {
  color: var(--accent);
}

.acc-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.accordion-header.active .acc-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.accordion-content {
  transition: all 0.3s ease;
}

.accordion-content.hidden {
  display: none !important;
}

.m-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.m-sub {
  font-size: 12.5px;
  color: var(--text-d);
  margin-bottom: 20px;
}

.m-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-d);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-prog {
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 22px;
}

.scan-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-l));
  border-radius: 99px;
  animation: sani 1.4s ease-in-out infinite;
}

@keyframes sani {
  0% {
    width: 20%;
    margin-left: 0;
  }

  50% {
    width: 50%;
    margin-left: 30%;
  }

  100% {
    width: 20%;
    margin-left: 80%;
  }
}

.pl-inp {
  width: 100%;
  padding: 10px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.pl-inp:focus {
  border-color: var(--accent-g);
  box-shadow: 0 0 0 3px var(--accent-d);
}

.pl-inp::placeholder {
  color: var(--text-d);
}

.m-btn {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  transition: opacity 0.12s, transform 0.12s;
  font-family: 'Geist', sans-serif;
}

.m-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.m-btn.sec {
  background: var(--raised);
  color: var(--text-m);
  margin-top: 7px;
  border: 1px solid var(--border);
}

.m-btn.sec:hover {
  background: var(--card);
  transform: none;
}

.pl-list-pick {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.pl-inline-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.pl-inline-actions .m-btn {
  margin-top: 0;
  padding: 10px 8px;
  font-size: 13px;
}

.pl-inline-actions .m-btn.sec {
  margin-top: 0;
}

.pl-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s;
}

.pl-pick:hover {
  background: var(--raised);
}

.pl-pick-dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--accent-d);
  border: 1px solid var(--accent-g);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.pl-pick-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.pl-pick-count {
  font-size: 11px;
  color: var(--text-d);
  margin-top: 1px;
  font-family: 'Geist Mono', monospace;
}

/* Settings */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.set-row:last-child {
  border-bottom: none;
}

.set-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.set-sub {
  font-size: 11.5px;
  color: var(--text-d);
  margin-top: 2px;
}

.sw {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.sw input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sw-track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--border-m);
  cursor: pointer;
  transition: background 0.2s;
}

.sw input:checked+.sw-track {
  background: var(--accent);
}

.sw-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  pointer-events: none;
}

.sw input:checked~.sw-thumb {
  transform: translateX(18px);
}

/* Responsive Tabs Modal */
.modal-card.wide {
  max-width: 800px;
  padding: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  height: auto;
  max-height: 85vh;
}

.modal-tabs-sidebar {
  width: 220px;
  background: var(--raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}

.modal-tabs-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: var(--surface);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-d);
  transition: all 0.2s;
  text-align: left;
  border-left: 3px solid transparent;
}

.tab-btn:hover {
  background: var(--border);
  color: var(--text-m);
}

.tab-btn.active {
  color: var(--accent);
  background: var(--accent-d);
  border-left-color: var(--accent);
}

.tab-section {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.tab-section.active {
  display: block;
}

/* Modal Enhancements */
.scrollable-modal {
  display: flex;
  flex-direction: row;
  overflow: hidden !important;
  position: relative;
}

.modal-full-loader {
  position: absolute;
  inset: 0;
  background: var(--surface);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  transition: opacity 0.3s, visibility 0.3s;
}

@media (max-width: 767px) {
  .modal-full-loader {
    position: fixed; /* No mobile, o card rola, então o loader precisa fixar na tela */
    z-index: 200;
  }
}

.modal-full-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-tabs-sidebar, .modal-tabs-content {
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Modal Close Button */
.modal-close-pos {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2000;
}

@media (max-width: 767px) {
  .modal-close-pos {
    position: fixed;
    top: 25px;
    right: 25px;
  }
}

.close-round-btn {
  background: var(--raised);
  border: none;
  cursor: pointer;
  color: var(--text-d);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.close-round-btn:hover {
  background: var(--border);
}

/* Modal Close Button */
.modal-close-pos {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2000;
}

@media (max-width: 767px) {
  .modal-close-pos {
    position: fixed;
    top: 25px;
    right: 25px;
  }
}

.close-round-btn {
  background: var(--raised);
  border: none;
  cursor: pointer;
  color: var(--text-d);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.close-round-btn:hover {
  background: var(--border);
}

/* Edit Metadata Modal Specifics */
.edit-mp3-sidebar {
  display: flex;
  flex-direction: column;
}


.edit-mp3-sidebar .sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.edit-mp3-sidebar .sidebar-footer {
  margin-top: auto;
  padding: 20px;
}

.cover-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 10px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-m);
  background: var(--raised);
}

.cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d);
  opacity: 0.5;
}

.edit-mp3-sidebar .size-label {
  font-size: 11px;
  color: var(--text-d);
  text-align: center;
  margin-bottom: 5px;
  min-height: 1.2em;
}

.edit-mp3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.edit-mp3-grid .full-width {
  grid-column: span 2;
}

.input-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-d);
  margin-bottom: 6px;
}

.modal-actions-stack {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* Edit Metadata Modal Specifics */
.edit-mp3-sidebar {
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 767px) {
  .modal-card.wide {
    flex-direction: column;
    max-height: 95vh;
  }

  #settingsModal .modal-card.wide {
    overflow: hidden;
  }

  #settingsModal .modal-tabs-sidebar {
    width: 100% !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 6px;
    padding: 10px 12px 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: var(--surface);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }

  #settingsModal .modal-tabs-sidebar::-webkit-scrollbar {
    display: none;
  }

  #settingsModal .modal-tabs-sidebar .tab-btn {
    flex: 1 0 0;
    flex-shrink: 0;
    justify-content: center;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: var(--raised);
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
  }

  #settingsModal .modal-tabs-sidebar .tab-btn svg {
    display: none;
  }

  #settingsModal .modal-tabs-sidebar .tab-btn.active {
    background: var(--surface);
    border-color: var(--accent-g);
    border-bottom-color: var(--surface);
    transform: translateY(1px);
  }

  .edit-mp3-sidebar {
    display: contents; /* Permite reordenar os filhos diretamente */
  }

  .edit-mp3-sidebar .sidebar-header {
    order: 1;
    width: 100%;
    padding: 20px 20px 10px;
    background: var(--raised);
    border-bottom: 1px solid var(--border);
  }

  .modal-tabs-content {
    order: 2; /* O formulário vem depois do título */
    padding: 20px;
    flex: none;
    width: 100%;
  }

  .edit-mp3-sidebar .sidebar-footer {
    order: 3; /* A capa e botão alterar vão para o final */
    padding: 20px;
    background: var(--raised);
    border-top: 1px solid var(--border);
    margin-top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
  }

  .edit-mp3-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .edit-mp3-grid .full-width {
    grid-column: span 1;
  }

  .cover-container {
    width: 80px;
    height: 80px;
    margin: 0;
  }
  
  .edit-mp3-sidebar .size-label {
    margin-bottom: 0;
    font-size: 10px;
    text-align: left;
  }

  .edit-mp3-sidebar #editMp3CoverPreviewWrap {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
  }
}

.hidden-mobile {
  display: block;
}

.visible-mobile {
  display: none;
}

@media (max-width: 767px) {
  .hidden-mobile {
    display: none !important;
  }
  .visible-mobile {
    display: block !important;
  }
}

/* â•â•â•â•â•â• AUTH â•â•â•â•â•â• */
#confirmModal {
  z-index: 10001 !important;
}

#authScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  transition: opacity 0.3s;
}

#authScreen.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.auth-logomark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-name {
  font-size: 25px;
  font-weight: 800;
  line-height: 50px;
  color: var(--text);
  margin-left: 12px;
  letter-spacing: -0.4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-d);
  margin-bottom: 24px;
}

.auth-inp {
  width: 100%;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.auth-inp:focus {
  border-color: var(--accent-g);
  box-shadow: 0 0 0 3px var(--accent-d);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  transition: opacity 0.12s;
  margin-bottom: 16px;
}

.auth-btn:hover {
  opacity: 0.9;
}

.auth-link {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: block;
  margin-bottom: 8px;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-err {
  color: var(--red);
  font-size: 12px;
  margin-bottom: 12px;
  font-weight: 500;
  text-align: center;
}

.auth-ok {
  color: #1DB954;
  font-size: 13px;
  margin: 0 0 16px;
  font-weight: 600;
  text-align: center;
  background: rgba(29, 185, 84, 0.1);
  padding: 12px;
  border-radius: 10px;
}

/* â•â•â•â•â•â• EMPTY â•â•â•â•â•â• */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-d);
}

.e-ico {
  font-size: 38px;
  margin-bottom: 12px;
}

.empty h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-m);
  margin-bottom: 5px;
}

.empty p {
  font-size: 12.5px;
}

/* â•â•â•â•â•â• UTILS â•â•â•â•â•â• */
.hidden {
  display: none !important;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* â•â•â•â•â•â• 404 PAGE â•â•â•â•â•â• */
.page-404 {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background .3s, color .3s;
}

.page-404-container {
  text-align: center;
  max-width: 600px;
  padding: 40px;
  position: relative;
  z-index: 10;
}

.page-404-err-code {
  font-size: clamp(120px, 15vw, 180px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  animation: float404 6s ease-in-out infinite;
}

@keyframes float404 {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.page-404-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.page-404-desc {
  font-size: 16px;
  color: var(--text-d);
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 400px;
  margin-inline: auto;
}

.page-404-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 99px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 10px 20px rgba(200, 150, 62, .3);
}

.page-404-btn:hover {
  background: var(--accent-l);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(200, 150, 62, .4);
}

/* Decorative elements */
.page-404-bg-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: var(--accent);
  filter: blur(150px);
  opacity: 0.15;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.page-404-gl-1 {
  top: -10%;
  left: -10%;
}

.page-404-gl-2 {
  bottom: -10%;
  right: -10%;
}

.page-404-mono {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  opacity: 0.5;
  margin-top: 40px;
}

/* Legenda em Full Screen */
@keyframes subGradientAnim {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.vis-subtitle {
  display: none;
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  text-align: center;

  /* cor sólida (borda/sombra ficam como já estavam) */
  color: var(--text);



  font-family: var(--sub-font, 'Montserrat', 'Roboto', 'Poppins', Arial, sans-serif);
  font-size: var(--sub-size, 30px);
  font-weight: var(--sub-weight, 400);
  z-index: 50;
  pointer-events: none;
}


#visTitle {
  font-family: var(--sub-font, 'Montserrat', 'Roboto', 'Poppins', Arial, sans-serif) !important;
  font-weight: var(--sub-weight, 400) !important;
  color: var(--lightest-color, #e8e8e8) !important;
  -webkit-text-fill-color: var(--lightest-color, #e8e8e8) !important;
}



#visPanel.vis-fs .vis-subtitle {
  display: block;
}

@media (max-width: 767px) {
  .vis-subtitle {
    font-size: 20px;
    bottom: 5vh;
  }
}
#visPanel {
  position: fixed;
  inset: 0;
  bottom: 88px;
  z-index: 2000; /* Extremely high to overtop everything */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: opacity 0.25s, transform 0.25s, bottom 0.25s;
  overflow: hidden;
}

#visPanel.off {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* 1. Blurred Background Cover */
#visBgCover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(50px);
  opacity: 0.35;
  z-index: 10; /* Above Panel Background */
  pointer-events: none;
  display: block !important;
}

/* 2. Visualizer Body (Graph) */
#visBody {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: transparent;
  z-index: 20; /* Above Background */
  display: flex;
  flex-direction: column;
}

/* 3. Centered Sharp Cover (Only in FS) */
#visCenteredCover {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 52.25vh; /* Reduzido de 55vh (5% de redução) */
  width: auto;
  aspect-ratio: 1;
  max-width: 80.75vw; /* Reduzido de 85vw (5% de redução) */
  object-fit: cover;
  z-index: 100; /* Over everything */
  border-radius: 20px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.9), 0 0 60px rgba(255,255,255,0.08);
  pointer-events: none;
}
#visPanel.vis-fs #visCenteredCover { display: block !important; }

/* 4. Header (Metadata & Controls) */
#visPanel .ly-hdr {
  position: absolute; /* Overlay on top of visualizer */
  top: 0;
  left: 0;
  right: 0;
  display: flex !important;
  align-items: center;
  justify-content: flex-end; /* Align to the right (keep buttons) */
  padding: 16px 24px;
  background: transparent !important;
  border-bottom: none !important;
  z-index: 200; 
  flex-shrink: 0;
}

#visPanel .ly-info {
  display: none !important; /* Hide title/artist in normal view */
}

#visPanel .vis-ctrls {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px;
}

/* Fullscreen Immersive State overrides */
#visPanel.vis-fs .ly-hdr {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex !important;
  justify-content: center !important; /* Centralize in FS */
  background: transparent !important;
  border-bottom: none !important;
  padding-top: 6vh;
  flex-direction: column !important;
  pointer-events: none;
  z-index: 20;
}

#visPanel.vis-fs .ly-info {
  display: block !important; /* Show title/artist in FS */
  text-align: center;
}
#visPanel.vis-fs .ly-title {
  /* mesma fonte da legenda (fullscreen) */
  font-size: var(--sub-size, 30px) !important;
  font-weight: 800;
}





#visPanel.vis-fs .ly-artist {

  font-size: 1.2vw;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

#visPanel.vis-fs .vis-ctrls {
  display: none !important;
}

/* Graph Bottom Alignment in FS */
#visPanel.vis-fs #visBody {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40vh; /* Fixed height at bottom */
  z-index: 5;
}

#visCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
  #visPanel:not(.vis-fs) { bottom: 213px; }
  
  #visPanel.vis-fs .ly-hdr { padding-top: 40px; }
  #visPanel.vis-fs .ly-title { font-size: var(--sub-size, 30px) !important; }
  #visPanel.vis-fs .ly-artist { font-size: 16px; }
  
  #visPanel.vis-fs #visCenteredCover {
    width: 75vw;
    height: auto;
    max-height: 45vh;
  }
  
  #visPanel.vis-fs #visBody { height: 35vh; }
}



/* PLAYLIST LIST ADJUSTMENTS */
.pl-list-item {
  cursor: pointer;
  transition: background 0.2s;
}

.pl-list-item:hover {
  background: var(--card-h);
}

@media (max-width: 767px) {
  #view-playlists .song-list-wrap {
    padding: 0 12px calc(213px + env(safe-area-inset-bottom, 0px));
  }
}

/* VISUALIZER HEADER LIGHT MODE SUPPORT */
[data-theme="light"] #visPanel .ly-hdr {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] #visPanel:not(.vis-fs) .ly-title { color: var(--text); }
[data-theme="light"] #visPanel:not(.vis-fs) .ly-artist { color: var(--text-d); }
[data-theme="light"] #visPanel .ly-close {
  background: var(--raised);
  border-color: var(--border);
  color: var(--text-d);
}

[data-theme="light"] #visPanel .ly-close:hover {
  background: var(--card-h);
  color: var(--text);
}

/* OVERRIDE FOR FULLSCREEN LIGHT MODE */
[data-theme="light"] #visPanel.vis-fs .ly-hdr {
  background: transparent !important;
  border-bottom: none !important;
}

/* FORÃ‡A FINAL: botÃ£o publicar/despublicar (Ã­cone verde/vermelho sempre) */
.c-act.pub-btn.on:hover,
.c-act.pub-btn.on:active,
.c-act.pub-btn.off:hover,
.c-act.pub-btn.off:active {
  color: inherit !important;
}

.c-act.pub-btn.on svg,
.c-act.pub-btn.on:hover svg,
.c-act.pub-btn.on:active svg,
.c-act.pub-btn.off svg,
.c-act.pub-btn.off:hover svg,
.c-act.pub-btn.off:active svg {
  color: inherit !important;
}

.c-act.pub-btn.on { color: var(--green) !important; }
.c-act.pub-btn.off { color: var(--red) !important; }

/* publicar/despublicar: manter cor do Ã­cone (verde/vermelho) mesmo em hover e herdar background/borda padrÃ£o */
.c-act.pub-btn.on:hover {
  color: var(--green) !important;
}

.c-act.pub-btn.off:hover {
  color: var(--red) !important;
}




/* FORÇA FINAL: botão publicar/despublicar (ícone verde/vermelho sempre) */
.c-act.pub-btn.on:hover,
.c-act.pub-btn.on:active,
.c-act.pub-btn.off:hover,
.c-act.pub-btn.off:active {
  color: inherit !important;
}

.c-act.pub-btn.on svg,
.c-act.pub-btn.on:hover svg,
.c-act.pub-btn.on:active svg,
.c-act.pub-btn.off svg,
.c-act.pub-btn.off:hover svg,
.c-act.pub-btn.off:active svg {
  color: inherit !important;
}

.c-act.pub-btn.on { color: var(--green) !important; }
.c-act.pub-btn.off { color: var(--red) !important; }
/* Ocultar elementos quando o visualizador estiver em Full Screen */
body.is-vis-fs .player,
body.is-vis-fs .mob-nav {
  display: none !important;
}

body.is-vis-fs #visPanel {
  bottom: 0 !important;
  height: 100% !important;
}

.local-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  width: 100%;
}
.local-loader .loader-content {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}


