
:root {
  --vh: 1vh;


  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --primary: #38bdf8;
  --secondary: #94a3b8;
  --text-main: #f8fafc;
  --text-muted: #cbd5f5;
  --danger: #ef4444;

  --radius: 12px;
  --transition: 0.25s ease;
}

* {
    box-sizing: border-box;
}

/* --- SCROLLBARS (NEW STYLE) --- */

/* Hide outer page scrollbar */
html, body {
    scrollbar-width: none;          /* Firefox */
}
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Internal scroll areas only */
#sidebar,
#main-content,
#now-playing-list,
#song-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

/* WebKit scrollbars inside app panels */
#sidebar::-webkit-scrollbar,
#main-content::-webkit-scrollbar,
#now-playing-list::-webkit-scrollbar,
#song-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

/* Track: invisible */
#sidebar::-webkit-scrollbar-track,
#main-content::-webkit-scrollbar-track,
#now-playing-list::-webkit-scrollbar-track,
#song-list::-webkit-scrollbar-track {
    background: transparent;
}

/* Thumb */
#sidebar::-webkit-scrollbar-thumb,
#main-content::-webkit-scrollbar-thumb,
#now-playing-list::-webkit-scrollbar-thumb,
#song-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* On hover over the panel, thumb becomes clearer */
#sidebar:hover::-webkit-scrollbar-thumb,
#main-content:hover::-webkit-scrollbar-thumb,
#now-playing-list:hover::-webkit-scrollbar-thumb,
#song-list:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.75);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
}

/* --- BODY & LAYOUT --- */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

#player-container {
    display: flex;
    height: 100vh;
    padding-bottom: 160px;
    padding-top: 0px;
}



/* --- SIDEBAR --- */
#sidebar {
    position: fixed;
    top: 10px;
    bottom: 10px;
    left: 10px;

    width: 260px;
    padding: 20px 18px;
    margin: 0;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: white;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.85),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    height: auto;
}

#sidebar h2 {
    margin: 6px 0 18px;
    padding: 3px 18px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}




/* Visually hidden but accessible text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* Sidebar section button (Artists, Settings later) */
.sidebar-section-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;

  display: flex;
  align-items: center;
  gap: 10px;

  background: transparent;
  border: none;
  border-radius: 999px;

  color: #e5e7eb;
  font-size: 0.9rem;
  cursor: pointer;

  transition:
    background 0.18s ease,
    transform 0.08s ease,
    box-shadow 0.18s ease;
}

.sidebar-section-btn i {
  width: 20px;
  text-align: center;
  color: #9ca3af;
}

/* hover */
.sidebar-section-btn:hover {
  background: radial-gradient(circle at 0% 0%, #22c55e33, transparent 60%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.8);
}


#main-nav button,
#categories-list button {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 999px;
    transition:
        background-color 0.2s ease,
        transform 0.08s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}

#main-nav button:hover,
#categories-list button:hover{
    background: radial-gradient(circle at 0% 0%, #22c55e33, transparent 60%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.8);
}

#main-nav button i,
#categories-list button i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.95rem;
}


.active-filter {
    background: linear-gradient(135deg, #22c55e, #22d3ee) !important;
    color: #020617 !important;
    font-weight: 600;
    box-shadow: 0 0 0 1px #22c55eaa, 0 12px 28px rgba(16, 185, 129, 0.55);
}

.active-filter i {
    color: #020617 !important;
}


/* ================================
   FIXED MAIN HEADER (TOP BAR)
   ================================ */
#main-header-fixed {
    position: fixed;
    top: 10px;
    left: 290px;
    right: 10px;

    height: 64px;
    padding: 0 26px;

    display: flex;
    align-items: center;

    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
        radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.14), transparent 55%),
        rgba(15, 23, 42, 0.96);

    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.45);

    z-index: 500;
}

#top-header {
  position: fixed;
  top: 10px;
  left: 290px;
  right: 10px;
  height: 64px;

  z-index: 850;

  /* IMPORTANT: header is visually transparent */
  background: transparent;
  border: none;
  border-radius: 0;

  display: flex;
  align-items: center;
}

#main-header-row {
  padding: 0 26px;
}



#main-content {
  margin-top: 90px; /* height of header */
}

/* --- MAIN CONTENT --- */
#main-content {
  margin: 10px 10px 10px 290px;

  /* header space */
  padding: 48px 26px 20px;

  border-radius: 24px;
    width: calc(100vw - 310px);
    max-width: calc(100vw - 310px);
    min-width: 0;

    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
        radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.14), transparent 55%),
        rgba(15, 23, 42, 0.93);

    border: 1px solid rgba(148, 163, 184, 0.45);
    color: white;
    overflow-y: auto;
}



/* Header row with title + view toggle */
#main-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}




/* Title + actions (favorites clear icon) */
#title-and-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}




#search-toggle-btn {
    border: none;
    background: transparent;
    cursor: pointer;

    width: 36px;
    height: 36px;
    border-radius: 999px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #9ca3af;
    font-size: 0.95rem;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.12s ease;
}

#search-toggle-btn:hover {
    background: rgba(31, 41, 55, 0.8);
    color: #e5e7eb;
    transform: translateY(-1px);
}

/* Inline header search (hidden by default) */
#main-header-row .header-search {
    display: none;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 360px;
}


#main-header-row .header-search input {
    width: 100%;
    padding: 7px 14px;

    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;

    font-size: 0.85rem;
    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

#main-header-row .header-search input:focus {
    border-color: #22c55e;
    box-shadow:
        0 0 0 1px rgba(34, 197, 94, 0.7),
        0 12px 30px rgba(15, 23, 42, 0.9);
}

/* === Search open state === */
#main-header-row.search-open .header-search {
    display: flex;
}

#main-header-row.search-open #search-toggle-btn {
    display: none;
}


#current-view-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
}
#current-view-title {
    line-height: 1;
    padding-top: 8px;
}


/* Content view toggle */
#content-view-toggle {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
    flex-shrink: 0;

}

.main-view-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.main-view-btn:hover {
    color: #e5e7eb;
}

.active-main-view {
    background: linear-gradient(135deg, #22c55e, #22d3ee);
    color: #020617;
}


/* --- NOW PLAYING QUEUE --- */
#now-playing-panel {
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
}

#now-playing-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

#now-playing-header h3 {
    margin: 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
}

#now-playing-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
}

#now-playing-list {
    list-style: none;
    margin: 0;
    padding: 2px 0 0;   /* 👈 ADD THIS LINE */
    display: flex;
    gap: 10px;
    overflow-x: auto;
}


/* Hide queue header text when queue has items */
#now-playing-panel.has-items #now-playing-header {
    
    display: none;
}


.queue-item {
    min-width: 150px;
    max-width: 200px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(55, 65, 81, 0.9);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition:
        background 0.15s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.queue-item:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 1);
}

.queue-item-main {
    max-width: 140px;
    overflow: hidden;
}

.queue-song-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-song-artist {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-remove-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 999px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.1s ease;
}

.queue-remove-btn i {
    font-size: 0.8rem;
}

.queue-remove-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    transform: translateY(-1px);
}

.queue-empty {
    font-size: 0.85rem;
    color: #6b7280;
    padding: 4px 0;
}

/* --- SONG/ALBUM/ARTIST CARD GRID --- */
#song-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
}


/* Ensure single song in any filtered view stays card-sized */
#song-list .song-item:only-child {
    max-width: 220px;
    justify-self: start;
}

/* Tint when searching */
#song-list.search-active .song-item {
    border-color: rgba(56, 189, 248, 0.7);
    background:
        radial-gradient(circle at top, rgba(56, 189, 248, 0.17), transparent 60%),
        rgba(15, 23, 42, 0.97);
}

/* Single search result layout */
#song-list.search-active .song-item:only-child,
#song-list.search-active .search-empty-state:only-child {
    max-width: 220px;
    justify-self: start;
}

.song-item {
    --accent-color: #22c55e;
    --accent-color-soft: rgba(34, 197, 94, 0.55);

    position: relative;
    padding: 0;
    border-radius: 18px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(31, 41, 55, 0.85);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
    overflow: hidden;
    transition:
        transform 0.12s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.song-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 1);
    border-color: rgba(55, 65, 81, 0.95);
    background:
        radial-gradient(circle at top left, var(--accent-color-soft), transparent 55%),
        rgba(15, 23, 42, 0.98);
}

/* animated glow for currently playing card */
@keyframes cardGlow {
    0% {
        box-shadow:
            0 0 0 1px var(--accent-color),
            0 16px 32px rgba(15, 23, 42, 0.9);
    }
    100% {
        box-shadow:
            0 0 0 2px var(--accent-color),
            0 24px 60px var(--accent-color-soft);
    }
}

.song-item.playing {
    border-color: var(--accent-color);
    animation: cardGlow 3s ease-in-out infinite alternate;
}

.album-card-inner {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 8px;
    position: relative;
}

/* Album cover wrapper */
.album-cover-wrapper {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.album-cover {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
    transition: transform 0.18s ease, filter 0.18s ease;
}

/* Overlay with play icon */
.album-cover-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 35%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.75));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;

}

.album-cover-play-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 12px 25px rgba(34, 197, 94, 0.8);
    transform: translateY(4px);
    transition: transform 0.16s ease, box-shadow 0.2s ease;
}

.album-cover-play-icon i {
    color: #020617;
    font-size: 1.1rem;
}

/* Hover */
.song-item:hover .album-cover-overlay {
    opacity: 1;
    transform: translateY(0);
}

.song-item:hover .album-cover {
    transform: scale(1.03);
    filter: brightness(1.03);
}

/* Text under cover */
.song-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.song-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Album / Artist view tweaks */
.album-view-card .album-cover-play-icon i {
    font-size: 1rem;
}

.artist-view-card .album-cover-wrapper {
    border-radius: 14px;
}

/* Favorite heart */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 7px;
    color: #e5e7eb;
    transition:
        transform 0.08s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
    z-index: 2;
}

/* Favorite state animation */
@keyframes favoriteGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.0);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 0 18px rgba(248, 113, 113, 0.75);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.0);
    }
}

.favorite-btn.is-favorite {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.95);
    animation: favoriteGlow 1.2s ease-in-out;
}

.favorite-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.9);
    border-color: rgba(248, 113, 113, 0.9);
}

.song-item.playing .favorite-btn {
    background: rgba(34, 197, 94, 0.15);
}

/* Options button */
.options-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 7px;
    color: #e5e7eb;
    transition:
        transform 0.08s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
    z-index: 2;
}

.options-btn i {
    pointer-events: none;
}

.options-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(148, 163, 184, 0.9);
    border-color: rgba(148, 163, 184, 0.9);
}

/* Options menu */
.options-menu {
    position: absolute;
    bottom: 10px;
    right: 46px;
    padding: 4px 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.9);
    display: flex;
    flex-direction: row;
    gap: 4px;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 3;
}

.song-item.show-options .options-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.option-btn {
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    min-width: 26px;
    height: 26px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.option-btn i {
    font-size: 0.85rem;
}

.option-btn:hover {
    background: rgba(31, 41, 55, 1);
    color: #f9fafb;
    transform: translateY(-1px);
}

/* Artist placeholder cover */
.artist-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background:
        radial-gradient(circle at 30% 0, #4f46e5, #1d4ed8),
        radial-gradient(circle at bottom, #0f172a, #020617);
}

/* SEARCH EMPTY STATE */
.search-empty-state {
    border-radius: 18px;
    padding: 12px 10px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px dashed rgba(75, 85, 99, 0.9);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    text-align: center;
}



.favorites-empty-subtitle span {
    color: #f97316;
    font-weight: 500;
}

.search-empty-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 0%, #1f2937, #020617);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.9);
    flex-shrink: 0;
}

.search-empty-icon i {
    color: #9ca3af;
    font-size: 0.95rem;
}

.search-empty-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-empty-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
}

.search-empty-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
}

.search-empty-subtitle span {
    color: #fbbf24;
    font-weight: 500;
}

/* --- BOTTOM MUSIC PLAYER --- */
#bottom-player-container {
    position: fixed;
    bottom: 5px;
    left: 290px;
    right: 10px;
    width: auto;

    display: flex;
    gap: 10px;
    z-index: 900;
}

/* MAIN MUSIC PLAYER */
#music-player {
    position: fixed;
    bottom: 5px;
    left: 290px;
    right: 10px;
    width: auto;

    height: 92px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    box-shadow:
        0 28px 60px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1);
    z-index: 900;
}




/* PROGRESS + CONTROLS + VOLUME row */
#progress-area {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
    gap: 6px;
}

