/* Floating Music Player Styles */

#fmp-floating-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display:none;
    background-color: #e1e1e1;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


/* Progress Bar */
#fmp-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 10002;
}

#fmp-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2271b1 0%, #00a0d2 50%, #2271b1 100%);
    background-size: 200% 100%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(34, 113, 177, 0.5);
    position: relative;
    overflow: hidden;
}

/* Shimmer animation for playing state */
#fmp-progress-bar.playing #fmp-progress-fill {
    animation: progressShimmer 2s ease-in-out infinite;
}

/* Indeterminate progress animation */
#fmp-progress-bar.indeterminate #fmp-progress-fill {
    animation: progressIndeterminate 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(34, 113, 177, 0.3) 25%, 
        #2271b1 50%, 
        rgba(34, 113, 177, 0.3) 75%, 
        transparent 100%);
    background-size: 200% 100%;
}

#fmp-progress-bar.paused #fmp-progress-fill {
    animation: none;
    background: #2271b1;
}

@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes progressIndeterminate {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.fmp-player-container {
    display: flex;
    align-items: center;
    padding: 6px 20px;
    max-width: 100%;
    gap: 12px;
    min-height: 44px;
}

/* Play/Pause Button */
.fmp-play-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 10001; /* Above the iframe */
}

.fmp-play-btn:hover {
    opacity: 0.8;
}

.fmp-play-btn:active {
    opacity: 0.6;
}

.fmp-play-icon,
.fmp-pause-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Player Info */
.fmp-player-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 2px;
    position: relative;
    z-index: 10001; /* Above the iframe */
    color:white;

}
.fmp-playlist-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
    line-height: 1.2;
}

.fmp-track-title {
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Player Controls */
.fmp-player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 10001; /* Above the iframe */
}

/* Close Button */
.fmp-close-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 10001;
    opacity: 0.8;
    margin-left: 8px;
}

.fmp-close-btn:hover {
    opacity: 1;
}

.fmp-close-btn:active {
    opacity: 0.6;
}

.fmp-close-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Hidden player state */
#fmp-floating-player.hidden {
    display: none !important;
}

/* Navigation buttons (Next/Previous) */
.fmp-nav-btn {
    display: none !important; /* Hidden by default, shown when playlist has items */
}

.fmp-player.has-playlist .fmp-nav-btn {
    display: flex !important;
}

.fmp-nav-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.fmp-control-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.fmp-control-btn:hover {
    opacity: 0.8;
}

.fmp-control-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.fmp-volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.fmp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.fmp-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.fmp-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
}

.fmp-volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Hidden Mixcloud embed */
#fmp-mixcloud-embed {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Fallback mode - make iframe slightly visible for interaction */
#fmp-mixcloud-embed.fallback-mode iframe {
    position: fixed;
    bottom: 60px;
    left: 20px;
    width: 300px;
    height: 60px;
    opacity: 0.3;
    z-index: 9998;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fmp-player-container {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .fmp-playlist-label {
        font-size: 10px;
    }
    
    .fmp-track-title {
        font-size: 12px;
    }
    
    .fmp-volume-slider {
        width: 60px;
    }
    
    .fmp-player-controls {
        gap: 8px;
    }
}

/* Loading state */
.fmp-player.loading .fmp-track-title {
    opacity: 0.6;
}

/* Playing state */
.fmp-player.playing .fmp-play-icon {
    display: none;
}

.fmp-player.playing .fmp-pause-icon {
    display: block !important;
}

.fmp-player.paused .fmp-play-icon {
    display: block;
}

.fmp-player.paused .fmp-pause-icon {
    display: none !important;
}

/* Resume Prompt Styles */
.fmp-resume-prompt {
    display: none;
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    background: rgba(18, 19, 18, 0.95);
    padding: 8px 20px;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    animation: slideDown 0.3s ease-out;
}

.fmp-resume-prompt.show {
    display: block;
}

.fmp-resume-prompt-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fmp-resume-message {
    font-size: 12px;
    color: #FFFFFF;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fmp-resume-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.fmp-resume-btn {
    background: #FFFFFF;
    color: #121312;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fmp-resume-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.fmp-resume-btn:active {
    transform: translateY(0);
}

@keyframes slideDown {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Loading state for track title */
.fmp-track-title.resuming {
    opacity: 0.7;
    font-style: italic;
}

/* Frontend Playlist Display */
.fmp-frontend-playlist {
    margin: 20px 0;
}

.fmp-frontend-playlist.fmp-playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.fmp-frontend-playlist.fmp-playlist-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fmp-playlist-item-frontend {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fmp-playlist-item-frontend:hover {
    background: #f5f5f5;
    border-color: #2271b1;
    transform: translateX(5px);
}

.fmp-playlist-item-frontend.active {
    background: #e7f3ff;
    border-color: #2271b1;
    border-width: 2px;
}

.fmp-playlist-thumbnail-frontend {
    width: 60px;
    height: 60px;
    background: #f0f0f1;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.fmp-playlist-info-frontend {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.fmp-playlist-title-frontend {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    flex: 1;
}

.fmp-playlist-number {
    font-size: 12px;
    color: #646970;
    font-weight: 500;
    min-width: 30px;
    text-align: right;
}

/* Grid layout for frontend */
.fmp-frontend-playlist.fmp-playlist-grid .fmp-playlist-item-frontend {
    flex-direction: column;
    text-align: center;
}

.fmp-frontend-playlist.fmp-playlist-grid .fmp-playlist-thumbnail-frontend {
    width: 100%;
    height: 200px;
}

.fmp-frontend-playlist.fmp-playlist-grid .fmp-playlist-info-frontend {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

