/**
 * UAP Pro — Public Stylesheet
 *
 * CSS-custom-property-driven design system with dark/light theming,
 * glassmorphism player bar, premium playlist browser, micro-animations.
 *
 * @package UAP_Pro
 */

/* ═══════════════════════════════════════════════════════════
   1. DESIGN TOKENS (CSS Custom Properties)
   ═══════════════════════════════════════════════════════════ */

:root,
[data-uap-theme="dark"] {
    /* Surfaces */
    --uap-bg:           #0a0a0c;
    --uap-surface:      #141416;
    --uap-surface-2:    #1c1c1e;
    --uap-surface-3:    #2c2c2e;
    --uap-glass:        rgba(20, 20, 22, 0.82);
    --uap-glass-border: rgba(255, 255, 255, 0.06);

    /* Text */
    --uap-text:         #f5f5f7;
    --uap-text-2:       #a1a1a6;
    --uap-text-3:       #636366;

    /* Accent (overridden via inline style from PHP) */
    --uap-accent:       #ff5500;
    --uap-accent-glow:  rgba(255, 85, 0, 0.35);
    --uap-accent-soft:  rgba(255, 85, 0, 0.12);

    /* Borders & shadows */
    --uap-border:       rgba(255, 255, 255, 0.08);
    --uap-shadow:       0 -4px 32px rgba(0, 0, 0, 0.5);
    --uap-card-shadow:  0 2px 12px rgba(0, 0, 0, 0.4);

    /* Radius */
    --uap-radius-sm:    6px;
    --uap-radius:       10px;
    --uap-radius-lg:    16px;
    --uap-radius-full:  9999px;

    /* Transitions */
    --uap-transition:   200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --uap-transition-fast: 120ms ease;

    /* Z-layers */
    --uap-z-bar:        99990;
    --uap-z-queue:      99989;
    --uap-z-loading:    99999;

    /* Spacing */
    --uap-bar-height:   72px;
    --uap-bar-progress: 4px;
}

[data-uap-theme="light"] {
    --uap-bg:           #f5f5f7;
    --uap-surface:      #ffffff;
    --uap-surface-2:    #f0f0f2;
    --uap-surface-3:    #e5e5ea;
    --uap-glass:        rgba(255, 255, 255, 0.85);
    --uap-glass-border: rgba(0, 0, 0, 0.06);

    --uap-text:         #1d1d1f;
    --uap-text-2:       #6e6e73;
    --uap-text-3:       #aeaeb2;

    --uap-accent-glow:  rgba(255, 85, 0, 0.2);
    --uap-accent-soft:  rgba(255, 85, 0, 0.08);

    --uap-border:       rgba(0, 0, 0, 0.08);
    --uap-shadow:       0 -4px 32px rgba(0, 0, 0, 0.08);
    --uap-card-shadow:  0 2px 12px rgba(0, 0, 0, 0.06);
}


/* ═══════════════════════════════════════════════════════════
   2. SPA LOADING BAR
   ═══════════════════════════════════════════════════════════ */

.uap-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--uap-accent), #ff8c42, var(--uap-accent));
    background-size: 200% 100%;
    z-index: var(--uap-z-loading);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.uap-loading-bar.active {
    opacity: 1;
    width: 85%;
    transition: width 8s cubic-bezier(0.1, 0.5, 0.3, 1), opacity 0.2s;
    animation: uap-loading-shimmer 1.5s linear infinite;
}

.uap-loading-bar.done {
    width: 100%;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.4s 0.2s ease;
}

@keyframes uap-loading-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════════════════════════
   3. PLAYER BAR — Fixed Bottom
   ═══════════════════════════════════════════════════════════ */

.uap-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--uap-z-bar);
    height: var(--uap-bar-height);
    background: var(--uap-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid var(--uap-glass-border);
    box-shadow: var(--uap-shadow);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: var(--uap-text);
    contain: layout style;
}

.uap-player-bar.visible {
    transform: translateY(0);
}

/* Add bottom padding to body when player is active */
body.uap-player-active {
    padding-bottom: calc(var(--uap-bar-height) + 8px);
}

/* ── Inner layout ───────────────────────────────────────── */

.uap-player-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 0 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ── Progress bar (top of player bar) ───────────────────── */

.uap-progress-top {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: var(--uap-bar-progress);
    cursor: pointer;
}

.uap-progress-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--uap-surface-3);
    overflow: visible;
    transition: height var(--uap-transition-fast);
}

