/**
 * Unified Player CSS
 * A modern, responsive audio player for both YouTube and SoundCloud content
 */

/* Main Player Container */
.unified-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    height: 100px;
    transform: translateY(0);
}

.unified-player.hidden {
    transform: translateY(100%);
}

/* YouTube-specific styling */
.unified-player.youtube-active .track-source {
    color: #ff0000;
}

.unified-player.youtube-active .progress-fill {
    background: linear-gradient(90deg, #ff0000, #cc0000);
}

/* SoundCloud-specific styling */
.unified-player.soundcloud-active .track-source {
    color: #ff7700;
}

.unified-player.soundcloud-active .progress-fill {
    background: linear-gradient(90deg, #ff7700, #ff5500);
}

/* Player Content Layout */
.player-content {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    gap: 20px;
}

/* Track Info Section */
.track-info-section {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 15px;
}

.track-artwork {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.track-details {
    min-width: 0;
    overflow: hidden;
}

.track-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-source {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: -2px; /* Move up slightly */
}

/* Controls Section */
.controls-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 20px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.play-btn {
    width: 46px;
    height: 46px;
}

/* Progress Section */
.progress-section {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-display {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    min-width: 40px;
    text-align: center;
}

.progress-container {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    height: 100%;
    width: 0%;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, #8a2be2, #4b0082);
    border-radius: 5px;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* Volume Section */
.volume-section {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 120px;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Minimize Tab */
.minimize-tab {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 5px 15px;
    border-radius: 10px 10px 0 0;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.minimize-tab:hover {
    padding-top: 8px;
}

/* Floating Player Button */
.floating-player-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 30px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-player-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.floating-btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 5px;
}

.floating-artwork {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.floating-track-info {
    max-width: 150px;
    overflow: hidden;
}

.floating-track-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-track-artist {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-play-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 5px;
}

.floating-play-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .unified-player {
        padding: 10px;
    }
    
    .controls-section {
        margin: 0 10px;
    }
    
    .volume-section {
        display: none;
    }
    
    .track-title {
        font-size: 0.9rem;
    }
    
    .track-artist {
        font-size: 0.75rem;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
    }
    
    .play-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .track-artwork {
        width: 50px;
        height: 50px;
    }
    
    .controls-section {
        gap: 10px;
    }
    
    .progress-section {
        flex: 1;
    }
    
    .time-display {
        font-size: 0.7rem;
        min-width: 35px;
    }
}

/* Hidden iframes for players */
#youtube-player, #soundcloud-player {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
}
