:root {
  --bg: #0b0f15;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #3b82f6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #1f2937;
}

/* ===== Reset / base ===== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Helvetica,Arial,sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.ov-lock { overflow: hidden; }

/* Utils */
.muted { color: var(--muted); }
.input {
  width: 100%; padding: 12px; border-radius: 12px;
  border: 1px solid var(--border); background: #0b1220; color: var(--text);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); border: 0; border-radius: 12px;
  color: #fff; padding: 10px 14px; cursor: pointer; font-weight: 600;
}
.btn.ghost { background: #1f2937; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
}

/* ===== Header / Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 3000;
  background: #0b1220;
  border-bottom: 1px solid var(--primary);
  box-shadow: 0 0 5px var(--primary);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; position: relative; z-index: 3001; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 28px; }
.brand-name { font-weight: 800; letter-spacing: .2px; }
.main-nav { display: flex; gap: 16px; align-items: center; }
.main-nav a { padding: 8px 10px; border-radius: 8px; }
.main-nav a.active,
.main-nav a:hover { background: #0f172a; }
.header-right { display: flex; align-items: center; gap: 10px; }
.profile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px;
}
.hamburger {
  display: none; background: transparent; border: 0;
  color: var(--text); font-size: 18px;
}
.mobile-nav {
  display: none; position: absolute; top: 52px; left: 0; right: 0;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 10px; border-radius: 0 0 12px 12px; z-index: 3002;
  box-shadow: 0 14px 30px #00000055;
}
.mobile-nav a { display: block; padding: 12px 10px; border-radius: 10px; }
.mobile-nav a:hover { background: #0f172a; }
.mobile-nav.show { display: block; }
@media (max-width: 800px) {
  .main-nav { display: none; }
  .hamburger { display: inline-flex; }
  .brand-name { font-size: 16px; }
}

/* ===== Banner ===== */
.banner { margin-top: 18px; overflow: hidden; }
.banner .slides { display: flex; transition: transform .5s ease; }
.banner .slide { min-width: 100%; height: 320px; }
.banner .slide img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
}
.banner .dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 8px;
}
.banner .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: #ffffff40; border: 0;
}
.banner .dot.active { background: #fff; }
.fallback-banner {
  display: flex; align-items: center; justify-content: center;
  height: 320px; background: #0f172a; border-radius: 12px; color: var(--muted);
}

/* ===== Busca ===== */
.search-row { display: flex; gap: 10px; align-items: center; }

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 10px; margin: 8px 0 14px;
}
.tabs .tab {
  background: #1f2937; border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 8px 12px; cursor: pointer;
}
.tabs .tab.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ===== Grid ===== */
.section { margin-top: 28px; }
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ===== Card Música / Vídeo ===== */
.bm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.bm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.bm-card-thumb {
  position: relative; line-height: 0;
  width: 100%; height: 200px; overflow: hidden; flex-shrink: 0;
}
.bm-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.badge-rank {
  position: absolute; top: 10px; left: 10px;
  background: var(--warn); color: #111; font-weight: 800;
  font-size: 15px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid #000; box-shadow: 0 2px 0 #00000055;
}
.bm-card-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; justify-content: center;
}
.bm-card-title {
  font-weight: 700; font-size: 1rem; margin: 0 0 6px; color: var(--text);
}
.bm-card-artist { font-size: 0.9rem; color: var(--muted); }
.bm-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.card-plays { font-size: 0.9rem; color: var(--muted); }
.card-fav {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; transition: color 0.2s;
}
.card-fav:hover, .card-fav.heart-on { color: #f43f5e; }

/* ===== Player Áudio ===== */
body { padding-bottom: 118px; }
.bm-player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500;
  background: #0b1220; border-top: 1px solid var(--border);
  padding: 10px 12px;
}
.bm-player-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
}
.bm-left { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.bm-left img {
  width: 56px; height: 56px; border-radius: 12px;
  object-fit: cover; border: 1px solid var(--border);
}
.bm-meta { min-width: 0; }
.bm-title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-artist { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bm-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.icon {
  background: #0f172a; border: 1px solid var(--border);
  color: var(--text); border-radius: 12px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon.heart-on { background: #172554; border-color: #1f3a8a; color: #fff; }
.btn-play {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--primary); border: 0; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.bm-seekline {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 900px;
}
.bm-seekline span { width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
#bm-seek { flex: 1; }
input[type="range"] { accent-color: var(--primary); }
.bm-right { display: flex; align-items: center; gap: 8px; }
.bm-vol-pop {
  position: fixed; display: none; padding: 10px;
  background: #0b1220; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 24px #0007; z-index: 9999;
}
.bm-vol-pop.show { display: block; }
.bm-vol-pop input {
  writing-mode: bt-lr; -webkit-appearance: slider-vertical;
  height: 120px; width: 28px;
}
.bm-title.marquee span {
  display: inline-block; padding-left: 100%;
  animation: bm-marquee 12s linear infinite;
}
@keyframes bm-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (max-width: 640px) {
  .bm-player-inner { display: flex; flex-direction: column; position: relative; }
  .bm-right { position: absolute; right: 12px; top: 8px; }
  .bm-left { padding-right: 120px; }
  .bm-seekline { order: 2; width: 100%; }
  .bm-center { order: 3; }
  .btn-play { width: 56px; height: 56px; }
}
/* ===== Popover de volume ancorado ao botão ===== */
.bm-vol-pop{
  position: fixed;               /* posiciono pela tela, calculo via JS */
  display: none;
  padding: 10px 12px;
  background: #0b1220;
  border: 1px solid var(--border, #1f2a44);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  z-index: 9999;
}
.bm-vol-pop.show{ display:block; }

.bm-vol-pop::after{               /* “setinha” apontando para o botão */
  content:"";
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:-6px;
  border:6px solid transparent;
  border-top-color:#0b1220;
}

.bm-vol-pop input[type="range"]{
  writing-mode: bt-lr;
  -webkit-appearance: slider-vertical;
  width: 26px;
  height: 130px;
}
/* ===== Overlay Letras ===== */
.bm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 2600;
  align-items: center; justify-content: center; padding: 16px;
}
.bm-overlay.show { display: flex; }
.bm-overlay-inner { max-width: 760px; width: 100%; }
.overlay-close {
  float: right; background: transparent; border: 0;
  color: var(--text); font-size: 18px; cursor: pointer;
}
.overlay-head { display: flex; gap: 12px; align-items: center; }
.overlay-head img {
  width: 110px; height: 110px; border-radius: 10px;
  object-fit: cover; border: 1px solid var(--border);
}
.overlay-lyrics {
  max-height: 45vh; overflow: auto; white-space: pre-wrap;
  overscroll-behavior: contain; scroll-behavior: smooth; padding-right: 6px;
}
.bm-lyrics-empty { color: var(--muted); }
.lrc-lines { display: block; }
.lrc-line {
  padding: 6px 0; line-height: 1.45; color: #b6bcc7;
  transition: color .2s ease, background .2s ease;
}
.lrc-line.active {
  color: #fff; font-weight: 800;
  background: linear-gradient(90deg,rgba(59,130,246,.07),transparent);
}

/* === Overlay Vídeo === */
.bm-video-ov {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8); z-index: 2700;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.bm-video-ov.show { display: flex; }
.bm-video-box {
  margin: 0 auto; width: auto;
  max-width: min(960px,94vw); max-height: 94vh;
}
.bm-video-box video {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 86vh;
  object-fit: contain; border-radius: 12px;
  border: 1px solid var(--border); background: #000;
}

/* ===== Biblioteca ===== */
main.library {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  background: var(--bg);
}
.library-header { margin-bottom: 24px; }
.library-header h1 {
  margin: 0; font-size: 2rem; font-weight: 800; color: var(--text);
}
.library-header p { margin: 6px 0 0; color: var(--muted); }
.library-tabs {
  display: flex; gap: 10px; margin-bottom: 24px;
}
.library-tabs button {
  background: #1f2937; border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 8px 16px;
  cursor: pointer; font-weight: 600;
  transition: background .2s, border-color .2s, color .2s;
}
.library-tabs button.active,
.library-tabs button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tab-section { display: none; }
.tab-section.active { display: block; }
.library-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.playlist-grid, .bm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.playlist-card, .bm-card-link {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.playlist-card:hover, .bm-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.5);
}
.playlist-card .playlist-icon, .bm-card-link .playlist-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.playlist-card .playlist-info h3, .bm-card-link .playlist-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.playlist-card .playlist-info p, .bm-card-link .playlist-info p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
}
#new-playlist.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
}
#new-playlist.btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}
.library-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

/* ===== Resultados da busca ===== */
.grid-cards[data-list-context="search"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.grid-cards[data-list-context="search"] .bm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.grid-cards[data-list-context="search"] .bm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.grid-cards[data-list-context="search"] .bm-card-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.grid-cards[data-list-context="search"] .bm-card-body {
  padding: 14px;
}
.grid-cards[data-list-context="search"] .bm-card-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 6px;
  color: var(--text);
}
.grid-cards[data-list-context="search"] .bm-card-artist {
  font-size: 0.9rem;
  color: var(--muted);
}
/* ===== Podcast View ===== */
.podcast-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 30px;
}

.podcast-header img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.podcast-info h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 800;
}