#current-time,
#duration {
    font-size: 0.75rem;
    width: 40px;
    text-align: center;
    color: #9ca3af;
}

/* CONTROLS + VOLUME row */
#controls-and-volume {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding-inline: 4px;
}

/* LEFT: volume */
#volume-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 140px;
    margin-right: auto;
}
/* ===============================
   MODERN VOLUME ICON (KEEP BAR)
   =============================== */

#volume-icon {
  margin-right: 8px;
  font-size: 14px;
  color: #22c55e;

  width: 34px;
  height: 34px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: radial-gradient(circle at 30% 0%, #1e293b, #020617);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 6px 14px rgba(34, 197, 94, 0.4);
}



/* --- MODERN PLAYER CONTROLS --- */
#controls {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1);
    transition: box-shadow 0.4s ease, background 0.3s ease;
}

/* animated glow when music is playing */
@keyframes controlsGlow {
    0% {
        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.9),
            0 0 0 1px rgba(15, 23, 42, 1);
    }
    50% {
        box-shadow:
            0 20px 45px rgba(34, 197, 94, 0.7),
            0 0 0 1px rgba(56, 189, 248, 0.7);
    }
    100% {
        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.9),
            0 0 0 1px rgba(15, 23, 42, 1);
    }
}

#controls.controls-playing {
    animation: controlsGlow 3s ease-in-out infinite;
}

/* base style for all control buttons */
#controls button {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    outline: none;
    background: radial-gradient(circle at 30% 0%, #0f172a, #020617);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0;
    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.9);
    transition:
        transform 0.12s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        opacity 0.12s ease,
        filter 0.18s ease;
}

#controls button::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
}

/* Icons */
#shuffle-btn::before {
    content: "\f074";
}

#prev-btn::before {
    content: "\f048";
}

/* ===================================
   PLAY / PAUSE — BRAND CONSISTENT
   =================================== */
#play-pause-btn::before {
  content: "\f04b";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 18px;

  color: #22c55e;

  /* contrast safety */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(34, 197, 94, 0.85);
}





#next-btn::before {
    content: "\f051";
}

#repeat-btn::before {
    content: "\f363";
}

/* big center play button */
#play-pause-btn {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 14px 30px rgba(34, 197, 94, 0.75);
}

/* when playing, show pause icon */
#play-pause-btn.is-playing::before {
    content: "\f04c";
}

/* hover / tap effects */
#controls button:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.95);
    background: radial-gradient(circle at 10% 0%, #111827, #020617);
    filter: brightness(1.1);
}

#play-pause-btn:hover {
    background: radial-gradient(circle at 30% 0%, #dcfce7, #16a34a);
}

/* subtle wiggle for prev/next when active */
@keyframes nudgeLeft {
    0% { transform: translateX(0); }
    50% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

@keyframes nudgeRight {
    0% { transform: translateX(0); }
    50% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

#prev-btn:active {
    animation: nudgeLeft 0.16s ease;
}

#next-btn:active {
    animation: nudgeRight 0.16s ease;
}

/* pulsing play button while music is playing */
/* ===================================
   SMOOTH PLAYING PULSE (BREATHING)
   =================================== */
@keyframes playPulseSmooth {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(15, 23, 42, 1),
      0 10px 24px rgba(34, 197, 94, 0.35);
  }
  50% {
    transform: scale(1.025); /* very subtle */
    box-shadow:
      0 0 0 2px rgba(15, 23, 42, 1),
      0 14px 32px rgba(34, 197, 94, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(15, 23, 42, 1),
      0 10p
  }
}

#play-pause-btn.playing-btn {
  animation: playPulseSmooth 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}


/* highlight shuffle/repeat when active */
.control-active {
    color: #facc15 !important;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.7));
}

/* Repeat ONE indicator */
#repeat-btn.repeat-one::after {
    content: "1";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-color, #22d3ee);
}


/* tiny spin when toggled */
@keyframes controlSpin {
    0% { transform: rotate(0deg); }
    70% { transform: rotate(18deg); }
    100% { transform: rotate(0deg); }
}

#shuffle-btn.control-active,
#repeat-btn.control-active {
    animation: controlSpin 0.35s ease-out;
}

/* RIGHT: mini cover + song info */
#current-song-info {
    font-size: 0.95rem;
    text-align: right;
    color: white;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: auto;
}

#mini-cover {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.7);
}

#mini-cover.hidden {
    display: none;
}

#current-song-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    overflow: hidden;
}

#player-title {
    font-weight: 600;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#player-artist {
    font-size: 0.85rem;
    color: #9ca3af;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Range inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(90deg, #4b5563, #6b7280);
    border-radius: 999px;
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: linear-gradient(90deg, #4b5563, #6b7280);
    border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    margin-top: -5px;
    box-shadow:
        0 0 0 3px rgba(15, 23, 42, 1),
        0 0 12px rgba(34, 197, 94, 0.8);
    transition:
        background 0.18s ease,
        transform 0.1s ease,
        box-shadow 0.18s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow:
        0 0 0 3px rgba(15, 23, 42, 1),
        0 0 18px rgba(34, 197, 94, 1);
}

input[type="range"]::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
}

#audio-element {
    display: none;
}


/* --- MOBILE MENU --- */
#mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 4000;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    color: #020617;
    border: none;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 18px 35px rgba(31, 41, 55, 0.9);
}




    #open-player-icon {
        bottom: 150px;
        right: 20px;
    }


/* --- LIGHT THEME OVERRIDES --- */
body[data-theme="light"] {
    background:
        radial-gradient(circle at 0% 0%, #93c5fd 0, transparent 55%),
        radial-gradient(circle at 100% 0%, #fed7e2 0, transparent 55%),
        #f3f4f6;
    color: #111827;
}

body[data-theme="light"] #sidebar {
    background: #ffffffcc;
    color: #111827;
    border-color: rgba(148, 163, 184, 0.7);
}

body[data-theme="light"] #main-content {
    background: #ffffffcc;
    border-color: rgba(148, 163, 184, 0.7);
}

body[data-theme="light"] #now-playing-panel {
    background: #f9fafb;
    border-color: rgba(209, 213, 219, 1);
}

body[data-theme="light"] .queue-item {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 1);
}

body[data-theme="light"] .song-item {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 1);
    box-shadow: 0 12px 24px rgba(148, 163, 184, 0.4);
}

body[data-theme="light"] .search-empty-state {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 1);
}

body[data-theme="light"] .song-title {
    color: #111827;
}

body[data-theme="light"] .song-artist {
    color: #6b7280;
}

body[data-theme="light"] #music-player {
    background: linear-gradient(135deg, #ffffff, #e5e7eb);
    border-color: rgba(148, 163, 184, 0.9);
}

body[data-theme="light"] #current-song-info {
    color: #111827;
}

body[data-theme="light"] #player-artist {
    color: #6b7280;
}

/* --- VIEW ALL CATEGORIES BUTTON --- */
.view-all-btn {
    width: 100%;
    margin-bottom: 6px;
    margin-top: 4px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease;
}

.view-all-btn i {
    font-size: 0.9rem;
    color: #9ca3af;
}

.view-all-btn:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(34, 197, 94, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

/* --- CATEGORY MODAL --- */
#category-modal {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
    z-index: 950;
}

#category-modal.open {
    opacity: 1;
    pointer-events: auto;
}
/* --- ARTIST MODAL --- */
#artist-modal {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
    z-index: 960;
}

#artist-modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* --- ALBUM MODAL --- */

#album-modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,.92), rgba(15,23,42,.98));
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 960;
}

#album-modal.open {
  opacity: 1;
  pointer-events: auto;
}


/* grid */
.artist-modal-grid {
    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));

    gap: 22px;
    margin-top: 20px;

    width: 100%;
    padding: 10px;
}



.artist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.artist-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background:
      radial-gradient(circle at 30% 0%, #22c55e, #0f172a);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
      0 0 0 2px rgba(15,23,42,1),
      0 10px 26px rgba(34,197,94,0.6);
}

.artist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.artist-name {
    font-size: 0.75rem;
    text-align: center;
    color: #e5e7eb;
}


/* --- SETTINGS MODAL --- */
#settings-modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,.92), rgba(15,23,42,.98));
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 970;
}

#settings-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal-content {
  width: min(420px, 92%);
  border-radius: 22px;
  background: #020617f3;
  border: 1px solid rgba(148,163,184,.8);
  padding: 18px;
  position: relative;
}

.settings-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.settings-item {
  border: none;
  background: rgba(15,23,42,.9);
  color: #e5e7eb;
  padding: 10px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.settings-item:hover {
  background: rgba(31,41,55,1);
}

#category-modal-content {
    width: min(520px, 94%);
    max-height: 80vh;
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 55%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.18), transparent 55%),
        #020617f3;
    border: 1px solid rgba(148, 163, 184, 0.8);
    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1);
    padding: 16px 18px 14px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#artist-modal-content {
    width: min(900px, 96%);   /* wider */
    max-height: 85vh;
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 55%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.18), transparent 55%),
        #020617f3;

    border: 1px solid rgba(148, 163, 184, 0.8);
    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1);

    padding: 18px 20px 16px;
    position: relative;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}
#artist-modal-body {
    overflow-y: auto;
    padding: 10px 4px;
}


/* shared close button style */
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    color: #e5e7eb;
    font-size: 1.1rem;
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease;
}

.modal-close-btn:hover {
    background: rgba(31, 41, 55, 1);
    color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.9);
}

/* body scroll area */
#category-modal-body {
    overflow-y: auto;
    padding: 6px 2px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.9) transparent;
}

#category-modal-body::-webkit-scrollbar {
    width: 8px;
}

#category-modal-body::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
    margin: 4px 0;
}

#category-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(148, 163, 184, 0.7),
        rgba(75, 85, 99, 0.95)
    );
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}

#category-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(209, 213, 219, 0.9),
        rgba(107, 114, 128, 1)
    );
}

.category-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 4px;
    padding-bottom: 6px;
}

.category-modal-btn {
    border: 1px solid rgba(55, 65, 81, 0.95);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
    border-radius: 16px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition:
        transform 0.08s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.category-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.95);
    border-color: rgba(34, 197, 94, 0.9);
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.18), transparent 60%),
        rgba(15, 23, 42, 0.98);
}

.category-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 10px 26px rgba(34, 197, 94, 0.8);
    flex-shrink: 0;
}

.category-modal-icon i {
    color: #020617;
    font-size: 0.9rem;
}

.category-modal-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.category-modal-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.category-modal-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

.category-modal-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.category-modal-selected-title {
    font-size: 0.9rem;
    color: #e5e7eb;
}

.category-modal-back-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.8rem;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.08s ease;
}

.category-modal-back-btn i {
    font-size: 0.85rem;
}

.category-modal-back-btn:hover {
    color: #e5e7eb;
    transform: translateX(-1px);
}

.category-modal-song-list {
    list-style: none;
    margin: 0;
    padding: 2px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-modal-song-item {
    border-radius: 12px;
    border: 1px solid rgba(55, 65, 81, 0.95);
    background: rgba(15, 23, 42, 0.97);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.category-modal-song-item:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 197, 94, 0.9);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.95);
}

.category-modal-song-main {
    display: flex;
    flex-direction: column;
    max-width: 260px;
    overflow: hidden;
}

.category-modal-song-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-modal-song-artist {
    font-size: 0.78rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-modal-play-btn {
    border: none;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 10px 22px rgba(34, 197, 94, 0.8);
    transition:
        transform 0.1s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.category-modal-play-btn i {
    color: #020617;
    font-size: 0.85rem;
}

.category-modal-play-btn:hover {
    transform: translateY(-1px) scale(1.04);
    filter: brightness(1.05);
}

.category-modal-empty {
    font-size: 0.85rem;
    color: #9ca3af;
    padding: 10px 2px 4px;
    text-align: center;
}

body[data-theme="light"] #category-modal {
    background:
        radial-gradient(circle at top, rgba(148, 163, 184, 0.6), rgba(15, 23, 42, 0.4));
}

body[data-theme="light"] #category-modal-content {
    background: #f9fafb;
    border-color: rgba(148, 163, 184, 0.9);
}

body[data-theme="light"] .category-modal-song-item {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 1);
}

body[data-theme="light"] .category-modal-btn {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 1);
}

/* --- CONFIRMATION MODAL (Clear Favorites)--- */
#confirm-modal {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
    z-index: 980;
}

#confirm-modal.open {
    opacity: 1;
    pointer-events: auto;
}

