.playlist-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.48);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 4;
    display: flex;
    flex-direction: column;
    backdrop-filter: none;
}

.playlist-header {
    padding: 36px 28px 22px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.playlist {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

/* item container */
.playlist-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.24s ease;
}

/* header row (click to play) */
.playlist-item-header {
    padding: 18px 28px;
    cursor: pointer;
    transition: all 0.24s ease;
    display: flex;
    align-items: center;
    gap: 18px;
}

.playlist-item:hover .playlist-item-header {
    background-color: rgba(255, 255, 255, 0.06);
    padding-left: 30px;
}

.playlist-item.active .playlist-item-header {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 2px solid rgba(255, 255, 255, 0.9);
}

.playlist-item-cover {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    transition: transform 0.24s ease;
}

.playlist-item:hover .playlist-item-cover {
    transform: scale(1.02);
}

.playlist-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.24s ease;
}

.playlist-item:hover .playlist-item-cover img {
    opacity: 0.88;
}

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

.playlist-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.015em;
    transition: color 0.24s ease;
}

.playlist-item:hover .playlist-item-title {
    color: rgba(255, 255, 255, 0.95);
}

.playlist-item-artists {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.58);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.24s ease;
}

.playlist-item:hover .playlist-item-artists {
    color: rgba(255, 255, 255, 0.7);
}

/* toggle button */
.playlist-item-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.playlist-item-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.playlist-item-toggle.hidden {
    display: none;
}

.playlist-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.playlist-item.expanded .playlist-chevron {
    transform: rotate(180deg);
}

/* expanded area */
.playlist-item-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
    opacity: 0;
    padding: 0 28px;
}

.playlist-item.expanded .playlist-item-details {
    max-height: 2000px; 
    opacity: 1;
    padding: 0 28px 18px 28px;
}

.playlist-details-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin: 14px 0 8px;
}

.playlist-details-text {
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    white-space: pre-wrap;
}

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

.playlist-details-list li {
    font-size: 12px;
    line-height: 1.45;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
}

.playlist-details-list li:last-child {
    border-bottom: none;
}

/* scrollbar */
.playlist::-webkit-scrollbar {
    width: 5px;
}

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

.playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2.5px;
    transition: background 0.2s ease;
}

.playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

.playlist-details-empty{
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  padding-top: 12px;
}

/* garante que o fim da lista nunca fica escondido por overlays/nav */
.playlist{
  padding-bottom: 110px; /* espaço de segurança (bottom-nav + respiro) */
}

.playlist-item-header{
  padding: 18px 28px;
  cursor: pointer;
  transition: all 0.24s ease;
  display: flex;
  align-items: flex-start; /* <<< era center */
  gap: 18px;
}

.playlist-item-title{
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
  letter-spacing: -0.015em;
  transition: color 0.24s ease;

  white-space: normal;     /* <<< */
  overflow: visible;       /* <<< */
  text-overflow: clip;     /* <<< */
  word-break: break-word;  /* <<< */
}

.playlist-item-artists{
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
  transition: color 0.24s ease;

  white-space: normal;     /* <<< */
  overflow: visible;       /* <<< */
  text-overflow: clip;     /* <<< */
  word-break: break-word;  /* <<< */
}

/* genre line (below artist) */
.playlist-item-genre{
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* tabs inside expanded details */
.playlist-tabs{
  display: flex;
  gap: 10px;
  margin: 14px 0 10px;
}

.playlist-tab{
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}

.playlist-tab:hover{
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.playlist-tab.active{
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255,255,255,.95);
}

.playlist-tab:disabled{
  opacity: .35;
  cursor: default;
  transform: none;
}

.playlist-tabpanel{
  display: none;
}

.playlist-tabpanel.active{
  display: block;
}

/* =========================
   Details panels: scroll after ~5 lines
========================= */

/* cada painel vira um box rolável */
.playlist-tabpanel{
  max-height: 390px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px; 
  -webkit-overflow-scrolling: touch;
}

/* mantém compatibilidade com teu .active */
.playlist-tabpanel.active{
  display: block;
}

/* scrollbar discreto dentro do painel */
.playlist-tabpanel::-webkit-scrollbar{
  width: 5px;
}
.playlist-tabpanel::-webkit-scrollbar-track{
  background: transparent;
}
.playlist-tabpanel::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.16);
  border-radius: 3px;
}
.playlist-tabpanel::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.26);
}

/* no mobile portrait dá um pouco mais de altura pra leitura */
@media (max-width: 900px) and (orientation: portrait){
  .playlist-tabpanel{
    max-height: 360px;
  }
}

.playlist-item-genre{
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