.podcast-info p {
  margin: 4px 0;
  color: var(--muted);
}

.podcast-episodes {
  margin-top: 40px;
}

.podcast-episodes h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.episode-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
}

.episode-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.episode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.episode-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.episode-meta {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  gap: 14px;
}

.episode-card audio {
  width: 100%;
  outline: none;
  border-radius: 12px;
}
/* se ainda não existir no style.css */
.banner-full { margin-top: 18px; overflow: hidden; }
.banner-full .slides { display: flex; transition: transform .5s ease; }
.banner-full .slide { min-width: 100%; height: 380px; }
.banner-full .slide img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.banner-full .dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.banner-full .dot { width: 8px; height: 8px; border-radius: 999px; background: #ffffff40; border: 0; }
.banner-full .dot.active { background: #fff; }
/* Banner: sem margem e sem “gap” embaixo da imagem */
.banner-full { margin: 0; }
.banner-full .slides { margin: 0; padding: 0; }
.banner-full .slide { display:block; line-height:0; }       /* elimina espaço abaixo da img */
.banner-full .slide img { display:block; width:100%; height:100%; object-fit:cover; }
/* navegação */
.nav {position:sticky; top:0; z-index:50; background:#0b1320; border-bottom:1px solid var(--border, #1b2233);}
.nav .nav-inner {display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 16px;}
.nav .brand {display:flex; align-items:center; gap:8px;}
.nav .nav-links {display:flex; gap:16px; flex-wrap:wrap;}
.nav .nav-links a {color:#cbd5e1; padding:6px 4px; border-radius:8px;}
.nav .nav-links a.active, .nav .nav-links a:hover {color:#fff;}

.nav-right {display:flex; align-items:center; gap:10px;}
.btn.btn-small {padding:6px 10px; font-size:0.92rem; border-radius:10px;}
.btn-ghost {background:transparent; border:1px solid #2a3550; color:#cbd5e1;}
.btn-ghost:hover {border-color:#3b82f6; color:#fff;}

.user-menu {position:relative;}
.user-btn {display:flex; align-items:center; gap:8px; background:#162036; color:#cbd5e1; border:1px solid #253152; padding:6px 10px; border-radius:10px; cursor:pointer;}
.user-btn:hover {color:#fff; border-color:#3b82f6;}
.user-drop {position:absolute; right:0; top:calc(100% + 6px); min-width:220px; background:#0f172a; border:1px solid #253152; border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,.35); padding:8px;}
.user-drop a {display:flex; align-items:center; gap:8px; padding:8px 10px; color:#cbd5e1; border-radius:8px;}
.user-drop a:hover {background:#151f39; color:#fff;}
.user-drop hr {border:none; border-top:1px solid #253152; margin:6px 0;}
.user-drop a.danger {color:#f87171;}
.user-drop a.danger:hover {background:#1f1420;}
.brand .logo{height:26px;width:auto;display:block}
.brand .wordmark{font-weight:800;color:#fff}
.brand .wordmark span{color:#3b82f6}
/* --- HEADER: espaçamento, logo e prioridade do menu --- */

/* Header sempre no topo e com respiro nas bordas */
header.nav{
  position: sticky;
  top: 0;
  z-index: 1500;                /* por cima de banners/players */
  padding-left: clamp(18px, 5vw, 36px);
  padding-right: clamp(18px, 5vw, 36px);
}

/* Logo maior */
header.nav .brand .logo{
  height: clamp(28px, 4.2vw, 40px);  /* celular → desktop */
  width: auto;
  display: block;
}

/* Mais respiro no mobile, respeita notch */
@media (max-width: 640px){
  header.nav{
    padding-left: max(22px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
}

/* Botão hambúrguer SEMPRE por cima */
header.nav .menu-toggle,
header.nav .hamburger,
#bm-menu-toggle{
  position: relative;
  z-index: 2001;
}

/* Painel do menu mobile (deslizante debaixo do header) */
@media (max-width: 980px){
  /* ajuste os seletores conforme seu header.php */
  header.nav .nav-links{
    position: fixed;
    inset: 56px 0 0 0;                  /* abaixo do header */
    background: rgba(10,14,22,.96);
    backdrop-filter: blur(8px);
    padding: 14px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateY(-100%);
    transition: transform .22s ease;
    z-index: 2000;
  }
  header.nav.is-open .nav-links{
    transform: translateY(0);
  }

  /* Deixe os links mais “tocáveis” no celular */
  header.nav .nav-links a{
    padding: 10px 4px;
    border-radius: 8px;
  }
}