#confirm-modal-content {
    width: min(360px, 90%);
    padding: 18px 18px 14px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(248, 113, 113, 0.22), transparent 60%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.18), transparent 60%),
        #020617f5;
    border: 1px solid rgba(148, 163, 184, 0.9);
    box-shadow:
        0 26px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(15, 23, 42, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: confirmPop 0.2s ease-out;
}

@keyframes confirmPop {
    0%   { transform: scale(0.9) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0);     opacity: 1; }
}

#confirm-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fecaca;
}

#confirm-modal-message {
    margin: 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

#confirm-modal-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#confirm-modal-cancel {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(55, 65, 81, 1);
    transition:
        background 0.18s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease;
}

#confirm-modal-cancel:hover {
    background: rgba(31, 41, 55, 1);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
}

#confirm-modal-ok {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;

    background: radial-gradient(circle at 30% 0%, #fecaca, #ef4444);
    color: #020617;
    border: 1px solid rgba(248, 113, 113, 0.95);

    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 10px 22px rgba(248, 113, 113, 0.8);
    transition:
        transform 0.12s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

#confirm-modal-ok i {
    font-size: 0.85rem;
}

#confirm-modal-ok:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 16px 32px rgba(248, 113, 113, 0.95);
    filter: brightness(1.05);
}


body[data-theme="light"] #confirm-modal {
    background:
        radial-gradient(circle at top, rgba(148, 163, 184, 0.6), rgba(15, 23, 42, 0.3));
}

body[data-theme="light"] #confirm-modal-content {
    background: #f9fafb;
    border-color: rgba(148, 163, 184, 0.9);
}

body[data-theme="light"] #confirm-modal-message {
    color: #6b7280;
}

/* --- FULL-SCREEN PLAYER (REFRESHED MODERN LOOK, DISC-ONLY) --- */

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

#open-player-icon {
    position: fixed;
    bottom: 140px;
    right: 30px;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    color: #020617;
    border: none;
    padding: 0.5rem;
    border-radius: 999px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 1),
        0 20px 40px rgba(22, 163, 74, 0.7);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease,
        opacity 0.12s ease;
    pointer-events: auto;
    opacity: 1;
}

#open-player-icon:hover {
    transform: translateY(-2px) scale(1.05);
    filter: brightness(1.05);
}

#animated-player-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(34,197,94,0.12), transparent 55%),
    rgba(2,6,23,0.95);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
  padding: 24px;
}

#animated-player-overlay.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  animation: fpFadeIn 0.35s ease-out;
}

#close-player-btn {
  position: absolute;
  top: 22px;
  right: 28px;
  background: rgba(15,23,42,0.96);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  color: #e5e7eb;
  font-size: 1.1rem;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 1010;
}


#full-player-content {
  width: min(980px, 96%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

/* hero card */
#full-player-layout {
  width: 100%;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(148,163,184,0.08);
  padding: 18px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: center;
  box-shadow: 0 30px 80px rgba(2,6,23,0.8);
  overflow: hidden;
}

/* left panel: disc + title */
#full-player-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px;
}

/* disc container (keeps spinning effect) */
#full-player-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  position: relative;
  background: radial-gradient(circle at center, rgba(255,255,255,0.02), transparent 35%);
  border: 1px solid rgba(148,163,184,0.06);
  box-shadow: 0 20px 60px rgba(2,6,23,0.85), inset 0 6px 18px rgba(255,255,255,0.02);
}

/* subtle glow behind disc */
#full-player-glow {
  position: absolute;
  inset: -18px;
  border-radius: 999px;
  filter: blur(26px);
  opacity: 0.18;
  background: radial-gradient(circle at 30% 10%, rgba(34,197,94,0.18), rgba(59,130,246,0.06));
  pointer-events: none;
}

/* inner disc (visual styling) */
#spinning-disc {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(2,6,23,0.95) 0 24%, rgba(6,10,20,0.6) 24% 48%, transparent 48%),
    conic-gradient(from 0deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  box-shadow: 0 30px 80px rgba(0,0,0,0.85), inset 0 8px 22px rgba(255,255,255,0.02);
  transition: transform 0.45s ease;
  flex-shrink: 0;
}

/* album art inside disc */
#disc-center {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 8px solid rgba(2,6,23,0.88);
  box-shadow: 0 18px 46px rgba(2,6,23,0.8);
  background: #020617;
}

#disc-center img#full-player-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  transition: transform 0.45s ease, filter 0.3s ease;
}

#spinning-disc.is-playing,
.is-playing #spinning-disc {
  animation: spin 8s linear infinite;
  transform-origin: 50% 50%;
}

#full-player-meta {
  text-align: center;
  padding: 2px 8px;
}

#animated-title {
  font-size: 2.25rem;
  margin: 0;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

#animated-artist {
  font-size: 1.05rem;
  margin: 6px 0 0;
  color: #b6c5ff;
}

/* right panel: tabs + playlist */
#full-player-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 8px;
  min-height: 360px;
  max-height: 72vh;
  overflow: hidden;
}

/* ---------- NEW: full-playlist-box ----------
   dedicated box inside the right panel that holds:
     - single-line tabs at top (#full-tabs-row)
     - #full-playlist-container (the scrollable UL container)
   This ensures the playlist is visually above the controls and easy to find.
*/
.full-playlist-box {
    margin: 6px 6px 4px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(2,6,23,0.82);
    border: 1px solid rgba(148,163,184,0.06);
    max-height: 58vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ensure the full-playlist box visually appears above the controls in the right panel */
.full-playlist-box {
    order: -1;          /* place playlist before controls when parent is a flex container */
}

/* Ensure controls are after the playlist */
#full-player-controls-container {
    order: 1;
}


/* Single-line tabs: keeps tabs on one row, allow horizontal scroll if overflow */
#full-tabs-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;             /* prevent wrapping, enforce one line */
    overflow-x: auto;             /* allow horizontal scroll when many tabs */
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

/* tab button: prevent shrinking so they remain pill-shaped */
.full-tab-btn {
    flex: 0 0 auto;
    border: none;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15,23,42,0.9);
    color: #cbd5ff;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.18s ease;
    white-space: nowrap;          /* keep label on one line */
}

.full-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(2,6,23,0.7);
}

.full-tab-btn.active-full-tab {
    background: linear-gradient(135deg, #22c55e, #22d3ee);
    color: #020617;
    box-shadow: 0 10px 30px rgba(34,197,94,0.18);
}

/* playlist container sits inside the box and scrolls */
#full-playlist-container {
    overflow-y: auto;
    padding-right: 6px;
    border-radius: 12px;
    margin-top: 2px;
    max-height: 38vh;              /* keeps controls visible below the box */
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,0.7) transparent;
    background: transparent;
}

/* WebKit scrollbar for full playlist */
#full-playlist-container::-webkit-scrollbar { width: 8px; }
#full-playlist-container::-webkit-scrollbar-track { background: transparent; }
#full-playlist-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(148,163,184,0.7), rgba(75,85,99,0.95));
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(2,6,23,0.85);
}
#full-playlist-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(209,213,219,0.9), rgba(107,114,128,1));
}

/* full-playlist uses modal list styling */
#full-playlist {
    list-style: none;
    margin: 0;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* full-playlist rows style */
.full-playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(2,6,23,0.82);
    border: 1px solid rgba(148,163,184,0.06);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.full-playlist-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(2,6,23,0.85);
}

.full-playlist-item.playing {
    background: linear-gradient(90deg, rgba(34,197,94,0.06), rgba(59,130,246,0.04));
    border-color: rgba(34,197,94,0.12);
}

/* fpi-main text */
.fpi-main {
    overflow: hidden;
    flex: 1 1 auto;
}

.fpi-title {
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fpi-artist {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* play button on each row */
.fpi-play-btn {
    border: none;
    background: radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #020617;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(34,197,94,0.14);
}






/* Responsive: stack on small screens */
@media (min-width: 769px) and (max-width: 900px) {

  #full-player-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  #full-player-circle {
    width: 340px;
    height: 340px;
  }

  #spinning-disc { width: 260px; height: 260px; }

  /* reduce playlist height on smaller viewports */
  .full-playlist-box { max-height: 46vh; }
  #full-playlist-container { max-height: 28vh; }
}

/* --- FULL PLAYER CONTROLS (PROGRESS + VOLUME + TRANSPORT) --- */

#full-player-controls-container {
    width: 100%;
    border-radius: 24px;
    padding: 14px 18px 12px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.75);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 1);
}

/* shrink/center controls when right panel contains playlist box */
#full-progress-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    gap: 10px;
    font-size: 0.85rem;
    color: #9ca3af;
}

#full-progress-bar {
    flex-grow: 1;
}

/* Bottom row: volume + transport */
#full-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* Volume control in full player */
#full-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

#full-volume-icon {
    font-size: 1rem;
    color: #e5e7eb;
}

#full-volume-bar {
    width: 160px;
}

/* Full-screen transport controls */
#full-controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

#full-controls button {
    background: transparent;
    border: none;
    color: #22c55e;
    padding: 8px 16px;
    margin: 0 8px;
    font-size: 2em;
    cursor: pointer;
    transition:
        color 0.18s ease,
        transform 0.1s ease,
        text-shadow 0.2s ease;
}

#full-controls button:hover {
    color: #f9fafb;
    transform: translateY(-1px) scale(1.03);
    text-shadow: 0 0 22px rgba(34, 197, 94, 0.9);
}


/* FIX FULL PLAYER VOLUME ICON */
#full-volume-icon {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 16px;
  color: #22c55e;
}



/* Small performance/motion preferences */
@media (prefers-reduced-motion: reduce) {
    #full-playlist .category-modal-song-item,
    #full-playlist .fpi-play-btn { transition: none; transform: none !important; }
    #spinning-disc.is-playing { animation: none !important; }
}

/* Accessibility: ensure right-panel playlist scroll thumb matches other areas */
.full-playlist-box::-webkit-scrollbar { width: 8px; }
.full-playlist-box::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(148,163,184,0.7), rgba(75,85,99,0.95));
    border-radius: 999px;
}

/* If user prefers reduced motion, stop item hover wiggles & disc spin */
@media (prefers-reduced-motion: reduce) {
    spinning-disc.is-playing { animation: none !important; }
}

#animated-player-overlay {
  backdrop-filter: blur(14px);
  background: rgba(0,0,0,0.85);
}

#full-player-layout {
  max-width: 1400px;
  margin: auto;
  padding: 24px;
}

.full-playlist-box {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 12px;
}

.full-playlist-item.playing {
  background: rgba(29,185,84,0.15);
}




/* === FULL PLAYER CATEGORY SLIDER (SAFE) === */
#full-tabs-row {
  overflow-x: hidden;
}

.full-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.full-tabs-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #020617, #1e293b);
  color: #22c55e;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

.full-tabs-arrow:hover {
  transform: scale(1.08);
}

/* === FIX: MAKE CATEGORY ARROWS VISIBLE === */
.full-tabs-wrapper {
  position: relative;
}

.full-tabs-arrow {
  z-index: 50;
  opacity: 0.9;
}

.full-tabs-arrow.left {
  margin-right: 4px;
}

.full-tabs-arrow.right {
  margin-left: 4px;
}



@keyframes fpFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

#full-player-circle {
  transition: transform 0.4s ease;
}

#full-player-circle:hover {
  transform: scale(1.03);
}

/* === SONG TITLE UNDER COVER (SMALLER & CLEANER) === */
#animated-title {
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 10px;
  text-align: center;
}

#animated-artist {
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}
/* =====================================================
   CLEAN MOBILE LAYOUT — OPTION A (SAFE & ISOLATED)
   ===================================================== */
@media (max-width: 768px) {

  /* ---------- BASE ---------- */


  #player-container {
    flex-direction: column;
    padding: 0;
  }

  /* ---------- SIDEBAR ---------- */
  #sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 82vw;
    max-width: 300px;
    height: 100dvh;          /* dynamic viewport height */
    overflow: hidden;       /* prevent outer scroll */
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    border-radius: 0 18px 18px 0;
    overscroll-behavior: contain;
  }



  #sidebar.open {
    transform: translateX(0);
  }

    #sidebar .brand-symbol {
        height: 32px;
  }

    #sidebar .brand-text {
        font-size: 1.6rem;
  }



  #mobile-menu-toggle {
    display: block;
  }

  /* ---------- MAIN CONTENT ---------- */
  #main-content {
    margin: 0;
    width: 100vw;
    max-width: 100vw;
    padding: 70px 12px 170px;
  }

  /* ---------- SONG GRID ---------- */
  #song-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* ---------- BOTTOM PLAYER ---------- */
  #music-player {
    left: 50%;
    right: auto;
    bottom: 8px;
    transform: translateX(-50%);
    width: 94vw;
    height: auto;
    padding: 10px;
    border-radius: 22px;
  }

  /* hide desktop-only stuff */
  #volume-control,
  #current-song-info,
  #mini-cover {
    display: none !important;
  }

  /* ---------- CONTROLS ---------- */
  #controls-and-volume {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #controls {
    position: static;
    transform: none;
    margin: 0;
  }

  /* ---------- PROGRESS ---------- */
  #progress-area {
    margin-bottom: 6px;
  }
}
/* =====================================================
   MOBILE: HIDE FULL PLAYER PLAYLIST (SAFE)
   ===================================================== */