.uap-progress-top:hover .uap-progress-wrap {
    height: 6px;
    top: -1px;
}

.uap-progress-loaded {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--uap-surface-3);
    opacity: 0.5;
    transition: width 0.3s linear;
}

.uap-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--uap-accent), #ff8c42);
    box-shadow: 0 0 8px var(--uap-accent-glow);
    transition: width 0.15s linear;
    border-radius: 0 2px 2px 0;
}

.uap-progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--uap-accent);
    box-shadow: 0 0 6px var(--uap-accent-glow);
    transform: translate(0, -50%) scale(0);
    transition: transform var(--uap-transition-fast);
    pointer-events: none;
}

.uap-progress-top:hover .uap-progress-handle {
    transform: translate(0, -50%) scale(1);
}


/* ── Artwork ────────────────────────────────────────────── */

.uap-artwork {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--uap-radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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


/* ── Track info ─────────────────────────────────────────── */

.uap-track-info {
    flex: 0 1 200px;
    min-width: 0;
    overflow: hidden;
}

.uap-track-title-wrap {
    overflow: hidden;
    white-space: nowrap;
}

.uap-track-title {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--uap-text);
    white-space: nowrap;
}

/* Marquee animation for overflowing titles */
.uap-track-title-wrap:hover .uap-track-title {
    animation: uap-marquee 8s linear infinite;
}

@keyframes uap-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.uap-track-artist {
    display: block;
    font-size: 12px;
    color: var(--uap-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}


/* ── Controls ───────────────────────────────────────────── */

.uap-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.uap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--uap-text-2);
    cursor: pointer;
    border-radius: var(--uap-radius-full);
    transition: all var(--uap-transition);
    padding: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.uap-btn:hover {
    color: var(--uap-text);
    background: var(--uap-accent-soft);
}

.uap-btn:active {
    transform: scale(0.92);
}

/* Play button — larger, accent background */
.uap-btn-play {
    width: 44px;
    height: 44px;
    background: var(--uap-accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--uap-accent-glow);
}

.uap-btn-play:hover {
    background: var(--uap-accent);
    color: #fff;
    box-shadow: 0 4px 20px var(--uap-accent-glow);
    transform: scale(1.06);
}

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

/* Show/hide play/pause icons */
.uap-btn-play .uap-icon-pause { display: none; }
.uap-btn-play .uap-icon-play  { display: block; }

.uap-btn-play[data-state="playing"] .uap-icon-pause { display: block; }
.uap-btn-play[data-state="playing"] .uap-icon-play  { display: none; }

/* Active state for shuffle/repeat */
.uap-btn-shuffle.active,
.uap-btn-repeat.active {
    color: var(--uap-accent);
}

/* Repeat badge (shows "1" for repeat-one) */
.uap-repeat-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 8px;
    font-weight: 700;
    color: var(--uap-accent);
    display: none;
}

.uap-btn-repeat[data-mode="one"] .uap-repeat-badge {
    display: block;
}


/* ── Time display ───────────────────────────────────────── */

.uap-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--uap-text-3);
    flex-shrink: 0;
    min-width: 90px;
    justify-content: center;
}

.uap-time-sep {
    opacity: 0.4;
}


/* ── Volume ─────────────────────────────────────────────── */

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

.uap-volume-wrap {
    width: 80px;
    height: 4px;
    background: var(--uap-surface-3);
    border-radius: var(--uap-radius-full);
    cursor: pointer;
    position: relative;
    transition: height var(--uap-transition-fast);
}

.uap-volume-wrap:hover {
    height: 6px;
}

.uap-volume-fill {
    height: 100%;
    width: 80%;
    background: var(--uap-accent);
    border-radius: var(--uap-radius-full);
    transition: width 0.1s linear;
}

/* Volume icon states */
.uap-btn-mute .uap-icon-vol-low,
.uap-btn-mute .uap-icon-vol-muted {
    display: none;
}

.uap-btn-mute[data-level="low"] .uap-icon-vol-high  { display: none; }
.uap-btn-mute[data-level="low"] .uap-icon-vol-low   { display: block; }

.uap-btn-mute[data-level="muted"] .uap-icon-vol-high  { display: none; }
.uap-btn-mute[data-level="muted"] .uap-icon-vol-muted { display: block; }


/* ── Queue panel ────────────────────────────────────────── */

