/* PULSAR Music Player - Complete Styles */

.pulsar-music-player {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.95) 0%, 
        rgba(16, 21, 62, 0.95) 50%, 
        rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(142, 45, 226, 0.3);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    color: white;
    user-select: none;
}

.player-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Visualizer Canvas */
.visualizer-canvas {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    background: linear-gradient(135deg, 
        rgba(142, 45, 226, 0.1) 0%, 
        rgba(74, 0, 224, 0.1) 100%);
    border: 1px solid rgba(142, 45, 226, 0.2);
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.visualizer-canvas:hover {
    border-color: rgba(142, 45, 226, 0.5);
    box-shadow: 0 0 20px rgba(142, 45, 226, 0.3);
}

/* Track Info */
.track-info {
    text-align: center;
    margin-bottom: 15px;
}

.track-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, #8E2DE2, #4A00E0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(142, 45, 226, 0.3);
}

.track-artist {
    font-size: 1.2rem;
    color: #b3b3b3;
    margin-bottom: 5px;
}

.track-bpm {
    font-size: 1rem;
    color: #00FFFF;
    font-weight: 600;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.time-current,
.time-total {
    font-size: 0.9rem;
    color: #b3b3b3;
    font-weight: 600;
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(142, 45, 226, 0.2) 0%, 
        rgba(255, 20, 147, 0.2) 100%);
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8E2DE2, #FF1493);
    border-radius: 3px;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(142, 45, 226, 0.5);
    width: 0%;
}

.progress-handle {
    position: absolute;
    top: -3px;
    width: 12px;
    height: 12px;
    background: #8E2DE2;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(142, 45, 226, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    left: 0%;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(142, 45, 226, 0.8) 0%, 
        rgba(74, 0, 224, 0.8) 100%);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(142, 45, 226, 0.6);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.play-pause {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #FF073A, #8E2DE2);
}

.control-btn.active {
    background: linear-gradient(135deg, #00FFFF, #8E2DE2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 200px;
}

.volume-icon {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.volume-icon:hover {
    transform: scale(1.2);
}

.volume-slider {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #8E2DE2;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(142, 45, 226, 0.5);
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #FF073A;
    box-shadow: 0 0 12px rgba(255, 7, 58, 0.7);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #8E2DE2;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(142, 45, 226, 0.5);
}

.effect-controls {
    display: flex;
    gap: 10px;
}

.effect-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(142, 45, 226, 0.3);
    border-radius: 8px;
    background: rgba(142, 45, 226, 0.1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.effect-btn:hover {
    background: rgba(142, 45, 226, 0.3);
    border-color: rgba(142, 45, 226, 0.6);
    transform: translateY(-2px);
}

.effect-btn.active {
    background: #8E2DE2;
    border-color: #8E2DE2;
    box-shadow: 0 0 10px rgba(142, 45, 226, 0.5);
}

/* Playlist */
.playlist-container {
    margin-bottom: 20px;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(142, 45, 226, 0.3);
}

.playlist-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #8E2DE2;
}

.playlist-actions {
    display: flex;
    gap: 10px;
}

.playlist-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(142, 45, 226, 0.3);
    border-radius: 6px;
    background: rgba(142, 45, 226, 0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-btn:hover {
    background: rgba(142, 45, 226, 0.3);
    border-color: rgba(142, 45, 226, 0.6);
}

.playlist-tracks {
    max-height: 200px;
    overflow-y: auto;
    border: 1px dashed rgba(142, 45, 226, 0.3);
    border-radius: 8px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.playlist-tracks::-webkit-scrollbar {
    width: 6px;
}

.playlist-tracks::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.playlist-tracks::-webkit-scrollbar-thumb {
    background: #8E2DE2;
    border-radius: 3px;
}

.empty-playlist {
    text-align: center;
    color: #b3b3b3;
    padding: 20px;
}

.empty-playlist p {
    margin: 5px 0;
}

.playlist-track {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.playlist-track:hover {
    background: rgba(142, 45, 226, 0.2);
}

.playlist-track.current {
    background: rgba(142, 45, 226, 0.3);
    border: 1px solid rgba(142, 45, 226, 0.5);
}

.track-number {
    width: 30px;
    text-align: center;
    color: #b3b3b3;
    font-weight: 600;
}

.track-details {
    flex: 1;
    margin-left: 10px;
}

.track-name {
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.track-duration {
    font-size: 0.8rem;
    color: #b3b3b3;
}

.track-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 7, 58, 0.2);
    color: #FF073A;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.track-remove:hover {
    background: #FF073A;
    color: white;
}

/* Equalizer Panel */
.equalizer-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 400px;
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.98) 0%, 
        rgba(16, 21, 62, 0.98) 100%);
    border: 2px solid rgba(142, 45, 226, 0.5);
    border-radius: 12px;
    padding: 20px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.equalizer-panel.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.eq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(142, 45, 226, 0.3);
}

.eq-header h3 {
    color: #8E2DE2;
    font-weight: 600;
}

.eq-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 7, 58, 0.2);
    color: #FF073A;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eq-close:hover {
    background: #FF073A;
    color: white;
    transform: rotate(90deg);
}