@media (max-width: 768px) {

  /* Hide playlist box completely */
  .full-playlist-box {
    display: none !important;
  }

  /* Hide playlist container & list (extra safety) */
  #full-playlist-container,
  #full-playlist {
    display: none !important;
  }

  /* Hide category tabs row */
  #full-tabs-row,
  .full-tabs-wrapper,
  .full-tab-btn {
    display: none !important;
  }

  /* Let controls take full width */
  #full-player-controls-container {
    margin-top: 0;
  }

}




/* =========================================
   HIDE MOBILE MENU ICON WHEN FULL PLAYER OPEN
   ========================================= */
@media (max-width: 768px) {
  body.full-player-open #mobile-menu-toggle {
    display: none !important;
  }
}

/* =====================================================
   FINAL MOBILE FULL PLAYER (DISC + CONTROLS FIX)
   ===================================================== */
@media (max-width: 768px) {

  /* Layout becomes column */
  #full-player-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* LEFT SIDE — DISC */
  #full-player-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #full-player-circle {
    width: min(80vw, 280px);
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
  }

  #spinning-disc {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
  }

  #disc-center {
    width: 76%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
  }

  #disc-center img,
  #full-player-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  /* META TEXT */
  #full-player-meta {
    text-align: center;
  }

  /* CONTROLS */
  #full-player-controls-container {
    width: 92vw;
    max-width: 360px;
    margin: 10px auto 0;
    padding: 12px 14px;
  }

  #full-progress-area {
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
  }

  #full-bottom-row {
    justify-content: center;
    gap: 20px;
  }

  /* Remove volume completely */
  #full-volume-control {
    display: none !important;
  }
}
/* =====================================================
   MOBILE SIDEBAR BACKDROP BLUR & DIM
   ===================================================== */
@media (max-width: 768px) {


    #sidebar {
    z-index: 999;
  }

  /* THIS is the key fix */
  #sidebar.open ~ #mobile-overlay,
  body.sidebar-open #mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }


}
/* Hide full player icon when sidebar is open (mobile) */
@media (max-width: 768px) {
  body.sidebar-open #open-player-icon {
    display: none !important;
  }
}

/* ===============================
   MOBILE SIDEBAR BLUR OVERLAY
   =============================== */

#mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 998;
}

/* Show overlay ONLY when sidebar is open (mobile) */
@media (max-width: 768px) {
    body.sidebar-open #mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

/* =========================================
   MOBILE SIDEBAR BLUR — CORRECT TARGETING
   ========================================= */
@media (max-width: 768px) {

  /* Blur ONLY main content (not sidebar) */
  body.sidebar-open #main-content {
    filter: blur(6px);
    pointer-events: none;
    transition: filter 0.25s ease;
  }

  /* Keep sidebar sharp and clickable */
  #sidebar {
    filter: none !important;
    pointer-events: auto;
    z-index: 1002;
  }

  /* Keep menu icon sharp */
  #mobile-menu-toggle {
    filter: none !important;
    z-index: 1003;
  }

  /* Optional dark dim layer */
  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1001;
  }
}

/* =====================================================
   🔒 FINAL MOBILE SAFETY PATCH (DO NOT EDIT ABOVE)
   ===================================================== */
@media (max-width: 768px) {

  /* ---------- SIDEBAR BLUR (FIXED) ---------- */
body.sidebar-open #main-content {
  filter: blur(6px);
  pointer-events: none;
}


  body.sidebar-open #sidebar,
  body.sidebar-open #mobile-menu-toggle {
    filter: none !important;
    pointer-events: auto;
    z-index: 3000;
  }

  body.sidebar-open #open-player-icon {
    display: none !important;
  }

  /* ---------- FULL PLAYER ICON ---------- */
  body.full-player-open #mobile-menu-toggle {
    display: none !important;
  }

  /* ---------- FULL PLAYER LAYOUT ---------- */
  #full-player-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px;
  }

  #full-player-left {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  /* ---------- DISC PERFECT CIRCLE ---------- */
  #full-player-circle {
    width: min(80vw, 280px) !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
  }

  #spinning-disc {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
  }

  #disc-center {
    width: 76% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
  }

  #full-player-cover {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
  }

  /* ---------- HIDE PLAYLIST IN FULL PLAYER ---------- */
  .full-playlist-box,
  #full-playlist-container,
  #full-playlist,
  #full-tabs-row {
    display: none !important;
  }

  /* ---------- CONTROLS CENTERED ---------- */
  #full-player-controls-container {
    width: 92vw !important;
    max-width: 360px !important;
    margin: 10px auto 0 !important;
  }

  #full-bottom-row {
    justify-content: center !important;
    gap: 22px;
  }

  /* ---------- REMOVE VOLUME ---------- */
  #full-volume-control {
    display: none !important;
  }
}
/* Global scroll lock for modals */
body.modal-open {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
}



/* =========================================
   PROBLEM 3: HIDE OPEN PLAYER ICON
   WHEN ANY MODAL / OVERLAY IS OPEN
   ========================================= */
body.modal-open #open-player-icon {
  opacity: 0;
  pointer-events: none;
}


@media (max-width: 768px) {

  /* Fix header container */
  #top-header {
    position: fixed;
    top: 8px;
    left: 12px;
    right: 12px;
    height: 56px;

    display: flex;
    align-items: center;

    background:
      radial-gradient(circle at top left, rgba(56,189,248,0.16), transparent 55%),
      rgba(15,23,42,0.96);

    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.4);
    z-index: 900;
  }

  /* Header row alignment */
 #main-header-row {
  padding: 0 14px 0 52px; /* ← reserve space for menu icon */
  align-items: center;
}


  /* Title text fix */
  #current-view-title {
    font-size: 1.2rem;
    padding-top: 0;        /* REMOVE desktop baseline hack */
    line-height: 1.1;
  }

  /* Remove desktop vertical nudges */
  #title-and-actions {
    transform: none;
  }

  /* Center tabs vertically */
  #content-view-toggle {
    transform: none;
  }

  /* Search icon alignment */
  #search-toggle-btn {
    margin-left: auto;
  }

    /* 🔴 MOBILE: REMOVE SONGS / ALBUMS / ARTISTS TABS */
  #content-view-toggle {
    display: none !important;
  }

    /* Prevent title from going under menu icon */
  #title-and-actions {
    max-width: calc(100% - 44px);
  }

  #current-view-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


}


/* =========================================
   DISCLAIMER MODAL (GLOBAL)
   ========================================= */

#disclaimer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 5000;
}

/* hidden state */
.disclaimer-hidden {
  display: none;
}

.disclaimer-modal {
  width: min(420px, 92%);
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.96),
    rgba(2, 6, 23, 0.98)
  );
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 22px;
  padding: 20px 18px;

  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(15, 23, 42, 1);

  text-align: left;
  color: #e5e7eb;
}

.disclaimer-modal h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #f8fafc;
}

.disclaimer-modal p {
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 10px;
  color: #cbd5f5;
}

.disclaimer-muted {
  font-size: 0.78rem;
  color: #94a3b8;
}

#accept-disclaimer-btn {
  margin-top: 14px;
  width: 100%;
  padding: 10px 14px;

  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #22c55e, #22d3ee);
  color: #020617;

  font-weight: 700;
  font-size: 0.9rem;

  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 1),
    0 14px 30px rgba(34, 197, 94, 0.55);

  transition: transform 0.12s ease, box-shadow 0.18s ease;
}

#accept-disclaimer-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 1),
    0 18px 40px rgba(34, 197, 94, 0.8);
}

/* ===============================
   FORCE DISCLAIMER TO TOP LAYER
   =============================== */

#disclaimer-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999; /* higher than everything */
    pointer-events: auto;
}

#disclaimer-overlay.disclaimer-hidden {
    display: none;
}

.disclaimer-modal {
    pointer-events: auto;
}


/* ===============================
   DISCLAIMER ANIMATION
   =============================== */

#disclaimer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#disclaimer-overlay.disclaimer-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.disclaimer-modal {
  max-width: 520px;
  width: 90%;
  background: var(--card-bg, #111);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);

  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

#disclaimer-overlay:not(.disclaimer-hidden) .disclaimer-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* === FIX ALBUM MODAL WIDTH === */
.album-modal-content {
    width: min(900px, 96%);
    max-height: 85vh;

    border-radius: 26px;
    background:
      radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 55%),
      radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.18), transparent 55%),
      #020617f3;

    border: 1px solid rgba(148, 163, 184, 0.8);
    box-shadow:
      0 26px 60px rgba(0, 0, 0, 0.9),
      0 0 0 1px rgba(15, 23, 42, 1);

    padding: 18px 20px 16px;
    position: relative;

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#album-modal-body {
    overflow-y: auto;
    padding: 10px 4px;
}


/* ================================
   PLAYLIST MODAL (PHASE 5)
   ================================ */

#playlist-modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,.92), rgba(15,23,42,.98));
  backdrop-filter: blur(14px);
  display: none;          /* IMPORTANT */
  align-items: center;
  justify-content: center;
  z-index: 980;
}


#playlist-modal.open {
  display: flex;
}


.playlist-modal-box {
  width: min(420px, 92%);
  max-height: 85vh;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(56,189,248,.18), transparent 55%),
    #020617f3;
  border: 1px solid rgba(148,163,184,.8);
  box-shadow:
    0 26px 60px rgba(0,0,0,.9),
    0 0 0 1px rgba(15,23,42,1);
  padding: 18px 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


/* Grid of playlists */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 22px;
  margin-top: 20px;
  width: 100%;
  padding: 10px;

  /* FIX */
  overflow-y: auto;
  overflow-x: hidden;
  justify-items: center;
  align-content: start;
}



/* Playlist circle card */
.playlist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

/* Circle */
.playlist-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 0%, #22c55e, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 2px rgba(15,23,42,1),
    0 10px 26px rgba(34,197,94,.6);
  overflow: hidden;
}

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

/* Playlist name */
.playlist-name {
  font-size: 0.75rem;
  text-align: center;
  color: #e5e7eb;
}

/* PLUS create playlist */
.playlist-create {
  border: 2px dashed rgba(148,163,184,.6);
  background: transparent;
  border-radius: 50%;
}


.playlist-create i {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 26px;
  color: #22c55e;
}
.playlist-modal-box {
  overflow-x: hidden;
}


/* Edit icon */
.playlist-edit {
  position: absolute;
  bottom: 28px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #020617;
  border: 1px solid rgba(148,163,184,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #22c55e;
}

/* Delete X */
.playlist-delete {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #020617;
  border: 1px solid rgba(148,163,184,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #ef4444;
}


/* Only control PLAYLIST MODAL visibility */
.playlist-modal {
    display: none;
}
.playlist-modal.open {
    display: flex !important;
}


/* remove default button styles */
.playlist-empty button {
    background: none;
    border: none;
    padding: 0;
}
/* EMPTY STATE CREATE STYLE */
#playlist-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
#playlist-empty button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;   /* NEW */
    gap: 10px;                 /* more breathing space */
    cursor: pointer;
}

/* FORCE text to go below icon (text node fix) */
#playlist-empty button {
    text-align: center;
}

#playlist-empty button::after {
    content: "";
}
#playlist-empty button i {
    display: block;
}

#playlist-empty span,
#playlist-empty .create-text {
    font-size: 13px;
    opacity: 0.75;
    letter-spacing: 0.3px;   /* premium feel */
}



#playlist-empty i {
    font-size: 36px;
    color: var(--primary);
}

#create-playlist-modal input {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 12px;
    border-radius: 8px;
    color: white;
}
.playlist-cover{
    width:90px;
    height:90px;
    border-radius:50%;
    overflow:hidden;
    position:relative;
}

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

.create-cover{
    background:#38bdf8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    color:#000;
}


/* ===============================
   SIDEBAR FINAL PATCH
   =============================== */