.uap-queue-panel {
    position: fixed;
    bottom: var(--uap-bar-height);
    right: 16px;
    width: 360px;
    max-height: 420px;
    background: var(--uap-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--uap-glass-border);
    border-radius: var(--uap-radius-lg) var(--uap-radius-lg) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
    z-index: var(--uap-z-queue);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.25s ease;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.uap-queue-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.uap-queue-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--uap-border);
}

.uap-queue-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--uap-text);
}

.uap-queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.uap-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background var(--uap-transition-fast);
    font-size: 13px;
}

.uap-queue-item:hover {
    background: var(--uap-accent-soft);
}

.uap-queue-num {
    color: var(--uap-text-3);
    font-variant-numeric: tabular-nums;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.uap-queue-title {
    flex: 1;
    color: var(--uap-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uap-queue-artist {
    color: var(--uap-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.uap-queue-dur {
    color: var(--uap-text-3);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════
   4. PLAYLIST BROWSER
   ═══════════════════════════════════════════════════════════ */

.uap-playlist-browser {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: var(--uap-text);
    padding: 24px 0;
}


/* ── Tabs ───────────────────────────────────────────────── */

.uap-browser-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--uap-border);
}

.uap-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--uap-text-2);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color var(--uap-transition);
}

.uap-tab:hover {
    color: var(--uap-text);
}

.uap-tab.active {
    color: var(--uap-accent);
}

.uap-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--uap-accent);
    border-radius: 2px 2px 0 0;
}


/* ── Toolbar ────────────────────────────────────────────── */

.uap-browser-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.uap-search-wrap {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.uap-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--uap-text-3);
    pointer-events: none;
}

.uap-browser-search {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--uap-border);
    border-radius: var(--uap-radius);
    background: var(--uap-surface);
    color: var(--uap-text);
    font-size: 14px;
    transition: border-color var(--uap-transition), box-shadow var(--uap-transition);
    outline: none;
}

.uap-browser-search:focus {
    border-color: var(--uap-accent);
    box-shadow: 0 0 0 3px var(--uap-accent-soft);
}

.uap-browser-search::placeholder {
    color: var(--uap-text-3);
}

.uap-view-toggle {
    display: flex;
    gap: 2px;
    background: var(--uap-surface);
    border-radius: var(--uap-radius-sm);
    padding: 2px;
    border: 1px solid var(--uap-border);
}

.uap-view-btn {
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: var(--uap-text-3);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--uap-transition-fast);
    display: inline-flex;
    align-items: center;
}

.uap-view-btn.active {
    background: var(--uap-accent);
    color: #fff;
}


/* ── Genre filter chips ─────────────────────────────────── */

.uap-browser-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.uap-genre-chip {
    padding: 6px 14px;
    border: 1px solid var(--uap-border);
    border-radius: var(--uap-radius-full);
    background: var(--uap-surface);
    color: var(--uap-text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--uap-transition);
    white-space: nowrap;
}

.uap-genre-chip:hover {
    border-color: var(--uap-accent);
    color: var(--uap-accent);
}

.uap-genre-chip.active {
    background: var(--uap-accent);
    border-color: var(--uap-accent);
    color: #fff;
}


/* ── Grid view ──────────────────────────────────────────── */

.uap-browser-grid[data-view="grid"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}


/* ── List view ──────────────────────────────────────────── */

.uap-browser-grid[data-view="list"] {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uap-browser-grid[data-view="list"] .uap-playlist-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.uap-browser-grid[data-view="list"] .uap-card-artwork {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--uap-radius-sm);
}

.uap-browser-grid[data-view="list"] .uap-card-info {
    flex: 1;
    padding: 0;
}

.uap-browser-grid[data-view="list"] .uap-card-title {
    font-size: 14px;
}


/* ── Playlist card ──────────────────────────────────────── */

.uap-playlist-card {
    background: var(--uap-surface);
    border-radius: var(--uap-radius);
    overflow: hidden;
    border: 1px solid var(--uap-border);
    box-shadow: var(--uap-card-shadow);
    transition: transform var(--uap-transition),
                box-shadow var(--uap-transition),
                border-color var(--uap-transition);
    cursor: default;
}

.uap-playlist-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--uap-accent-soft);
}

[data-uap-theme="light"] .uap-playlist-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}


/* ── Card artwork ───────────────────────────────────────── */

.uap-card-artwork {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--uap-surface-2);
}

.uap-card-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.uap-playlist-card:hover .uap-card-artwork img {
    transform: scale(1.05);
}

.uap-card-artwork-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--uap-text-3);
}


