/* =====================================================
   SPOTIFY-STYLE MINI PLAYER - PREMIUM REDESIGN
   ===================================================== */

.mini-player-spotify {
    position: fixed;
    bottom: calc(var(--bottom-nav-height, 70px) + var(--safe-area-bottom, 0px));
    left: 0;
    right: 0;
    height: 140px;
    z-index: 95;
    display: none;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
}

/* Background artwork with blur */
.mini-bg-artwork {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(30px) saturate(1.5);
    transform: scale(1.2);
    z-index: 0;
}

/* Dark overlay for readability */
.mini-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.5) 0%,
            rgba(0, 0, 0, 0.7) 50%,
            rgba(0, 0, 0, 0.85) 100%);
    z-index: 1;
}

/* Main content container */
.mini-main-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

/* Artwork container */
.mini-artwork-container {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.mini-artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Track info */
.mini-track-info {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.mini-track-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.mini-track-artist {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Device indicator - Spotify Connect style */
.mini-device-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    font-size: 0.7rem;
    color: #fff;
    flex-shrink: 0;
}

.mini-device-indicator i {
    font-size: 0.8rem;
    color: var(--gold, #d4af37);
}

/* Controls row */
.mini-controls-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 16px;
}

/* Control buttons */
.mini-ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.mini-ctrl-btn:hover {
    color: var(--gold, #d4af37);
    transform: scale(1.1);
}

.mini-ctrl-btn:active {
    transform: scale(0.95);
}

/* Play button - larger and styled */
.mini-ctrl-btn.play-btn {
    width: 48px;
    height: 48px;
    background: #fff;
    color: #000;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-ctrl-btn.play-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.08);
}

.mini-ctrl-btn.play-btn:active {
    transform: scale(0.95);
}

/* Gold theme for play button */
.mini-player-spotify.gold-theme .mini-ctrl-btn.play-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #000;
}

/* Progress bar container */
.mini-progress-container {
    flex: 1;
    padding: 0 8px;
}

.mini-progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: var(--gold, #d4af37);
    width: 0%;
    border-radius: 2px;
    transition: width 0.1s linear;
    position: relative;
}

/* Progress dot on hover */
.mini-progress-track::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.mini-progress-track:hover::after {
    opacity: 1;
}

/* Like button active state */
.mini-ctrl-btn.liked i {
    color: var(--gold, #d4af37);
}

.mini-ctrl-btn.liked i.far {
    font-weight: 900;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .mini-player-spotify {
        height: 130px;
    }

    .mini-artwork-container {
        width: 48px;
        height: 48px;
    }

    .mini-track-title {
        font-size: 0.9rem;
    }

    .mini-device-indicator {
        display: none;
    }

    .mini-ctrl-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .mini-ctrl-btn.play-btn {
        width: 42px;
        height: 42px;
    }
}

/* Hide old mini player styles conflict */
.mini-player:not(.mini-player-spotify) {
    display: none !important;
}

/* Safe area adjustment for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mini-player-spotify {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Animation when showing */
.mini-player-spotify {
    animation: miniPlayerSlideUp 0.3s ease-out;
}

@keyframes miniPlayerSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .mini-player-spotify {
        left: calc(var(--sidebar-width, 280px) + 16px);
        right: 16px;
        bottom: 16px;
        border-radius: 16px;
        height: 100px;
    }

    .mini-main-content {
        gap: 16px;
    }

    .mini-artwork-container {
        width: 64px;
        height: 64px;
    }

    .mini-controls-row {
        padding: 0 16px 12px;
    }
}