/* 1) REDUCE SPACING */
.sidebar-section-btn,
#main-nav button,
#categories-list button {
  padding: 7px 12px;
}

.sidebar-section-btn {
  margin-top: 5px; /* was 10px */
}

#main-nav button,
#categories-list button {
  margin-bottom: 2px; /* was 4px */
}

/* 2) MAKE SIDEBAR SCROLLABLE */
#sidebar {
  overflow-y: auto;      /* enable vertical scroll */
  overflow-x: hidden;
  scrollbar-width: thin;
}


/* 3) ACTIVE STYLE FOR ALL SIDEBAR BUTTONS */
#sidebar button.active-filter {
  background: linear-gradient(135deg,#22c55e,#22d3ee) !important;
  color:#020617 !important;
  font-weight:600;
  box-shadow:0 0 0 1px #22c55eaa,
             0 12px 28px rgba(16,185,129,.55);
}

#sidebar button.active-filter i{
  color:#020617 !important;
}

/* 4) MOBILE HAMBURGER ANIMATION */

#mobile-menu-toggle {
  transition: transform .3s ease;
}

/* move button WITH sidebar */
body.sidebar-open #mobile-menu-toggle {
  transform: translateX(82vw); /* moves WITH sidebar */
}

/* change icon ☰ → ✖ */
body.sidebar-open #mobile-menu-toggle::before {
  content:"\f00d";
  font-family:"Font Awesome 6 Free";
  font-weight:900;
}


/* CREATE PLAYLIST ICON FIX */
.playlist-cover.create-style {
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-cover.create-style i {
    font-size: 32px;
    color: var(--primary); /* matches your theme */
}
/* EMPTY STATE – stack text below icon */
#playlist-empty {
    display: flex;
    flex-direction: column;   /* vertical */
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* keep button centered */
#playlist-empty button {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* text below */
#playlist-empty .create-text {
    margin-top: 2px;
}
/* EMPTY STATE TEXT POLISH */
#playlist-empty .create-text {
    font-size: 14px;                 /* bigger */
    font-weight: 600;
    line-height: 1.4;               /* vertical balance */
    color: var(--primary);          /* theme color */
    letter-spacing: 0.4px;
    text-align: center;

    /* subtle glow */
    text-shadow: 
      0 0 6px rgba(56,189,248,0.35),
      0 0 14px rgba(56,189,248,0.15);
}
/* Slight left shift for plus icon */
#playlist-empty button i {
    position: relative;
    left: -3px;   /* adjust value if needed */
}
/* ===============================
   PLAYLIST CARD REDESIGN
   =============================== */

.playlist-card {
    width: 120px;     /* increase size */
    height: 150px;   
  position: relative;
  border-radius: 18px;
  overflow: visible;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.08);
  transition: 
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

/* Lift effect */
.playlist-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  border-color: rgba(56,189,248,0.6); /* accent */
}

/* Cover */
.playlist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Playlist name */
.playlist-name {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;

  /* fade long text */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tooltip on hover */
.playlist-card:hover .playlist-name {
  position: relative;
}

.playlist-card:hover .playlist-name::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 120%;
  background: #020617;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0.95;
}

/* Hide icons by default */
.playlist-delete,
.playlist-edit {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Show icons on hover */
.playlist-card:hover .playlist-delete,
.playlist-card:hover .playlist-edit {
  opacity: 1;
}


/* Make card reference point */
.playlist-card {
    position: relative;
}

/* Position delete icon on border */
.playlist-delete {
    position: absolute;
    top: -8px;       /* outside border */
    right: -8px;
    z-index: 10;

    background: #020617;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    padding: 5px;

    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}

/* FORCE DELETE ICON VISIBILITY */
.playlist-delete {
    position: absolute;
    top: -8px;
    right: -8px;

    z-index: 9999; /* force on top */
    opacity: 1 !important;

    background: #020617;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    padding: 6px;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* remove hover hiding */
.playlist-card:hover .playlist-delete {
    opacity: 1 !important;
}
/* ===============================
   PLAYLIST DELETE (FINAL FIX)
================================ */

.playlist-card {
    position: relative;
}

/* keep image rounded */
.playlist-cover {
    position: relative;
    overflow: hidden;      /* restore clipping */
    border-radius: 16px;   /* match your card */
}

/* delete button */
.playlist-delete {
    position: absolute;
    top: 6px;
    right: 6px;

    width: 26px;
    height: 26px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0,0,0,0.75);
    color: #fff;

    border: none;
    cursor: pointer;

    z-index: 5;

    /* hidden by default */
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;

    transition: 0.2s ease;
}

/* show only on hover */
.playlist-card:hover .playlist-delete {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* hover style */
.playlist-delete:hover {
    background: #ff3b3b;
}

/* icon size */
.playlist-delete i {
    font-size: 13px;
}
/* TEMP: HIDE PLAYLIST DELETE ICON */
.playlist-delete {
    display: none !important;
}
/* ================= PLAYLIST CARD POLISH ================= */

/* Space between top border and image */
.playlist-card .playlist-cover {
    margin-top: 15px;   /* adjust if needed */
}

/* Center image nicely */
.playlist-card .playlist-cover img {
    display: block;
    margin: 0 auto;
}

/* Playlist name color + style */
.playlist-card .playlist-name {
    color: #38bdf8;              /* accent blue */
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 10px;
    text-align: center;
}

/* Optional subtle glow on name */
.playlist-card .playlist-name {
    text-shadow: 0 0 6px rgba(56,189,248,0.35);
}

/* ==============================
   PLAYLIST EDITOR MODAL (TEMP)
============================== */

.playlist-editor-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.playlist-editor-modal.open {
  display: flex;
}

.playlist-editor-box{
  width: 90%;
  max-width: 420px;
  height: 95vh;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;

  position: relative;
  display: flex;
  flex-direction: column;

    box-shadow:
    0 30px 80px rgba(0,0,0,.8),
    0 0 0 1px rgba(255,255,255,.05);

  transform: translateX(-120px); /* move left */
}

#playlist-editor-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
  color: var(--primary); /* theme color */
}


.pe-banner{
  width: 100%;
  height: 140px;

  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%; /* 🔥 KEY LINE */

  border-radius: 12px;
}


.pe-avatar{
  width:120px;
  height:120px;
  border-radius:22px;
  overflow:hidden;
  margin:-60px auto 10px;
  border:4px solid var(--bg-card);
}

.pe-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
#pe-name-input{
  width:100%;
  padding:12px;
  border-radius:10px;
  border:none;
  outline:none;
  background:var(--bg-main);
  color:#fff;
  margin-top:10px;
  font-size:1rem;
}
.pe-avatar-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin-top:10px;

}

.pe-actions{
  display:flex;
  gap:10px;
  margin-top:auto;
}

.pe-actions button{
  flex:1;
  padding:12px;
  border-radius:10px;
  border:none;
  font-weight:600;
  cursor:pointer;
}

#pe-cancel-btn{
  background:#374151;
  color:#fff;
}

#pe-save-btn{
  background:var(--primary);
  color:#000;
}
#pe-delete-btn{
  margin-top:12px;
  background:#ef4444;
  color:#fff;
  border:none;
  padding:10px;
  width: 100%;
  display: block;
  border-radius: 8px;
}

#confirm-modal {
    z-index: 99999;
}
#playlist-editor-modal {
    z-index: 9999;
    align-items: center;
}

/* FIX HEADER PART */
.playlist-editor-body{
  display:flex;
  flex-direction:column;
  height:100%;
  overflow:hidden; /* block outer scroll */
  max-height: 85vh;        /* modal height limit */
  overflow-y: auto;       /* enable vertical scroll */
  padding-right: 6px;     /* avoid scrollbar overlap */

}
/* Smooth scroll */
.playlist-editor-body {
  scroll-behavior: smooth;
}

/* fixed section */
.pe-banner,
.pe-avatar{
  flex-shrink:0;
}

.pe-avatar-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:16px;
}

.pe-avatar-header span{
  font-weight:600;
  color:var(--primary);
  letter-spacing:.4px;
}

.pe-view-all{
  font-size:12px;
  color:#9ca3af;
  cursor:pointer;
}

.pe-view-all:hover{
  color:var(--primary);
}
.pe-avatar-item{
  width:100%;
  aspect-ratio:1/1;
  border-radius:12px;
  overflow:hidden;
  cursor:pointer;
  border:2px solid transparent;
}

.pe-avatar-item img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* VIEW ALL – CLEAN LINK STYLE */
.pe-view-all{
  background:none;
  border:none;
  padding:0;
  font-size:12px;
  font-weight:500;
  color:var(--secondary);
  cursor:pointer;
  transition:.25s;
}

/* hover */
.pe-view-all:hover{
  color:var(--primary);
  text-shadow:
    0 0 6px rgba(56,189,248,.5),
    0 0 14px rgba(56,189,248,.25);
}

/* remove ugly focus */
.pe-view-all:focus{
  outline:none;
}


/* ================================
   VIEW ALL AVATAR MODAL
================================ */
.avatar-viewall-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0); /* VERY soft */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.avatar-viewall-box{
  width: 420px;
  height: 85vh;
  
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;

  display: flex;
  flex-direction: column;

  position: absolute;
  right: calc(50% - 560px); /* push more right */
  top: 50%;
  transform: translateY(-50%);
   pointer-events: auto;
}



.avatar-viewall-header{
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}



.av-grid{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:14px;
}

.av-grid img{
  width:100%;
  aspect-ratio:1/1;
  border-radius:14px; /* theme rounded */
  cursor:pointer;
  object-fit:cover;
}


.avatar-viewall-body{
  flex:1;
  overflow-y:auto;
  padding:10px 4px;
}

/* VIEW ALL TABS */

.avatar-viewall-header{
  display:flex;
  gap:10px;
}

/* base tab */
.viewall-tab{
  padding:6px 16px;
  font-size:13px;
  border-radius:8px;
  background:transparent;
  border:1px solid rgba(255,255,255,0.15);
  color:rgba(255,255,255,0.75);
  cursor:pointer;
  transition:.25s ease;
}

/* hover */
.viewall-tab:hover{
  background:rgba(255,255,255,0.06);
  color:#fff;
}

/* active tab */
.active-viewall-tab{
  background:var(--primary);
  color:#000;
  border-color:var(--primary);
  box-shadow:0 0 12px rgba(56,189,248,.5);
}

/* disabled state removed (future safe) */
.viewall-tab:disabled{
  opacity:1;
  pointer-events:auto;
}
/* VIEW ALL MODAL – CUSTOM SCROLLBAR */

.avatar-viewall-body{
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.6) transparent;
}

/* webkit */
.avatar-viewall-body::-webkit-scrollbar{
  width:8px;
}

.avatar-viewall-body::-webkit-scrollbar-track{
  background:transparent;
  border-radius:999px;
}

.avatar-viewall-body::-webkit-scrollbar-thumb{
  background:linear-gradient(
    180deg,
    rgba(148,163,184,.6),
    rgba(75,85,99,.9)
  );
  border-radius:999px;
  box-shadow:0 0 0 2px rgba(15,23,42,.9);
}

/* hover */
.avatar-viewall-body::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(
    180deg,
    rgba(209,213,219,.9),
    rgba(107,114,128,1)
  );
}
/* ===============================
   BANNER SELECTOR (EDITOR MODAL)
   =============================== */

/* header */


.pe-banner-grid img{
  width:100%;
  height:70px;
  object-fit:cover;
  border-radius:12px;
  cursor:pointer;
  transition:.25s ease;
  border:2px solid transparent;
}

/* grid */
.pe-banner-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2,1fr); /* 2 banners per row */
  gap:12px;
}





/* MODAL BODY */
.playlist-editor-body{
  height: 80vh;           /* REQUIRED */
  display: flex;
  flex-direction: column;
}

/* FIXED (NO SCROLL) */
.pe-banner,
.pe-avatar{
  flex-shrink: 0;
}

/* SCROLL CONTAINER */
.pe-scroll-area{
  flex: 1;                /* 🔥 THIS ENABLES SCROLL */
  overflow-y: auto;
  padding-right: 6px;
}
/* SCROLLBAR BASE */
.pe-scroll-area::-webkit-scrollbar,
.avatar-viewall-body::-webkit-scrollbar{
  width: 6px;
}

/* TRACK */
.pe-scroll-area::-webkit-scrollbar-track,
.avatar-viewall-body::-webkit-scrollbar-track{
  background: transparent;
}

/* THUMB */
.pe-scroll-area::-webkit-scrollbar-thumb,
.avatar-viewall-body::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg,#38bdf8,#0ea5e9);
  border-radius: 10px;
}