/* ── Card play button (overlay) ─────────────────────────── */

.uap-card-play-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--uap-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--uap-accent-glow);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease,
                transform 0.25s ease,
                box-shadow 0.2s ease;
}

.uap-playlist-card:hover .uap-card-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.uap-card-play-btn:hover {
    box-shadow: 0 6px 24px var(--uap-accent-glow);
    transform: scale(1.08);
}

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


/* ── Card info ──────────────────────────────────────────── */

.uap-card-info {
    padding: 14px 16px;
}

.uap-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--uap-text);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uap-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--uap-text-3);
}

.uap-card-genre {
    background: var(--uap-accent-soft);
    color: var(--uap-accent);
    padding: 2px 8px;
    border-radius: var(--uap-radius-full);
    font-weight: 500;
}


/* ── Loading / Empty states ─────────────────────────────── */

.uap-browser-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--uap-text-3);
    font-size: 14px;
}

.uap-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--uap-surface-3);
    border-top-color: var(--uap-accent);
    border-radius: 50%;
    animation: uap-spin 0.7s linear infinite;
}

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

.uap-browser-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--uap-text-3);
    font-size: 15px;
}

.uap-scroll-sentinel {
    height: 1px;
    visibility: hidden;
}


/* ═══════════════════════════════════════════════════════════
   5. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .uap-player-bar {
        --uap-bar-height: 64px;
    }

    .uap-player-inner {
        gap: 10px;
        padding: 0 12px;
    }

    /* Hide non-essential controls on mobile */
    .uap-btn-shuffle,
    .uap-btn-repeat,
    .uap-btn-queue,
    .uap-volume,
    .uap-time {
        display: none;
    }

    .uap-track-info {
        flex: 1;
    }

    .uap-controls {
        gap: 2px;
    }

    /* Browser */
    .uap-browser-grid[data-view="grid"] {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .uap-browser-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .uap-search-wrap {
        max-width: none;
    }

    .uap-browser-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .uap-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Queue panel fullscreen on mobile */
    .uap-queue-panel {
        width: 100%;
        right: 0;
        max-height: 60vh;
        border-radius: var(--uap-radius-lg) var(--uap-radius-lg) 0 0;
    }
}

@media (max-width: 480px) {
    .uap-artwork {
        width: 40px;
        height: 40px;
    }

    .uap-btn-prev,
    .uap-btn-next {
        width: 32px;
        height: 32px;
    }

    .uap-btn-play {
        width: 40px;
        height: 40px;
    }

    .uap-browser-grid[data-view="grid"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .uap-card-info {
        padding: 10px 12px;
    }

    .uap-card-title {
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════════
   6. REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .uap-player-bar,
    .uap-queue-panel,
    .uap-card-play-btn,
    .uap-playlist-card,
    .uap-loading-bar {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .uap-track-title-wrap:hover .uap-track-title {
        animation: none;
    }
}


/* ═══════════════════════════════════════════════════════════
   7. PRINT — Hide player
   ═══════════════════════════════════════════════════════════ */

@media print {
    .uap-player-bar,
    .uap-loading-bar,
    .uap-queue-panel {
        display: none !important;
    }

    body.uap-player-active {
        padding-bottom: 0 !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   8. TRACK CARDS & INLINE TRACK LIST
   ═══════════════════════════════════════════════════════════ */

/* ── Track card (standalone) ──────────────────────────── */

.uap-track-card {
    background: var(--uap-surface);
    border: 1px solid var(--uap-border);
    border-radius: var(--uap-radius);
    overflow: hidden;
    transition: transform var(--uap-transition), box-shadow var(--uap-transition);
    cursor: default;
}

.uap-track-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--uap-card-shadow);
}

.uap-card-artwork--track {
    aspect-ratio: 1;
    position: relative;
}

.uap-card-artist {
    margin: 0;
    font-size: 0.8rem;
    color: var(--uap-text-2);
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── Expand button on playlist cards ─────────────────── */

.uap-card-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--uap-accent);
    background: var(--uap-accent-soft);
    border: none;
    border-radius: var(--uap-radius-full);
    cursor: pointer;
    transition: background var(--uap-transition), color var(--uap-transition);
}

.uap-card-expand-btn:hover {
    background: var(--uap-accent);
    color: #fff;
}

.uap-card-expand-btn svg {
    transition: transform var(--uap-transition);
}

/* ── Inline tracklist (accordion) ────────────────────── */

.uap-inline-tracklist {
    border-top: 1px solid var(--uap-border);
    padding: 8px 12px;
    max-height: 320px;
    overflow-y: auto;
    animation: uap-tracklist-in 200ms ease;
}

.uap-inline-tracklist.collapsed {
    display: none;
}

@keyframes uap-tracklist-in {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 320px;
    }
}

.uap-tracklist-loading,
.uap-tracklist-empty {
    padding: 12px 0;
    text-align: center;
    color: var(--uap-text-3);
    font-size: 0.8rem;
}

.uap-tracklist-ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.uap-tracklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: var(--uap-radius-sm);
    transition: background var(--uap-transition-fast);
}

