/* ============================================
   PLAYLIST SECTION - CLEAN CSS
   ============================================ */

/* Layout */
.playlist-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.playlist-layout {
  display: grid;
  grid-template-columns: minmax(260px, 40%) 1fr;
  gap: 16px;
  height: 720px;
}

@media (max-width: 980px) {
  .playlist-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 640px) {
  .playlist-layout {
    height: auto;
  }
}

.playlist-list-wrap,
.playlist-detail-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Panels */
.playlist-list,
.playlist-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow-y: auto;
  transition: opacity .15s ease;
}

.playlist-detail.is-fading {
  opacity: 0;
}

/* ═══ Playlist Card ═══ */
.pl-card {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.pl-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.pl-card.is-active {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.05);
}

/* Title — max 2 lines */
.pl-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* Meta */
.pl-card__meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions row */
.pl-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 4px;
}

/* State badge */
.pl-card__state-wrap {
  position: relative;
}

.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: none;
}

.pl-badge--done {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

.pl-badge--done:hover {
  background: rgba(59, 130, 246, 0.2);
}

.pl-badge--ongoing {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.2);
}

.pl-badge--ongoing:hover {
  background: rgba(249, 115, 22, 0.2);
}

/* State menu */
.pl-card__state-menu {
  position: fixed;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 15, 25, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.pl-card__state-menu.is-hidden {
  display: none;
}

.pl-card__state-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.pl-card__state-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Icon buttons */
.pl-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pl-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.pl-icon-btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.playlist-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Empty State */
.playlist-empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Create Playlist */
.playlist-create {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

/* Compact search inside playlist */
.playlist-root .content-search-wrap {
  margin-bottom: 0;
}

.playlist-create input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 0.85rem;
  min-width: 0;
}

.playlist-create input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
}

.playlist-create .btn {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* ═══ Entry (Detail Panel) ═══ */
.playlist-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 80px;
}

.playlist-entry:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.playlist-entry.is-done {
  opacity: 0.6;
}

/* Thumbnail */
.playlist-entry-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a1040, #2d1b69);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
}

.playlist-entry-thumb span {
  font-family: var(--font-d);
  font-size: 1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
}

.playlist-entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Main Info */
.playlist-entry-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.playlist-entry-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.playlist-entry-title:hover {
  color: var(--primary);
}

.playlist-entry-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.playlist-entry-meta .genre-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 180, 0, 0.12);
  color: #ffb347;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Actions */
.playlist-entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.playlist-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.playlist-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Play button — gradient */
.playlist-entry-actions .playlist-btn:first-child {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none;
  color: #000;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.playlist-entry-actions .playlist-btn:first-child:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Delete button — red hover */
.playlist-btn--remove {
  color: rgba(255, 255, 255, 0.4);
  border-color: transparent;
  background: transparent;
}

.playlist-btn--remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 640px) {
  .playlist-entry {
    gap: 10px;
    padding: 10px;
    min-height: 72px;
  }

  .playlist-entry-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
  }

  .playlist-entry-title {
    font-size: 13px;
  }

  .playlist-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
}

/* Pagination inside playlist panels */
.playlist-list-wrap .account-pagination-wrap,
.playlist-detail-wrap .account-pagination-wrap {
  flex-shrink: 0;
  min-height: 0;
}

.playlist-list-wrap .account-pagination-wrap:empty,
.playlist-detail-wrap .account-pagination-wrap:empty {
  display: none;
}