.eq-preset {
    margin-bottom: 20px;
}

.eq-preset-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(142, 45, 226, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

.eq-preset-select:focus {
    outline: none;
    border-color: #8E2DE2;
    box-shadow: 0 0 8px rgba(142, 45, 226, 0.5);
}

.eq-sliders {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.eq-band label {
    font-size: 0.8rem;
    color: #b3b3b3;
    margin-bottom: 10px;
    font-weight: 600;
}

.eq-slider {
    writing-mode: bt-lr; /* IE */
    writing-mode: vertical-lr; /* Standard */
    direction: rtl; /* Preserve top-to-bottom orientation */
    width: 4px;
    height: 150px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #8E2DE2;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(142, 45, 226, 0.5);
}

.eq-value {
    font-size: 0.7rem;
    color: #00FFFF;
    margin-top: 10px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .player-container {
        padding: 15px;
    }
    
    .visualizer-canvas {
        height: 150px;
    }
    
    .track-title {
        font-size: 1.4rem;
    }
    
    .player-controls {
        gap: 15px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .control-btn.play-pause {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .audio-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .volume-control {
        max-width: none;
    }
    
    .equalizer-panel {
        width: 90%;
        max-width: 350px;
    }
    
    .eq-sliders {
        gap: 8px;
    }
    
    .eq-slider {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .player-container {
        padding: 10px;
    }
    
    .visualizer-canvas {
        height: 120px;
    }
    
    .track-title {
        font-size: 1.2rem;
    }
    
    .player-controls {
        gap: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .control-btn.play-pause {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
}

/* Animation Classes */
.music-player-enter {
    transform: translateY(100%);
}

.music-player-enter-active {
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.music-player-exit {
    transform: translateY(0);
}

.music-player-exit-active {
    transform: translateY(100%);
    transition: transform 0.3s ease-in;
}

/* Drag and Drop Effects */
.playlist-tracks.drag-over {
    border-color: #8E2DE2;
    background: rgba(142, 45, 226, 0.1);
    box-shadow: inset 0 0 20px rgba(142, 45, 226, 0.3);
}

/* Loading States */
.loading-track {
    opacity: 0.5;
    pointer-events: none;
}

.loading-track::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #8E2DE2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error-track {
    background: rgba(255, 7, 58, 0.1);
    border: 1px solid rgba(255, 7, 58, 0.3);
}

.error-track .track-name {
    color: #FF073A;
}

/* Accessibility */
.control-btn:focus,
.playlist-btn:focus,
.effect-btn:focus {
    outline: 2px solid #8E2DE2;
    outline-offset: 2px;
}

.volume-slider:focus::-webkit-slider-thumb {
    outline: 2px solid #8E2DE2;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .pulsar-music-player {
        background: black;
        border-top: 3px solid white;
    }
    
    .control-btn {
        background: white;
        color: black;
        border: 2px solid black;
    }
    
    .track-title {
        color: white;
        text-shadow: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    
    .visualizer-canvas {
        display: none;
    }
}