/* SPDX-FileCopyrightText: 2026 Sandro Santilli */
/* SPDX-License-Identifier: AGPL-3.0-or-later */

/**
 * Mini Player Styles
 * 
 * The mini-player is a fixed-position audio player that persists across
 * soft-navigation page transitions. It provides basic playback controls
 * and track information.
 */

/* ============================================
   MINI PLAYER CONTAINER
   ============================================ */

.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    direction: ltr;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    pointer-events: none;
}

.mini-player.active {
    transform: translateY(0);
    pointer-events: auto;
}

.mini-player .mini-player-inner {
    -webkit-backdrop-filter: blur(8px) brightness(60%);
    backdrop-filter: blur(8px) brightness(60%);
    background: var(--bg-1-overlay, rgba(0, 0, 0, 0.85));
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.mini-player .progress-bar {
    position: relative;
    height: 8px;
    cursor: pointer;
    overflow: visible;
    transition: height 0.15s ease;
}

.mini-player .progress-bar:hover {
    height: 12px;
}

.mini-player .progress-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.mini-player .progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--bg-3, rgba(255, 255, 255, 0.2));
    width: 0%;
    transition: width 0.2s ease;
}

.mini-player .progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--mg-acc, var(--accent, #ff6b35));
    width: 0%;
}

.mini-player .progress-input {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 30px;
    transform: translateY(-50%);
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.mini-player .progress-bar:hover .progress-input {
    height: 38px;
}

.mini-player .progress-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 0;
}

.mini-player .progress-input::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 0;
}

/* ============================================
   CONTROLS ROW
   ============================================ */