.uap-tracklist-item:hover {
    background: var(--uap-accent-soft);
}

.uap-tracklist-play {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--uap-surface-3);
    color: var(--uap-text);
    cursor: pointer;
    transition: background var(--uap-transition), color var(--uap-transition);
}

.uap-tracklist-play:hover {
    background: var(--uap-accent);
    color: #fff;
}

.uap-tracklist-num {
    flex-shrink: 0;
    width: 20px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--uap-text-3);
    font-variant-numeric: tabular-nums;
}

.uap-tracklist-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.uap-tracklist-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--uap-text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.uap-tracklist-artist {
    font-size: 0.7rem;
    color: var(--uap-text-3);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.uap-tracklist-dur {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--uap-text-3);
    font-variant-numeric: tabular-nums;
}

/* ── Scrollbar for inline tracklist ──────────────────── */

.uap-inline-tracklist::-webkit-scrollbar {
    width: 4px;
}

.uap-inline-tracklist::-webkit-scrollbar-track {
    background: transparent;
}

.uap-inline-tracklist::-webkit-scrollbar-thumb {
    background: var(--uap-surface-3);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   9. PLAYER POSITIONS & CONTROL VISIBILITY TOGGLES
   ═══════════════════════════════════════════════════════════ */

/* Top bar position */
.uap-player-bar--top {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--uap-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.uap-player-position-top {
    padding-bottom: 0 !important;
    padding-top: 72px !important;
}

/* Floating Dock position */
.uap-player-bar--dock {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 960px;
    border-radius: var(--uap-radius-lg);
    border: 1px solid var(--uap-glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Control visibility toggles */
.uap-hide-artwork .uap-bar-artwork,
.uap-hide-artwork .uap-bar-artwork-placeholder {
    display: none !important;
}

.uap-hide-volume .uap-volume-control {
    display: none !important;
}

.uap-hide-time .uap-bar-time {
    display: none !important;
}

.uap-hide-queue .uap-queue-toggle-btn {
    display: none !important;
}

.uap-hide-shuffle .uap-shuffle-btn,
.uap-hide-shuffle .uap-repeat-btn {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════
   10. MEMBERPRESS GATE MODAL POPUP
   ═══════════════════════════════════════════════════════════ */

.uap-gate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--uap-transition), visibility var(--uap-transition);
}

.uap-gate-modal.uap-gate-modal--active {
    opacity: 1;
    visibility: visible;
}

.uap-gate-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.uap-gate-modal-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    background: var(--uap-surface);
    border: 1px solid var(--uap-glass-border);
    border-radius: var(--uap-radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    transform: scale(0.92);
    transition: transform var(--uap-transition);
}

.uap-gate-modal.uap-gate-modal--active .uap-gate-modal-card {
    transform: scale(1);
}

.uap-gate-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--uap-text-2);
    cursor: pointer;
    transition: color var(--uap-transition-fast);
}

.uap-gate-modal-close:hover {
    color: var(--uap-text);
}

.uap-gate-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--uap-accent-soft);
    color: var(--uap-accent);
    margin-bottom: 16px;
}

.uap-gate-modal-title {
    margin: 0 0 10px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--uap-text);
}

.uap-gate-modal-message {
    margin: 0 0 24px 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--uap-text-2);
}

.uap-gate-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uap-gate-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--uap-radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--uap-transition-fast);
}

.uap-gate-modal-btn--primary {
    background: var(--uap-accent);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 16px var(--uap-accent-glow);
}

.uap-gate-modal-btn--primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.uap-gate-modal-btn--secondary {
    background: transparent;
    color: var(--uap-text-2);
    border: 1px solid var(--uap-border);
}

.uap-gate-modal-btn--secondary:hover {
    background: var(--uap-surface-2);
    color: var(--uap-text);
}