/* HOVER */
.pe-scroll-area::-webkit-scrollbar-thumb:hover,
.avatar-viewall-body::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg,#7dd3fc,#38bdf8);
}
/*FIREFOX SUPPORT */
.pe-scroll-area,
.avatar-viewall-body{
  scrollbar-width: thin;
  scrollbar-color: #38bdf8 transparent;
}
/* AVATAR HOVER */
.pe-avatar-grid img{
  border-radius: 12px;
  border: 2px solid transparent;
  transition: border 0.25s ease, box-shadow 0.25s ease;
}



/* SELECTED AVATAR */
.pe-avatar-grid img.selected-avatar{
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56,189,248,0.6);
}
/* BANNER */
.pe-banner-item{
  border-radius: 12px;
  border: 2px solid transparent;
  transition: border 0.25s ease, box-shadow 0.25s ease;
}



/* AVATAR */
.pe-avatar-item{
  border-radius: 12px;
  border: 2px solid transparent;
 
}


.pe-avatar-item.selected-avatar{
  border-color: #38bdf8;
}

.pe-banner-item{
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: border 0.25s ease, box-shadow 0.25s ease;

  aspect-ratio: 16 / 6;  /* 👈 makes it shorter (≈55% height look) */
}
.pe-banner-grid{
  margin-bottom: 24px; /* space before action buttons */
}
/* Banner header */
.pe-banner-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 10px;
}

/* SAME STYLE AS AVATAR TITLE */
.pe-banner-title{
  font-size: 15px;
  font-weight: 600;
  color: #4fc3ff;
}
/* ACTIVE BANNER */
.pe-banner-item.active-banner{
  border: 2px solid #38bdf8;
  box-shadow: none; /* ❌ remove glow */
}

.avatar-viewall-modal{
  pointer-events: none; /* allow click-through */
}

.avatar-viewall-box{
  pointer-events: auto; /* only modal itself clickable */
}

#playlist-modal-body{
  max-height:70vh;
  overflow-y:auto;
  padding:6px 4px;
}


/* ==============================
   PLAYLIST SONG MODAL STYLE
   ============================== */

#playlist-song-list{
  list-style:none;
  margin:0;
  padding:2px 0 4px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* Row */



.playlist-song-item:hover{
  background:#1e293b;
  border-color:var(--primary);
  box-shadow:none;
  transform:none;
}




.playlist-song-play i{
  color:#020617;
  font-size:.85rem;
}

.playlist-song-play:hover{
  transform:translateY(-1px) scale(1.05);
}

/* Playing state */
.playlist-song-item.playing{
  border-color:var(--primary);
  background:
    radial-gradient(circle at left,
      rgba(34,197,94,.15),
      transparent 60%),
    rgba(15,23,42,.98);
}
/* Playlist song header */

.playlist-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.playlist-header-left{
  display:flex;
  align-items:center;
  gap:12px;
}

.playlist-header-text{
  display:flex;
  flex-direction:column;
}

.playlist-header-name{
  font-size:18px;
  font-weight:600;
}

.playlist-header-count{
  font-size:12px;
  opacity:0.7;
}

.playlist-header-edit{
  background:none;
  border:none;
  color:white;
  font-size:16px;
  cursor:pointer;
  opacity:0.8;
}

.playlist-header-edit:hover{
  opacity:1;
}
/* ===============================
   PLAYLIST HEADER – NAME + COUNT
   =============================== */

.playlist-header-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.playlist-header-name{
  font-size:18px;
  font-weight:600;
  color:#f8fafc;
  line-height:1.2;
}

.playlist-header-count{
  font-size:12px;
  color:#94a3b8;
  letter-spacing:0.3px;
}

/* FIX: real HTML class binding */

.pl-header-left{
  display:flex;
  align-items:center;
  gap:12px;
}

.pl-name{
  font-size:18px;
  font-weight:600;
  color:#f8fafc;
}

.pl-count{
  font-size:12px;
  color:#94a3b8;
}

.pl-edit-btn{
  background:none;
  border:none;
  color:white;
  font-size:14px;
  cursor:pointer;
  opacity:0.8;
}

.pl-edit-btn:hover{
  opacity:1;
}
/* Replace icon with text */
.pl-edit-btn i{
  display:none;
}

.pl-edit-btn::after{
  content:"Edit";
}

/* PLAYLIST SONG MODAL - mirror category styles */



.playlist-song-item:hover {
  background: rgba(255,255,255,0.08);
}

/* ===============================
   PLAYLIST SONG MODAL
   (mirror category modal)
================================ */



.playlist-song-item:hover {
  background: rgba(255,255,255,0.08);
}

.playlist-song-item.playing {
  background: rgba(56,189,248,0.15);
  border-color: var(--primary);
}



.playlist-song-play:hover {
  transform: scale(1.05);
}

/* ===============================
   PLAYLIST SONG MODAL (FINAL)
   Matches Category Modal
================================ */

.playlist-song-list{
  list-style:none;
  margin:0;
  padding:4px 0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.playlist-song-item{
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:8px 10px;
  border-radius:12px;

  background:rgba(15,23,42,.97);
  border:1px solid rgba(55,65,81,.95);

  cursor:pointer;
  transition:.2s;
}

.playlist-song-item:hover{
  transform:translateY(-1px);
  border-color:rgba(34,197,94,.9);
  box-shadow:0 14px 32px rgba(15,23,42,.95);
}

.playlist-song-main{
  flex:1;
  min-width:0;
}

.playlist-song-title{
  font-size:.9rem;
  font-weight:600;
  color:#f8fafc;
}

.playlist-song-artist{
  font-size:.78rem;
  color:#9ca3af;
}

.playlist-song-play{
  border:none;
  background:
    radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e);

  width:30px;
  height:30px;
  border-radius:50%;

  display:flex;
  align-items:center;
  justify-content:center;

  box-shadow:
    0 0 0 2px rgba(15,23,42,1),
    0 10px 22px rgba(34,197,94,.8);

  cursor:pointer;
}

/* PLAYLIST SONG MODAL SCROLLBAR */
#playlist-modal-body{
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.6) transparent;
}

#playlist-modal-body::-webkit-scrollbar{
  width:6px;
}

#playlist-modal-body::-webkit-scrollbar-track{
  background:transparent;
}

#playlist-modal-body::-webkit-scrollbar-thumb{
  background:linear-gradient(
    180deg,
    rgba(148,163,184,.6),
    rgba(75,85,99,.9)
  );
  border-radius:999px;
}

#playlist-modal-body::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(
    180deg,
    rgba(209,213,219,.9),
    rgba(107,114,128,1)
  );
}
/* BACK BUTTON STYLE (MATCH THEME) */
.pl-back-btn{
  background:none;
  border:none;
  color:#9ca3af;
  font-size:13px;
  cursor:pointer;

  display:flex;
  align-items:center;
  gap:6px;

  transition:.2s;
}

.pl-back-btn i{
  font-size:14px;
}

.pl-back-btn:hover{
  color:#f8fafc;
  transform:translateX(-2px);
}
/* PLAYLIST HEADER EDIT BUTTON */
.playlist-header-edit{
  background:none;
  border:none;
  padding:0;

  font-size:12px;
  font-weight:500;

  color:var(--secondary);
  cursor:pointer;
  transition:.25s;
}

.playlist-header-edit:hover{
  color:var(--primary);
  text-shadow:
    0 0 6px rgba(56,189,248,.5),
    0 0 14px rgba(56,189,248,.25);
}
/* PLAYLIST BACK BUTTON */
#playlist-back-btn{
  background:none;
  border:none;
  color:#9ca3af;
  font-size:13px;
  cursor:pointer;

  display:flex;
  align-items:center;
  gap:6px;

  transition:.2s;
}

#playlist-back-btn i{
  font-size:14px;
}

#playlist-back-btn:hover{
  color:#f8fafc;
  transform:translateX(-2px);
}
/* PLAYLIST HEADER TEXT */
.playlist-header-name{
  font-size:15px;
  font-weight:600;
  color:#f8fafc;
  letter-spacing:.3px;
}

.playlist-header-count{
  font-size:11px;
  color:#94a3b8;
  margin-top:2px;
}
/* Fake checkbox (Netflix style) */
.playlist-song-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #999;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Selected state */
.playlist-song-item.selected .playlist-song-checkbox {
  background: #22c55e;
  border-color: #22c55e;
}

.playlist-song-item.selected .playlist-song-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}
.playlist-song-checkbox{
  transition:.2s;
}

.playlist-song-item:hover .playlist-song-checkbox{
  border-color:#22c55e;
  transform:scale(1.05);
}
.playlist-song-item.selected .playlist-song-checkbox::after{
  animation: tickPop .2s ease;
}

@keyframes tickPop{
  0%{transform:scale(0)}
  100%{transform:scale(1)}
}
.playlist-song-item.edit-mode:hover{
  transform:none;
  box-shadow:none;
}
.playlist-song-item{
  min-height:48px; /* better mobile tap */
}
.playlist-delete-bar {
  position: sticky;
  bottom: 20px;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  background: transparent;
}

#playlist-delete-btn {
  background: linear-gradient(135deg, #ff3b3b, #ff0000);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255,0,0,0.35);
  transition: 0.2s ease;
}

#playlist-delete-btn:active {
  transform: scale(0.96);
}
/*EDIT ICON IN PLAYLIST */
@media (max-width: 768px) {

  /* Always show edit icon on mobile */
  .playlist-edit {
    opacity: 1 !important;
  }

}

/* =====================================
   MOBILE – PLAYLIST SONG LIST
   ===================================== */

@media (max-width: 768px){

  /* KEEP HEADER CLEAN */
  .playlist-title{
    background: transparent !important;
  }

  /* SONG LIST */
  .playlist-song-list{
    max-height: 68vh;
    overflow-y: auto;
    padding-bottom: 90px;
  }

  .playlist-song-item{
    min-height: 56px;
    padding: 10px 12px;
  }

  .playlist-song-title{
    font-size: 14px;
  }

  .playlist-song-artist{
    font-size: 12px;
  }

  /* DELETE BAR */
  .playlist-delete-bar{
    position: fixed;
    bottom: 90px;
    left: 0;
    width: 100%;
    padding: 10px 16px;
    background: transparent; /* 🔥 NO BLACK */
    z-index: 50;
  }

  #playlist-delete-btn{
    width: 100%;
    border-radius: 16px;
    padding: 14px;
    font-size: 15px;
  }

}
/* ===============================
   STEP 3 – PLAYLIST EDITOR MOBILE FIX (FINAL)
   =============================== */

@media (max-width:768px){

/* Modal center fix */
.playlist-editor-modal{
  align-items: center;
  justify-content: center;
}

.playlist-editor-box{
  width: 92%;
  max-height: 90vh;
  margin: auto;
  border-radius: 18px;
  overflow: hidden;
  transform: none !important;
  left: auto !important;
}

/* Scroll area */
.pe-scroll-area{
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  padding-bottom: 20px;
}

/* ACTION BUTTONS */
.pe-actions{
  position: relative;
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

/* Cancel + Save */
.pe-actions button{
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
}

/* DELETE BUTTON (INSIDE MODAL) */
#pe-delete-btn{
  position: relative;
  margin-top: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  background: #ff3b3b;
  color: #fff;
  border: none;
}

/* Banner spacing */
.pe-banner{
  margin-bottom: 14px;
}

}
/* ===============================
   STEP 4 – MOBILE EDITOR TABS
   =============================== */

@media (max-width:768px){

/* Hide old headers + view all */
.pe-avatar-header,
.pe-banner-header{
  display:none;
}

/* Mobile tabs container */
.pe-mobile-tabs{
  display:flex;
  gap:10px;
  margin:16px 0;
}

/* Tab buttons */
.pe-m-tab{
  flex:1;
  padding:12px;
  border-radius:12px;
  border:1px solid #2a2a2a;
  background:#111;
  color:#aaa;
  font-size:14px;
}

/* Active */
.pe-m-tab.active{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

/* Default show avatars */
.pe-banner-grid{
  display:none;
}

/* When banner active */
.pe-show-banner .pe-avatar-grid{
  display:none;
}

.pe-show-banner .pe-banner-grid{
  display:grid;
}

}

@media (max-width:768px){

/* Make scroll area a flex column */
.pe-scroll-area{
  display: flex;
  flex-direction: column;
}

/* Push buttons to bottom ALWAYS */
.pe-actions{
  margin-top: auto;
}

/* Delete below actions */
#pe-delete-btn{
  margin-top: 12px;
}

}

/* ===============================
   MOBILE – AVATAR GRID FIX
   =============================== */
