/**
 * AnySpace Playlist Manager Styles
 * Windows Vista Aero Glass Design with Beautiful Transparency
 */

/* Vista Glass Backdrop Blur */
.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99989;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
    /* GPU acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity;
}

/* Playlist button in music bar */
.bar-playlist-container {
    display: flex;
    align-items: center;
    margin-right: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding-right: 6px;
}

.playlist-btn {
    position: relative;
}

.playlist-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #cc0000;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Playlist popup - Vista Aero Glass Effect */
.playlist-popup {
    position: fixed;
    bottom: 45px;
    right: 160px;
    width: 320px;
    /* GPU acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
    max-height: 480px;
    
    /* Vista Aero Glass effect background */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(0, 0, 0, 0.1) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    
    /* Vista-style border with glow */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    
    /* Glowing shadow effect */
    box-shadow: 
        0 0 40px rgba(68, 170, 255, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    
    display: none;
    z-index: 99990;
    font-family: "Segoe UI", "Lucida Grande", Arial, sans-serif;
    font-size: 11px;
    overflow: hidden;
    
    /* Smooth animations */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.95);
}

.playlist-popup[style*="visible"] {
    transform: scale(1);
}

.playlist-header {
    background: linear-gradient(
        180deg,
        rgba(68, 170, 255, 0.3) 0%,
        rgba(68, 170, 255, 0.2) 50%,
        rgba(68, 170, 255, 0.1) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* Glass shine effect on header */
.playlist-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 100%
    );
    pointer-events: none;
    border-radius: 12px 12px 0 0;
}

.playlist-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(68, 170, 255, 0.5);
    letter-spacing: 0.5px;
}

.playlist-close {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.1) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.playlist-close:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 100, 100, 0.4) 0%,
        rgba(255, 50, 50, 0.3) 100%
    );
    box-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
    transform: scale(1.1);
}

.playlist-close:active {
    transform: scale(0.95);
}

.playlist-content {
    max-height: 320px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

/* Custom Vista scrollbar */
.playlist-content::-webkit-scrollbar {
    width: 10px;
}

.playlist-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.playlist-content::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(68, 170, 255, 0.5) 0%,
        rgba(68, 170, 255, 0.3) 100%
    );
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(68, 170, 255, 0.7) 0%,
        rgba(68, 170, 255, 0.5) 100%
    );
}

.playlist-songs {
    padding: 0;
}

.playlist-songs ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist-item {
    display: flex;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
}

.playlist-item:hover {
    background: linear-gradient(
        90deg,
        rgba(68, 170, 255, 0.15) 0%,
        rgba(68, 170, 255, 0.1) 100%
    );
    padding-left: 18px;
}

.playlist-item.current {
    background: linear-gradient(
        90deg,
        rgba(68, 170, 255, 0.25) 0%,
        rgba(68, 170, 255, 0.15) 100%
    );
}

.playlist-item.current::before {
    content: '▶';
    position: absolute;
    left: 4px;
    color: rgba(68, 170, 255, 0.8);
    font-size: 10px;
}

.playlist-song-info {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.playlist-song-title {
    display: block;
    font-weight: 600;
    color: white;
    font-size: 12px;
    margin-bottom: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.playlist-song-artist {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.playlist-song-actions {
    display: flex;
    gap: 6px;
}

.playlist-song-play,
.playlist-song-remove {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.1) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    color: white;
    margin-left: 4px;
}

.playlist-song-play:hover {
    background: linear-gradient(
        180deg,
        rgba(100, 255, 100, 0.3) 0%,
        rgba(50, 200, 50, 0.2) 100%
    );
    box-shadow: 0 0 8px rgba(100, 255, 100, 0.5);
    transform: scale(1.1);
}

.playlist-song-remove:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 100, 100, 0.3) 0%,
        rgba(200, 50, 50, 0.2) 100%
    );
    box-shadow: 0 0 8px rgba(255, 100, 100, 0.5);
    transform: scale(1.1);
}

.playlist-footer {
    padding: 10px 14px;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-count {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.playlist-clear {
    background: linear-gradient(
        180deg,
        rgba(255, 100, 100, 0.3) 0%,
        rgba(200, 50, 50, 0.2) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 11px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.playlist-clear:hover {
    background: linear-gradient(
        180deg,
        rgba(255, 100, 100, 0.5) 0%,
        rgba(200, 50, 50, 0.4) 100%
    );
    box-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
    transform: translateY(-1px);
}

.playlist-clear:active {
    transform: translateY(0);
}

.playlist-empty {
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Vista-style notification */
.playlist-notification {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: linear-gradient(
        135deg,
        rgba(68, 170, 255, 0.9) 0%,
        rgba(68, 170, 255, 0.7) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 20px rgba(68, 170, 255, 0.4),
        0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 99999;
    font-family: "Segoe UI", "Lucida Grande", Arial, sans-serif;
    font-size: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.playlist-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Add to playlist button with Vista glass */
.add-to-playlist-btn {
    background: linear-gradient(
        180deg,
        rgba(68, 170, 255, 0.4) 0%,
        rgba(68, 170, 255, 0.2) 100%
    );
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.add-to-playlist-btn:hover {
    background: linear-gradient(
        180deg,
        rgba(68, 170, 255, 0.6) 0%,
        rgba(68, 170, 255, 0.4) 100%
    );
    box-shadow: 0 0 10px rgba(68, 170, 255, 0.5);
    transform: translateY(-1px);
}

.add-to-playlist-btn:before {
    content: "+";
    margin-right: 4px;
    font-weight: bold;
    font-size: 14px;
}

/* Mobile-specific Vista Glass Design */
@media (max-width: 768px) {
    .playlist-popup {
        /* Full-screen centered modal on mobile */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        right: auto;
        bottom: auto;
        width: 90%;
        max-width: 380px;
        max-height: 70vh;
        
        /* Darker glass for mobile with beautiful black background */
        background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(10, 10, 10, 0.6) 40%,
            rgba(0, 0, 0, 0.8) 100%
        );
        backdrop-filter: blur(25px) saturate(200%);
        -webkit-backdrop-filter: blur(25px) saturate(200%);
        
        /* Enhanced glow for mobile */
        box-shadow: 
            0 0 60px rgba(68, 170, 255, 0.3),
            0 10px 40px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    }
    
    .playlist-popup[style*="visible"] {
        transform: translate(-50%, -50%) scale(1);
    }
    
    /* Stronger glass effect for mobile header */
    .playlist-header {
        background: linear-gradient(
            180deg,
            rgba(68, 170, 255, 0.4) 0%,
            rgba(68, 170, 255, 0.3) 50%,
            rgba(68, 170, 255, 0.2) 100%
        );
        padding: 14px 16px;
    }
    
    /* Darker content area for mobile */
    .playlist-content {
        background: rgba(0, 0, 0, 0.4);
        max-height: calc(70vh - 120px);
    }
    
    /* Enhanced mobile footer */
    .playlist-footer {
        padding: 12px 16px;
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.5) 100%
        );
    }
    
    /* Stronger backdrop blur on mobile */
    .popup-backdrop {
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

/* Animations */
@keyframes vistaSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.playlist-popup.animate-in {
    animation: vistaSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
