/* Preview Button Styles */
.preview-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.preview-button.small {
    width: 24px;
    height: 24px;
    margin-left: 8px;
}

.preview-button.medium {
    width: 32px;
    height: 32px;
    margin-left: 12px;
}

.preview-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preview-button:active {
    transform: scale(0.95);
}

.preview-button.playing {
    background: var(--accent-color, #1db954);
    color: white;
}

.preview-button.playing:hover {
    background: var(--accent-hover, #1ed760);
}

/* Preview button in discovery mode */
.media-item.discover-mode .media-details {
    position: relative;
}

.media-item.discover-mode .media-details .preview-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-item.discover-mode:hover .media-details .preview-button {
    opacity: 1;
}
.media-item.discover-mode .media-details .container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-item.discover-mode .preview-button {
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    margin-left: auto; /* Push to the right side of the container */
    flex-shrink: 0; /* Prevent shrinking */
}

.media-item.discover-mode:hover .preview-button {
    opacity: 1;
}

.media-item.discover-mode .preview-button.playing {
    opacity: 1;
}

/* Dark theme adjustments */
html.dark .preview-button {
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

html.dark .preview-button:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Light theme adjustments */
html:not(.dark) .preview-button {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
}

html:not(.dark) .preview-button:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* Responsive design */
@media (max-width: 768px) {
    .preview-button.small {
        width: 28px;
        height: 28px;
    }
    
    .preview-button.medium {
        width: 36px;
        height: 36px;
    }
    
    /* On mobile, always show preview button for discovery items */
    .media-item.discover-mode .preview-button {
        opacity: 0.7;
    }
    
    .media-item.discover-mode:hover .preview-button,
    .media-item.discover-mode .preview-button.playing {
        opacity: 1;
    }
}