@media (max-width:768px){

.pe-avatar-grid{
  display:grid;
  grid-template-columns: repeat(3,1fr); /* better spacing */
  gap:12px;

  max-height: none !important;  /* allow full height */
  overflow: visible !important; /* no clipping */
}

/* Avatar item fix */
.pe-avatar-item{
  width:100%;
  aspect-ratio:1/1;
  border-radius:14px;
  overflow:hidden;
}

/* Image fix */
.pe-avatar-item img{
  width:100%;
  height:100%;
  object-fit:cover;
}

}
@media (max-width:768px){

/* Modal layout */
.playlist-editor-box{
  display:flex;
  flex-direction:column;
  height:90vh;
}

/* Scroll area */
.pe-scroll-area{
  flex:1;
  overflow-y:auto;
  padding-bottom:160px; /* space for fixed buttons */
}

/* ACTIONS FIXED TO SCREEN BOTTOM */
.pe-actions{
  position:fixed;
  left:50%;
  bottom:70px; /* above browser bar */
  transform:translateX(-50%);
  width:92%;
  display:flex;
  gap:12px;
  z-index:999;
}

/* Cancel + Save */
.pe-actions button{
  flex:1;
  padding:14px;
  border-radius:12px;
  font-size:15px;
}

/* DELETE FIXED UNDER THEM */
#pe-delete-btn{
  position:fixed;
  left:50%;
  bottom:20px;
  transform:translateX(-50%);
  width:92%;
  padding:14px;
  border-radius:12px;
  background:#ff3b3b;
  color:#fff;
  border:none;
  z-index:999;
}
/* ===============================
   MOBILE TOUCH BOOST (SAFE)
   =============================== */
@media (max-width:768px){

  /* Remove 300ms delay */
  *{
    touch-action: manipulation;
  }

  /* Remove ugly tap highlight */
  button,
  a,
  .playlist-card,
  .playlist-edit,
  .pe-avatar-item,
  .pe-banner-item{
    -webkit-tap-highlight-color: transparent;
  }

  /* Faster feedback */
  button:active,
  .playlist-card:active,
  .pe-avatar-item:active,
  .pe-banner-item:active{
    transform: scale(0.97);
  }
}

}
/* DESKTOP – hide mobile tabs in editor */
@media (min-width: 769px) {

  .pe-mobile-tabs{
    display: none !important;
  }

}

/* ================= DOWNLOADS MODAL FIX ================= */

/* ===============================
   DOWNLOADS MODAL (FINAL)
================================ */

/* OVERLAY */
#downloads-modal{
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,.92), rgba(15,23,42,.98));
  backdrop-filter: blur(14px);
  display: none;          /* IMPORTANT */
  align-items: center;
  justify-content: center;
  z-index: 980;
}

#downloads-modal.open{
  display: flex;
}

/* MAIN BOX */
#downloads-modal .playlist-modal-box{
  width: min(420px, 92%);
  max-height: 85vh;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(56,189,248,.18), transparent 55%),
    #020617f3;
  border: 1px solid rgba(148,163,184,.8);
  box-shadow:
    0 26px 60px rgba(0,0,0,.9),
    0 0 0 1px rgba(15,23,42,1);
  padding: 18px 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* ================================ */
/* DOWNLOADS MODAL BASE */
/* ================================ */


#downloads-modal.active{
  opacity:1;
  pointer-events:auto;
}

/* ================================ */
/* HEADER */
/* ================================ */

#downloads-modal .playlist-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border-soft);
}

/* LEFT */
#downloads-modal .playlist-header-left{
  display:flex;
  align-items:center;
  gap:12px;
}

#downloads-back-btn{

  background:none;
  border:none;
  color:#9ca3af;
  font-size:13px;
  cursor:pointer;

  display:flex;
  align-items:center;
  gap:6px;

  transition:.2s;
}

#downloads-back-btn i{
  font-size:14px;
}

#downloads-back-btn:hover{
  color:#f8fafc;
  transform:translateX(-2px);
}

#downloads-modal .playlist-header-text{
  display:flex;
  flex-direction:column;
}

#downloads-modal .playlist-header-name{
  font-size:16px;
  font-weight:600;
}

#downloads-modal .playlist-header-count{
  font-size:12px;
  opacity:0.7;
}


#downloads-modal .playlist-header-edit:hover{
  background:var(--hover-soft);
}

#downloads-modal .playlist-header-edit.active{
  background:var(--accent-soft);
  color:var(--accent);
}

/* CLOSE */
#downloads-close-btn{
  font-size:18px;
}

/* ================================ */
/* BODY */
/* ================================ */

#downloads-modal .playlist-modal-body{
  flex:1;
  overflow-y:auto;
  padding:12px;
}

/* ================================ */
/* SONG LIST */
/* ================================ */

#downloads-modal .playlist-song-list{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:0;
  margin:0;
}

/* ITEM */
#downloads-modal .playlist-song-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:12px;
  background:var(--card-bg);
  transition:.2s;
  position:relative;
}

/* HOVER */
#downloads-modal .playlist-song-item:hover{
  background:var(--card-hover);
}

/* ACTIVE */
#downloads-modal .playlist-song-item.active{
  background:var(--accent-soft);
}

/* LEFT */
#downloads-modal .playlist-song-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
}

/* COVER */
#downloads-modal .playlist-song-cover{
  width:46px;
  height:46px;
  border-radius:8px;
  object-fit:cover;
}

/* TEXT */
#downloads-modal .playlist-song-text{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

#downloads-modal .playlist-song-title{
  font-size:14px;
  font-weight:500;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#downloads-modal .playlist-song-artist{
  font-size:12px;
  opacity:0.7;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* RIGHT ACTIONS */
#downloads-modal .playlist-song-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

/* PLAY BTN */
#downloads-modal .playlist-play-btn{
  width:34px;
  height:34px;
  border-radius:50%;
  background:var(--accent);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* MORE */
#downloads-modal .playlist-more-btn{
  background:transparent;
  font-size:16px;
}

/* ================================ */
/* EDIT MODE */
/* ================================ */

#downloads-modal.edit-mode .playlist-song-item{
  padding-left:42px;
}

/* CHECKBOX */
#downloads-modal .playlist-edit-checkbox{
  position:absolute;
  left:12px;
  width:18px;
  height:18px;
  accent-color:var(--accent);
  display:none;
}

#downloads-modal.edit-mode .playlist-edit-checkbox{
  display:block;
}

/* HIDE PLAY BTN */
#downloads-modal.edit-mode .playlist-play-btn{
  display:none;
}

/* ================================ */
/* SCROLL */
/* ================================ */

#downloads-modal .playlist-modal-body::-webkit-scrollbar{
  width:6px;
}
#downloads-modal .playlist-modal-body::-webkit-scrollbar-thumb{
  background:var(--border-soft);
  border-radius:10px;
}

/* ================================ */
/* MOBILE */
/* ================================ */

@media(max-width:600px){
  #downloads-modal .playlist-modal-box{
    width:100%;
    height:100%;
    border-radius:0;
  }
  #downloads-modal .playlist-song-cover{
    width:42px;
    height:42px;
  }
}

/* ================================ */
/* ANIMATION */
/* ================================ */

@keyframes modalUp{
  from{
    transform:translateY(20px);
    opacity:0;
  }
  to{
    transform:translateY(0);
    opacity:1;
  }
}
/* ================================ */
/* DOWNLOAD DELETE BUTTON */
/* ================================ */

#downloads-delete-btn{
  width:50%;
  margin-top:14px;
  padding:12px;
  border-radius:12px;
  background:#ff3b3b;
  color:#fff;
  font-size:14px;
  font-weight:600;
  border:none;
  cursor:pointer;
  transition:.2s ease;
}

/* HOVER */
#downloads-delete-btn:hover{
  background:#e63232;
}

/* CLICK */
#downloads-delete-btn:active{
  transform:scale(.97);
}

/* DISABLED */
#downloads-delete-btn:disabled{
  opacity:.4;
  pointer-events:none;
}
/* ===============================
   FAVORITES MODAL (FINAL)
   CLONE OF DOWNLOADS
================================ */

/* OVERLAY */
#favorites-modal{
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(15,23,42,.92), rgba(15,23,42,.98));
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 980;
}

#favorites-modal.open{
  display: flex;
}

/* MAIN BOX */
#favorites-modal .playlist-modal-box{
  width: min(420px, 92%);
  max-height: 85vh;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(56,189,248,.18), transparent 55%),
    #020617f3;
  border: 1px solid rgba(148,163,184,.8);
  box-shadow:
    0 26px 60px rgba(0,0,0,.9),
    0 0 0 1px rgba(15,23,42,1);
  padding: 18px 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================================ */
/* HEADER */
/* ================================ */

#favorites-modal .playlist-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

/* LEFT */
#favorites-modal .playlist-header-left{
  display:flex;
  align-items:center;
  gap:12px;
}

#favorites-back-btn{
  background:none;
  border:none;
  color:#9ca3af;
  font-size:13px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  transition:.2s;
}

#favorites-back-btn i{
  font-size:14px;
}

#favorites-back-btn:hover{
  color:#f8fafc;
  transform:translateX(-2px);
}

#favorites-modal .playlist-header-text{
  display:flex;
  flex-direction:column;
}

#favorites-modal .playlist-header-name{
  font-size:16px;
  font-weight:600;
}

#favorites-modal .playlist-header-count{
  font-size:12px;
  opacity:.7;
}

/* EDIT */
#favorites-edit-top{
  background:none;
  border:none;
  color:#9ca3af;
  font-size:13px;
  cursor:pointer;
  transition:.25s;
}

#favorites-edit-top:hover{
  color:#38bdf8;
}

/* CLOSE */
#favorites-close-btn{
  font-size:18px;
}

/* ================================ */
/* BODY */
/* ================================ */

#favorites-modal .playlist-modal-body{
  flex:1;
  overflow-y:auto;
  padding:12px;
}

/* ================================ */
/* SONG LIST */
/* ================================ */

#favorites-modal .playlist-song-list{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:0;
  margin:0;
}

/* ITEM */
#favorites-modal .playlist-song-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(15,23,42,.97);
  transition:.2s;
  position:relative;
}

/* HOVER */
#favorites-modal .playlist-song-item:hover{
  background:rgba(255,255,255,.06);
}

/* ACTIVE */
#favorites-modal .playlist-song-item.active{
  background:rgba(56,189,248,.15);
}

/* LEFT */
#favorites-modal .playlist-song-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
}

/* COVER */
#favorites-modal .playlist-song-cover{
  width:46px;
  height:46px;
  border-radius:8px;
  object-fit:cover;
}

/* TEXT */
#favorites-modal .playlist-song-text{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

#favorites-modal .playlist-song-title{
  font-size:14px;
  font-weight:500;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#favorites-modal .playlist-song-artist{
  font-size:12px;
  opacity:.7;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* RIGHT ACTIONS */
#favorites-modal .playlist-song-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

/* PLAY BTN */
#favorites-modal .playlist-play-btn{
  width:34px;
  height:34px;
  border-radius:50%;
  background:#22c55e;
  color:#020617;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ================================ */
/* EDIT MODE */
/* ================================ */

#favorites-modal.edit-mode .playlist-song-item{
  padding-left:42px;
}

/* CHECKBOX */
#favorites-modal .playlist-edit-checkbox{
  position:absolute;
  left:12px;
  width:18px;
  height:18px;
  accent-color:#22c55e;
  display:none;
}

#favorites-modal.edit-mode .playlist-edit-checkbox{
  display:block;
}

/* HIDE PLAY BTN */
#favorites-modal.edit-mode .playlist-play-btn{
  display:none;
}

/* ================================ */
/* SCROLL */
/* ================================ */

#favorites-modal .playlist-modal-body::-webkit-scrollbar{
  width:6px;
}
#favorites-modal .playlist-modal-body::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.6);
  border-radius:10px;
}

/* ================================ */
/* MOBILE */
/* ================================ */

@media(max-width:600px){
  #favorites-modal .playlist-modal-box{
    width:100%;
    height:100%;
    border-radius:0;
  }
  #favorites-modal .playlist-song-cover{
    width:42px;
    height:42px;
  }
}

/* ================================ */
/* FAVORITES DELETE BUTTON */
/* ================================ */

#favorites-delete-btn{
  width:50%;
  margin-top:14px;
  padding:12px;
  border-radius:12px;
  background:#ff3b3b;
  color:#fff;
  font-size:14px;
  font-weight:600;
  border:none;
  cursor:pointer;
  transition:.2s ease;
}

#favorites-delete-btn:hover{
  background:#e63232;
}