.mini-player .controls {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    gap: 0.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.mini-player button {
    background: none;
    border: none;
    color: var(--fg-1, #fff);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mini-player button:hover,
.mini-player button:focus-visible {
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
    color: var(--fg-2, #fff);
}

.mini-player button:active {
    background: var(--bg-3, rgba(255, 255, 255, 0.15));
}

.mini-player button[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.mini-player button svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

.mini-player .btn-playback svg {
    width: 2rem;
    height: 2rem;
}

/* Shuffle and Repeat buttons */
.mini-player .btn-shuffle,
.mini-player .btn-repeat {
    opacity: 0.5;
}

.mini-player .btn-shuffle:hover,
.mini-player .btn-repeat:hover {
    opacity: 0.8;
}

.mini-player .btn-shuffle.active,
.mini-player .btn-repeat.active {
    opacity: 1;
    color: var(--mg-acc, var(--accent, #ff6b35));
}

.mini-player .btn-shuffle svg,
.mini-player .btn-repeat svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* ============================================
   TRACK INFO
   ============================================ */

.mini-player .track-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.mini-player .track-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--fg-1, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player .track-artist {
    font-size: 0.8rem;
    color: var(--fg-3, rgba(255, 255, 255, 0.6));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player .track-title a,
.mini-player .track-artist a {
    color: inherit;
    text-decoration: none;
}

.mini-player .track-title a:hover,
.mini-player .track-artist a:hover {
    text-decoration: underline;
}

/* ============================================
   TIME DISPLAY
   ============================================ */

.mini-player .time-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--fg-3, rgba(255, 255, 255, 0.6));
}

.mini-player .time-current {
    color: var(--fg-1, #fff);
}

.mini-player .time-separator {
    opacity: 0.5;
}

/* ============================================
   QUEUE INDICATOR
   ============================================ */

.mini-player .queue-indicator {
    font-size: 0.75rem;
    color: var(--fg-3, rgba(255, 255, 255, 0.5));
    padding: 0.2rem 0.5rem;
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
    border-radius: 0.8rem;
}

/* ============================================
   LOADING STATE
   ============================================ */

.mini-player.loading .btn-playback svg {
    animation: mini-player-spin 1s linear infinite;
}

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

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 480px) {
    .mini-player .progress-input {
        height: 42px;
    }

    .mini-player .controls {
        padding: 0.4rem 0.5rem;
        gap: 0.3rem;
    }
    
    .mini-player button svg {
        width: 1.3rem;
        height: 1.3rem;
    }
    
    .mini-player .btn-playback svg {
        width: 1.8rem;
        height: 1.8rem;
    }
    
    .mini-player .time-display {
        font-size: 0.75rem;
    }
    
    .mini-player .track-title {
        font-size: 0.85rem;
    }
    
    .mini-player .track-artist {
        font-size: 0.7rem;
    }
    
    /* Hide queue indicator on small screens */
    .mini-player .queue-indicator {
        display: none;
    }
    
    /* Smaller shuffle/repeat buttons on mobile */
    .mini-player .btn-shuffle svg,
    .mini-player .btn-repeat svg {
        width: 1rem;
        height: 1rem;
    }
}

@media (hover: none), (pointer: coarse) {
    .mini-player .progress-input {
        height: 44px;
    }
}

/* ============================================
   BODY PADDING WHEN PLAYER ACTIVE
   ============================================ */

body.soft-nav-player-active {
    padding-bottom: 65px !important; /* Height of mini-player */
}

@media (max-width: 480px) {
    body.soft-nav-player-active {
        padding-bottom: 58px !important;
    }
}

/* ============================================
   TRANSITION STATES FOR SOFT NAVIGATION
   ============================================ */

.swup-transition-fade .mini-player {
    /* Mini player doesn't fade during transitions */
    transition: none !important;
    transform: translateY(0) !important;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.mini-player button:focus-visible {
    outline: 2px solid var(--mg-acc, var(--accent, #ff6b35));
    outline-offset: 2px;
}

.mini-player .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;
}

/* ============================================
   DARK/LIGHT THEME SUPPORT
   ============================================ */

@media (prefers-color-scheme: light) {
    .mini-player .mini-player-inner {
        background: var(--bg-1-overlay, rgba(255, 255, 255, 0.95));
    }
}

/* ============================================
   SHUFFLE PLAY BUTTON
   ============================================ */

.shuffle-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.5em 0.75em;
    margin-left: 0.5em;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    background: var(--bg-2, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--mg-1, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.shuffle-play-btn:hover {
    background: var(--bg-acc, var(--accent, #ff6b35));
    border-color: var(--mg-acc, var(--accent, #ff6b35));
}

.shuffle-play-btn:active {
    transform: scale(0.98);
}

.shuffle-play-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.shuffle-play-btn.loading svg {
    animation: shuffle-spin 1s linear infinite;
}

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

.shuffle-play-btn svg {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
}

/* ============================================
   TRACK MENU BUTTON
   ============================================ */

.track-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75em;
    height: 1.75em;
    padding: 0;
    margin-left: 0.5em;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s;
}

.track-menu-btn:hover {
    opacity: 1;
    background: var(--bg-2, rgba(0, 0, 0, 0.1));
}

.track-menu-btn svg {
    width: 1.2em;
    height: 1.2em;
    fill: currentColor;
}

/* ============================================
   TRACK CONTEXT MENU
   ============================================ */

.track-context-menu {
    position: fixed;
    z-index: 10001;
    min-width: 200px;
    padding: 0.5rem 0;
    background: var(--bg-1, #1a1a1a);
    border: 1px solid var(--mg-1, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.track-context-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.track-context-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    color: var(--fg-1, #fff);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.track-context-menu .menu-item:hover {
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.track-context-menu .menu-item:focus {
    outline: none;
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.track-context-menu .menu-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
}

.track-context-menu .menu-item .icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.track-context-menu .menu-item .label {
    flex: 1;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.soft-nav-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 10002;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: var(--fg-1, #fff);
    background: var(--bg-1, #1a1a1a);
    border: 1px solid var(--mg-1, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.soft-nav-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Light theme support */
@media (prefers-color-scheme: light) {
    .track-context-menu {
        background: var(--bg-1, #fff);
        border-color: var(--mg-1, rgba(0, 0, 0, 0.15));
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .track-context-menu .menu-item {
        color: var(--fg-1, #000);
    }
    
    .track-context-menu .menu-item:hover {
        background: var(--bg-2, rgba(0, 0, 0, 0.05));
    }
    
    .soft-nav-notification {
        background: var(--bg-1, #fff);
        color: var(--fg-1, #000);
        border-color: var(--mg-1, rgba(0, 0, 0, 0.15));
    }
}

/* ============================================
   VOLUME CONTROL
   ============================================ */

.mini-player .volume-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mini-player .btn-volume {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--fg-2, rgba(255, 255, 255, 0.8));
    transition: color 0.2s, background 0.2s;
}

.mini-player .btn-volume:hover {
    color: var(--fg-1, #fff);
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.mini-player .btn-volume.muted {
    color: var(--fg-3, rgba(255, 255, 255, 0.5));
}

.mini-player .btn-volume svg {
    width: 1.25em;
    height: 1.25em;
    fill: currentColor;
}

.mini-player .volume-slider-container {
    position: static;
    transform: none;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
}

.mini-player .volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 5.2rem;
    height: 4px;
    background: var(--bg-3, rgba(255, 255, 255, 0.2));
    border-radius: 2px;
    cursor: pointer;
    transform: none;
    transform-origin: center;
}

.mini-player .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--fg-1, #fff);
    border-radius: 50%;
    cursor: pointer;
}

.mini-player .volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--fg-1, #fff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

@media (max-width: 640px) {
    .mini-player .volume-slider {
        width: 3.8rem;
    }
}

/* ============================================
   QUEUE BUTTON
   ============================================ */

.mini-player .btn-queue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--fg-2, rgba(255, 255, 255, 0.8));
    transition: color 0.2s, background 0.2s;
}

.mini-player .btn-queue:hover {
    color: var(--fg-1, #fff);
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.mini-player .btn-queue.active {
    color: var(--acc, #ff6b35);
}

.mini-player .btn-queue svg {
    width: 1.25em;
    height: 1.25em;
    fill: currentColor;
}

/* ============================================
   QUEUE PANEL
   ============================================ */

.queue-panel {
    position: fixed;
    right: 1rem;
    bottom: 75px;
    width: 360px;
    max-width: calc(100vw - 2rem);
    max-height: 60vh;
    background: var(--bg-1, #1a1a1a);
    border: 1px solid var(--mg-1, rgba(255, 255, 255, 0.15));
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.queue-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.queue-panel-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 1rem;
    border-bottom: 1px solid var(--mg-1, rgba(255, 255, 255, 0.1));
}

.queue-panel-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--fg-1, #fff);
}

.queue-panel-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.queue-panel-controls .btn-clear-queue {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--fg-2, rgba(255, 255, 255, 0.7));
    background: transparent;
    border: 1px solid var(--mg-1, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.queue-panel-controls .btn-mixtape-queue {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--fg-2, rgba(255, 255, 255, 0.7));
    background: transparent;
    border: 1px solid var(--mg-1, rgba(255, 255, 255, 0.2));
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.queue-panel-controls .btn-clear-queue:hover,
.queue-panel-controls .btn-mixtape-queue:hover {
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
    color: var(--fg-1, #fff);
}

.queue-panel-controls .btn-close-queue {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    background: linear-gradient(145deg, rgba(255, 59, 48, 0.9), rgba(214, 40, 40, 0.95));
    border: 1px solid rgba(255, 120, 120, 0.9);
    border-radius: 999px;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 30, 30, 0.35), 0 6px 16px rgba(0, 0, 0, 0.35);
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.queue-panel-controls .btn-close-queue:hover,
.queue-panel-controls .btn-close-queue:focus-visible {
    color: #fff;
    background: linear-gradient(145deg, rgba(255, 82, 71, 1), rgba(230, 57, 70, 1));
    border-color: rgba(255, 180, 180, 1);
    box-shadow: 0 0 0 2px rgba(255, 82, 71, 0.4), 0 8px 22px rgba(230, 57, 70, 0.45);
    transform: scale(1.08);
}

.queue-panel-controls .btn-close-queue:active {
    transform: scale(0.98);
}

.queue-panel-controls .btn-close-queue svg {
    width: 1.35em;
    height: 1.35em;
    fill: currentColor;
}

.queue-item.current {
    scroll-margin-top: 2rem;
    scroll-margin-bottom: 2rem;
}

.queue-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.queue-section {
    margin-bottom: 1rem;
}

.queue-section h4 {
    margin: 0 0 0.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-3, rgba(255, 255, 255, 0.5));
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.queue-item:hover {
    background: var(--bg-2, rgba(255, 255, 255, 0.08));
}

.queue-item.current {
    background: var(--bg-acc-subtle, rgba(255, 107, 53, 0.15));
}

.queue-item.queue-item-played {
    opacity: 0.75;
}

.queue-item.queue-item-played .queue-item-number {
    color: var(--fg-3, rgba(255, 255, 255, 0.45));
}

.queue-item-drag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    color: var(--fg-3, rgba(255, 255, 255, 0.4));
    cursor: grab;
    flex-shrink: 0;
}

.queue-item-upcoming.drag-over {
    outline: 1px dashed var(--mg-acc, var(--accent, #ff6b35));
    background: var(--bg-acc-subtle, rgba(255, 107, 53, 0.12));
}

.queue-item-upcoming.dragging {
    opacity: 0.4;
}

.queue-item-drag svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.queue-item-number {
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--fg-3, rgba(201, 95, 95, 0.5));
}

.queue-item.current .queue-item-number {
    color: var(--acc, #ff6b35);
}

.queue-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.queue-item-title {
    display: block;
    font-size: 0.9rem;
    color: var(--fg-1, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    display: block;
    font-size: 0.8rem;
    color: var(--fg-3, rgba(255, 255, 255, 0.5));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--fg-3, rgba(255, 255, 255, 0.4));
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.queue-item-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.queue-item-move,
.queue-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.queue-item-move {
    color: var(--fg-3, rgba(255, 255, 255, 0.45));
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.queue-item:hover .queue-item-move,
.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-move:hover:not([disabled]) {
    color: var(--fg-1, #fff);
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.queue-item-move[disabled] {
    opacity: 0.35 !important;
    cursor: not-allowed;
}

.queue-item-move svg,
.queue-item-remove svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-remove:hover {
    color: var(--error, #f44336);
    background: var(--bg-2, rgba(255, 255, 255, 0.1));
}

.queue-item-remove svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.queue-empty {
    padding: 2rem 1rem;
    text-align: center;
}

.queue-empty p {
    margin: 0 0 0.5rem;
    color: var(--fg-2, rgba(255, 255, 255, 0.7));
}

.queue-empty .queue-hint {
    font-size: 0.85rem;
    color: var(--fg-3, rgba(255, 255, 255, 0.5));
}

/* Light theme support for queue panel */
@media (prefers-color-scheme: light) {
    .queue-panel {
        background: var(--bg-1, #fff);
        border-color: var(--mg-1, rgba(0, 0, 0, 0.15));
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }
    
    .queue-panel-header {
        border-bottom-color: var(--mg-1, rgba(0, 0, 0, 0.1));
    }
    
    .queue-panel-header h3 {
        color: var(--fg-1, #000);
    }
    
    .queue-item-title {
        color: var(--fg-1, #000);
    }
    
    .mini-player .volume-slider-container {
        background: var(--bg-1, #fff);
        border-color: var(--mg-1, rgba(0, 0, 0, 0.15));
    }
}

/* ── Mixtapes y cuenta (mixtapes.js, hub-account.js) ──────────────────────
   Va aquí porque mini-player.css lo cargan el portal y las páginas de
   artista; los colores salen de las variables de tema que definen los dos. */

/* `hidden` tiene que ganar a los `display: flex` de la biblioteca: la
   pestaña Mixtapes oculta los controles y el resumen de Abestiak. */
.offline-library [hidden] {
    display: none !important;
}

.offline-library-account {
    margin-left: auto;
    margin-right: .4rem;
    max-width: 14rem;
    overflow: hidden;
    padding: .25rem .7rem;
    font: inherit;
    font-size: .82rem;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--mg, rgba(127, 127, 127, .45));
    border-radius: 999px;
    cursor: pointer;
}

.offline-library-account:hover,
.offline-library-account:focus-visible {
    background: rgba(127, 127, 127, .18);
}

.mixtapes_account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: 0 0 .75rem;
    font-size: .82rem;
    opacity: .9;
}

.mixtapes_list {
    display: grid;
    gap: .6rem;
}

.mixtape-card {
    overflow: hidden;
    background: rgba(127, 127, 127, .06);
    border: 1px solid rgba(127, 127, 127, .28);
    border-radius: .6rem;
}

.mixtape-card.is-open {
    border-color: var(--portal-accent, var(--fg-3, currentColor));
}

.mixtape-card_head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .45rem .55rem;
}

.mixtape-card_toggle {
    display: flex;
    flex: 1 1 12rem;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.mixtape-card_text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mixtape-card_title {
    overflow: hidden;
    font-size: .95rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mixtape-card_meta {
    font-size: .76rem;
    opacity: .72;
}

.mixtape-card_actions {
    flex-wrap: wrap;
    margin-left: auto;
}

.mixtape-card_status {
    margin: 0 .6rem .5rem;
    font-size: .78rem;
    opacity: .8;
}

.mixtape-card_detail {
    padding: 0 .6rem .6rem;
}

.mixtape-card_shared {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .2rem 0 .5rem;
    font-size: .82rem;
    cursor: pointer;
}

/* Exportar la mixtape: .m3u, .jspf y, compartida, su feed (music-podcast-feeds-v1). */
.mixtape-card_export {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: .2rem 0 .6rem;
    font-size: .82rem;
}

.mixtape-card_export button,
.mixtape-card_export a {
    padding: .3rem .6rem;
    font-size: .8rem;
    line-height: 1.2;
}

.mixtape-card_tracks {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ⬆ de cada mixtape: un <label> con el <input type="file"> escondido. */
.mixtape-file-button {
    position: relative;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .45rem;
    font-size: .82rem;
    line-height: 1;
    background: rgba(127, 127, 127, .14);
    border: 1px solid rgba(127, 127, 127, .4);
    border-radius: .5rem;
    cursor: pointer;
}

.mixtape-file-button:hover,
.mixtape-file-button:focus-within {
    background: rgba(127, 127, 127, .26);
}

.mixtape-import-input {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.mixtape-file-button .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Mosaico de hasta cuatro portadas. */
.mixtape-mosaic {
    display: grid;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    overflow: hidden;
    background: rgba(127, 127, 127, .18);
    border-radius: .35rem;
}

.mixtape-mosaic img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}

.mixtape-mosaic--2,
.mixtape-mosaic--3,
.mixtape-mosaic--4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.mixtape-mosaic--2 img,
.mixtape-mosaic--3 img:first-child {
    grid-row: 1 / -1;
}

.mixtape-mosaic_glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Popovers (elegir mixtape, compartir). En pantallas estrechas, hoja abajo. */
.mixtape-popover {
    position: fixed;
    z-index: 10003;
    box-sizing: border-box;
    width: min(20rem, calc(100vw - 16px));
    max-height: min(28rem, calc(100vh - 16px));
    overflow: auto;
    padding: .75rem;
    font-size: .9rem;
    color: var(--fg-1, #fff);
    background: var(--bg-1, #1a1a1a);
    border: 1px solid var(--mg, rgba(255, 255, 255, .18));
    border-radius: .6rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
}

.mixtape-popover.is-sheet {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
}

.mixtape-picker_title {
    margin: 0 0 .25rem;
    font-weight: 700;
}

.mixtape-picker_status {
    margin: 0 0 .5rem;
    font-size: .8rem;
    opacity: .75;
}

.mixtape-picker_list {
    display: grid;
    gap: .25rem;
    max-height: 14rem;
    margin: 0 0 .5rem;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.mixtape-picker_option {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    padding: .45rem .55rem;
    font: inherit;
    color: inherit;
    text-align: left;
    background: rgba(127, 127, 127, .1);
    border: 1px solid transparent;
    border-radius: .4rem;
    cursor: pointer;
}

.mixtape-picker_option:hover,
.mixtape-picker_option:focus-visible {
    background: rgba(127, 127, 127, .22);
    border-color: var(--fg-3, rgba(255, 255, 255, .4));
}

.mixtape-picker_option-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mixtape-picker_option-count {
    font-variant-numeric: tabular-nums;
    opacity: .65;
}

.mixtape-picker_new {
    display: flex;
    gap: .4rem;
}

.mixtape-picker_input,
.mixtape-share_url,
.account-dialog_form input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: .4rem .5rem;
    font: inherit;
    color: inherit;
    background: rgba(127, 127, 127, .08);
    border: 1px solid rgba(127, 127, 127, .45);
    border-radius: .4rem;
}

.mixtape-picker_create,
.mixtape-share_actions button,
.mixtape-share_actions a,
.mixtape-card_export button,
.mixtape-card_export a,
.mixtape-dialog_actions button,
.mixtapes_account button,
.account-dialog_tabs button {
    padding: .4rem .7rem;
    font: inherit;
    font-size: .85rem;
    color: inherit;
    text-decoration: none;
    background: rgba(127, 127, 127, .14);
    border: 1px solid rgba(127, 127, 127, .45);
    border-radius: .4rem;
    cursor: pointer;
}

.mixtape-picker_create:hover,
.mixtape-share_actions button:hover,
.mixtape-share_actions a:hover,
.mixtape-card_export button:hover,
.mixtape-card_export a:hover,
.mixtape-dialog_actions button:hover,
.mixtapes_account button:hover,
.account-dialog_tabs button:hover {
    background: rgba(127, 127, 127, .26);
}

/* El feed de podcast de una mixtape compartida: con el icono y el borde
   naranjas de RSS, que se lee igual sobre fondo claro y oscuro. */
.mixtape-feed-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.mixtape-share_actions .mixtape-feed-link,
.mixtape-card_export .mixtape-feed-link {
    border-color: rgba(238, 128, 34, .75);
}

.mixtape-feed-link_icon {
    flex-shrink: 0;
    color: #ee8022;
}

.mixtape-share_url {
    width: 100%;
    margin-bottom: .5rem;
}

.mixtape-share_actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* Diálogos (mixtape compartida, cuenta): <dialog> modal. */
.mixtape-dialog {
    box-sizing: border-box;
    width: min(30rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 1.1rem;
    color: var(--fg-1, #fff);
    background: var(--bg-1, #1a1a1a);
    border: 1px solid var(--mg, rgba(255, 255, 255, .18));
    border-radius: .75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

.mixtape-dialog::backdrop {
    background: rgba(0, 0, 0, .55);
}

.mixtape-dialog_head {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: .75rem;
}

.mixtape-dialog .mixtape-mosaic {
    width: 84px;
    height: 84px;
}

.mixtape-dialog_kicker {
    margin: 0;
    font-size: .75rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .7;
}

.mixtape-dialog_title {
    margin: .1rem 0;
    font-size: 1.2rem;
}

.mixtape-dialog_meta {
    margin: 0;
    font-size: .85rem;
    opacity: .75;
}

.mixtape-dialog_tracks {
    max-height: 14rem;
    margin: 0 0 .5rem;
    padding-left: 1.4rem;
    overflow: auto;
    font-size: .88rem;
}

.mixtape-dialog_tracks li {
    margin: .15rem 0;
}

.mixtape-dialog_track-artist {
    margin-left: .4rem;
    opacity: .7;
}

.mixtape-dialog_more {
    margin: 0 0 .5rem;
    font-size: .82rem;
    opacity: .7;
}

.mixtape-dialog_actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.mixtape-dialog_actions .mixtape-dialog_primary,
.account-dialog_form .mixtape-dialog_primary {
    font-weight: 600;
    color: var(--fg-acc, #fff);
    background: var(--bg-acc, #444);
    border: 1px solid transparent;
    border-radius: .4rem;
    padding: .45rem .8rem;
    cursor: pointer;
}

.account-dialog_intro,
.account-dialog_reason {
    margin: .25rem 0 .75rem;
    font-size: .88rem;
}

.account-dialog_reason {
    font-weight: 600;
}

.account-dialog_note {
    margin: 0;
    font-size: .78rem;
    opacity: .7;
}

.account-dialog_tabs {
    display: flex;
    gap: .4rem;
    margin-bottom: .75rem;
}

.account-dialog_tabs button[aria-selected="true"] {
    font-weight: 600;
    background: rgba(127, 127, 127, .32);
}

.account-dialog_form {
    display: grid;
    gap: .6rem;
}

.account-dialog_form label {
    display: grid;
    gap: .25rem;
    font-size: .85rem;
}

.account-dialog_error {
    margin: .5rem 0 0;
    font-size: .85rem;
    color: var(--error, #ff8a80);
}

.mixtape-dialog_actions .account-dialog_danger {
    background: rgba(214, 64, 52, .22);
    border-color: rgba(214, 64, 52, .6);
}

@media (max-width: 600px) {
    .mixtape-card_actions {
        width: 100%;
        margin-left: 0;
    }
}