#favorites-delete-btn:active{
  transform:scale(.97);
}

#favorites-delete-btn:disabled{
  opacity:.4;
  pointer-events:none;
}
.playlist-song-item{
  touch-action: manipulation;
}
/* =========================================
   MOBILE – MATCH DOWNLOADS & FAVORITES
   TO PLAYLIST MODAL
========================================= */

@media (max-width: 768px){

/* ===== COMMON BASE ===== */
#downloads-modal .playlist-modal-box,
#favorites-modal .playlist-modal-box{
  width: 92% !important;
  height: auto !important;
  max-height: 85vh;
  border-radius: 26px !important;
  padding: 18px 20px 16px !important;
}

/* BODY */
#downloads-modal .playlist-modal-body,
#favorites-modal .playlist-modal-body{
  padding: 6px 4px !important;
}

/* LIST */
#downloads-modal .playlist-song-list,
#favorites-modal .playlist-song-list{
  gap: 8px !important;
}

/* ROW */
#downloads-modal .playlist-song-item,
#favorites-modal .playlist-song-item{
  padding: 8px 10px !important;
  border-radius: 12px !important;
  background: rgba(15,23,42,.97) !important;
  border: 1px solid rgba(55,65,81,.95) !important;
}

/* HOVER */
#downloads-modal .playlist-song-item:hover,
#favorites-modal .playlist-song-item:hover{
  transform: translateY(-1px);
  border-color: rgba(34,197,94,.9);
  box-shadow: 0 14px 32px rgba(15,23,42,.95);
}

/* LEFT TEXT */
#downloads-modal .playlist-song-title,
#favorites-modal .playlist-song-title{
  font-size: .9rem !important;
  font-weight: 600;
}

#downloads-modal .playlist-song-artist,
#favorites-modal .playlist-song-artist{
  font-size: .78rem !important;
  color: #9ca3af;
}

/* PLAY BUTTON */
#downloads-modal .playlist-play-btn,
#favorites-modal .playlist-play-btn{
  width: 30px !important;
  height: 30px !important;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 0%, #bbf7d0, #22c55e) !important;

  box-shadow:
    0 0 0 2px rgba(15,23,42,1),
    0 10px 22px rgba(34,197,94,.8);
}

/* EDIT MODE */
#downloads-modal.edit-mode .playlist-song-item,
#favorites-modal.edit-mode .playlist-song-item{
  padding-left: 42px !important;
}

/* CHECKBOX */
#downloads-modal .playlist-edit-checkbox,
#favorites-modal .playlist-edit-checkbox{
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* DELETE BUTTON */
#downloads-delete-btn,
#favorites-delete-btn{
  width: 100% !important;
  border-radius: 16px !important;
  padding: 14px !important;
  font-size: 15px !important;
}

/* HEADER */
#downloads-modal .playlist-modal-header,
#favorites-modal .playlist-modal-header{
  padding: 14px 16px !important;
}

/* TITLE */
#downloads-modal .playlist-header-name,
#favorites-modal .playlist-header-name{
  font-size: 15px !important;
}

/* COUNT */
#downloads-modal .playlist-header-count,
#favorites-modal .playlist-header-count{
  font-size: 11px !important;
  color:#94a3b8;
}

}
/* ===============================
   DESKTOP SCROLL – DOWNLOADS
================================ */


#downloads-modal .playlist-modal-body::-webkit-scrollbar{
  width:6px;
}

#downloads-modal .playlist-modal-body::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.5);
  border-radius:10px;
}

.global-toast{
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);

    background: #0f172a;
    color: #fff;

    padding: 10px 18px;
    border-radius: 12px;

    font-size: 14px;
    font-weight: 500;
    letter-spacing: .2px;

    box-shadow: 
      0 8px 20px rgba(0,0,0,.35),
      inset 0 0 0 1px rgba(255,255,255,.08);

    opacity: 0;
    pointer-events: none;
    z-index: 99999;

    transition: 
      opacity .25s ease,
      transform .25s ease;
}

/* SHOW STATE */
.global-toast.show{
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.dl-progress{
    width:60px;
    height:6px;
    background:#222;
    border-radius:10px;
    overflow:hidden;
}

.dl-bar{
    height:100%;
    background:var(--accent);
    width:0%;
    transition:.2s;
}

.dl-text{
    font-size:11px;
    margin-left:6px;
    color:var(--accent);
}
/* ACTIVE SONG CARD */
.playlist-song-item.playing{
  border:1px solid var(--accent,#4ade80);
  background:rgba(74,222,128,0.06);
  box-shadow:0 0 14px rgba(74,222,128,0.45);
}

/* DO NOT TOUCH YOUR BUTTON STYLE */
/* Only add outer glow ring */
.playlist-song-item.playing 
.playlist-song-play{
  position:relative;
}

/* GLOW RING */
.playlist-song-item.playing 
.playlist-song-play::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:50%;
  border:2px solid rgba(74,222,128,.6);
  animation:pulseRing 1.4s infinite;
}

/* PULSE ANIMATION */
@keyframes pulseRing{
  0%{opacity:.8; transform:scale(.95);}
  70%{opacity:0; transform:scale(1.25);}
  100%{opacity:0;}
}
/* ============================
   OPTIONS MENU (3 DOT MENU)
   ============================ */


/* MAIN OPTIONS MENU */
.options-menu{
  position:absolute;
  right:0;
  margin-bottom:30px;

  display:flex !important;
  flex-direction:column !important; /* VERTICAL */
  gap:2px;

 
  min-width:42px;

  background:rgba(15,23,42,0.95);
  border-radius:12px;
  backdrop-filter:blur(12px);

  box-shadow:0 10px 25px rgba(0,0,0,0.4);
  z-index:9999;

  animation:menuPop .18s ease-out;
}

/* ICON BUTTONS */
.options-menu .option-btn{
  display:flex;
  align-items:center;
  justify-content:center;

  width:36px;
  height:36px;

  border-radius:50%;
  background:rgba(255,255,255,0.08);
  color:#fff;

  transition:all .2s ease;
}

/* HOVER EFFECT */
.options-menu .option-btn:hover{
  background:var(--accent,#4ade80);
  color:#000;
  transform:scale(1.1);
}

/* POP ANIMATION */
@keyframes menuPop{
  from{
    transform:translateY(8px) scale(.95);
    opacity:0;
  }
  to{
    transform:translateY(0) scale(1);
    opacity:1;
  }
}
/* ============ SETTINGS MODAL ============ */

.settings-hidden{
  display:none;
}

#settings-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(8px);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* BOX */
.settings-box{
  width:340px;
  background:
    linear-gradient(180deg,
      #020617,
      #0f172a
    );
  border-radius:18px;
  border:1px solid rgba(34,197,94,.5);
  box-shadow:
    0 0 40px rgba(34,197,94,.4);
  overflow:hidden;
}

/* HEADER */
.settings-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#f8fafc;
  font-weight:600;
}

/* ICON BUTTONS */
.settings-header button{
  background:none;
  border:none;
  color:#22c55e;
  font-size:16px;
  cursor:pointer;
}

/* MENU */
.settings-menu{
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* ROW */
.settings-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 14px;
  background:rgba(255,255,255,.04);
  border-radius:12px;
  border:1px solid rgba(255,255,255,.05);
  color:#e5e7eb;
  cursor:pointer;
  transition:.25s;
  font-size:14px;
}

/* ICON */
.settings-row i{
  color:#22c55e;
  text-shadow:0 0 6px rgba(34,197,94,.7);
}

/* HOVER */
.settings-row:hover{
  
  border-color:#22c55e;
  box-shadow:0 0 14px rgba(34,197,94,.5);
}

/* ADMIN */
.admin-only{
  border:1px solid rgba(34,197,94,1);
  background:
    radial-gradient(circle at left,
      rgba(34,197,94,.25),
      transparent 60%),
    rgba(2,6,23,.95);
}
#settings-back-btn{
  display:none;   /* hide on main menu */
}

/* SECTION MODE - SAME STYLE AS MAIN MENU */
.settings-section{
    display:none;
}

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



/* Make section buttons same as main menu */
.settings-section .settings-row{
    width:100%;
    background:transparent;
    border:none;
    border-bottom:1px solid rgba(255,255,255,.1);
    border-radius:0;
}

/* Disabled setting rows */
.disabled-setting {
  opacity: 0.6;
  pointer-events: none;
}

.disabled-setting .coming-soon {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.7;
}

.danger-setting,
.danger-setting i {
  color: #ff4d4d;
}

/* ===============================
   CHANGE PASSWORD – SETTINGS UI
================================ */

#section-change-password {
  padding: 14px 12px;
}

/* Title */
#section-change-password .settings-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #e5e7eb;
}

/* Form wrapper */
#section-change-password .settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Inputs */
#section-change-password input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.8);
  color: #e5e7eb;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease, background 0.2s ease;
}

#section-change-password input::placeholder {
  color: #64748b;
}

#section-change-password input:focus {
  border-color: #22c55e;
  background: rgba(2, 6, 23, 1);
}

/* Error text */
#cp-error {
  font-size: 13px;
  color: #f87171;
  margin-top: 2px;
}

/* Update password button */
#cp-submit-btn {
  margin-top: 6px;
  height: 44px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  background: linear-gradient(135deg, #7c2d12, #dc2626);
  color: white;
  border: none;

  transition: transform 0.15s ease, opacity 0.15s ease;
}


#cp-submit-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

#cp-submit-btn:active {
  transform: scale(0.98);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
}

.toggle-password:hover {
  color: #e5e7eb;
}
/* ===============================
   INVITE USERS – FINAL DARK THEME
   =============================== */

.invite-section {
  padding-top: 6px;
}

/* ---------- CARD ---------- */

.invite-card {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.02)
  );
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.invite-label {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.invite-code {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1.4px;
}

.invite-timer {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

/* ---------- CONTROLS ---------- */

.invite-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.invite-pill {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.invite-pill span {
  font-size: 11px;
  opacity: 0.6;
  display: block;
  margin-bottom: 4px;
}

/* ---------- DARK SELECT (FIXED) ---------- */

.invite-select {
  width: 100%;
  background-color: transparent;
  color: #e5e7eb;
  border: none;
  font-size: 14px;
  outline: none;
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.7) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 55%,
    calc(100% - 8px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

/* FORCE DROPDOWN LIST DARK */
.invite-select option {
  background-color: #0f172a;
  color: #e5e7eb;
}

/* ---------- NUMBER INPUT (CLEAN) ---------- */

.invite-pill input {
  width: 100%;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 14px;
  outline: none;
}

/* REMOVE SPIN BUTTONS */
.invite-pill input[type=number]::-webkit-inner-spin-button,
.invite-pill input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.invite-pill input[type=number] {
  -moz-appearance : textfield;
}

/* ---------- ACTIONS ---------- */

.invite-actions {
  display: flex;
  justify-content: center;
}

/* PRIMARY BUTTON */
.invite-primary {
  background: linear-gradient(
    135deg,
    #22c55e,
    #16a34a
  );
  color: #022c22;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow:
    0 6px 18px rgba(34,197,94,0.25);
}

/* COPY / SHARE */
.invite-secondary {
  display: flex;
  gap: 12px;
}

.invite-secondary button {
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
/* ===============================
   INVITE BUTTON HOVER EFFECTS
   =============================== */

/* PRIMARY – Generate Invite Code */
.invite-primary {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.invite-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 26px rgba(34,197,94,0.35);
  filter: brightness(1.05);
}

.invite-primary:active {
  transform: translateY(0);
  box-shadow:
    0 6px 18px rgba(34,197,94,0.25);
}

/* SECONDARY – Copy / Share */
.invite-secondary button {
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.invite-secondary button:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.invite-secondary button:active {
  transform: translateY(0);
  background: rgba(255,255,255,0.08);
}
/* ===============================
   INVITE INPUT POLISH
   =============================== */

.invite-controls {
  margin-top: 16px;
}

/* Shared input style */
.invite-controls select,
.invite-controls input[type="number"] {
  width: 100%;
  height: 44px; /* ⬅️ makes it feel solid */
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;

  background: rgba(255,255,255,0.06);
  color: #fff;

  border: 1px solid rgba(255,255,255,0.12);
  outline: none;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.invite-controls select:focus,
.invite-controls input[type="number"]:focus {
  border-color: #22c55e;
  background: rgba(255,255,255,0.08);
}

/* Small label above inputs */
.invite-controls label {
  display: block;
  font-size: 11px;
  opacity: 0.65;
  margin-bottom: 6px;
}

.invite-uses {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}
