/* Music Player Styles - Recontastic */

.player-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

/* Visual Display */
.visual-display {
    width: 100%;
    height: 200px;
    background: var(--darker-bg);
    border-radius: 16px;
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border-color);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.audio-visualizer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
}

#spectrogram {
    width: 100%;
    height: 120px;
    opacity: 0.9;
}

/* Player Info */
.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.track-details {
    flex: 1;
}

.track-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.track-artist {
    font-size: 1rem;
    color: var(--text-secondary);
}

.time-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar:hover {
    background: rgba(59, 130, 246, 0.2);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--primary-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--darker-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.control-btn:hover {
    background: var(--border-color);
    border-color: var(--primary-blue);
    transform: scale(1.1);
}

.control-btn i {
    font-size: 1.1rem;
}

.play-btn {
    width: 65px;
    height: 65px;
    background: var(--gradient-primary);
    border-color: var(--primary-blue);
}

.play-btn:hover {
    background: var(--gradient-accent);
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.play-btn i {
    font-size: 1.5rem;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.volume-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.volume-icon:hover {
    color: var(--primary-blue);
}

.volume-slider {
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--secondary-purple);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Playlist */
.playlist {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.playlist h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.playlist-items {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.playlist-items::-webkit-scrollbar {
    width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    background: var(--darker-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.playlist-item:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
    transform: translateX(8px);
}

.playlist-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-blue);
}

.playlist-item.active .track-name {
    color: var(--primary-blue);
}

.play-indicator {
    width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.playlist-item.active .play-indicator {
    color: var(--primary-blue);
}

.track-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 1rem;
}

.track-duration {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.track-type {
    margin-left: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.track-type.audio {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-blue);
}

.track-type.video {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .player-wrapper {
        padding: 1.5rem;
    }
    
    .visual-display {
        height: 150px;
    }
    
    .player-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .track-title {
        font-size: 1.25rem;
    }
    
    .player-controls {
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .play-btn {
        width: 60px;
        height: 60px;
    }
    
    .volume-control {
        margin-left: 0;
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .playlist-items {
        max-height: 250px;
    }
    
    .playlist-item {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
    
    .play-indicator {
        width: 30px;
        margin-right: 0.75rem;
    }
}

@media (max-width: 480px) {
    .player-wrapper {
        padding: 1rem;
    }
    
    .visual-display {
        height: 120px;
    }
    
    .track-title {
        font-size: 1.1rem;
    }
    
    .player-controls {
        gap: 1rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .play-btn {
        width: 55px;
        height: 55px;
    }
    
    .volume-slider {
        width: 80px;
    }
    
    .track-type {
        display: none;
    }
}


.youtube-player {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 14px;
}

/* Add this to your styles.css file at the bottom */

/* Fix Twitch Chat Overlay Issue */
#twitchChat iframe {
    position: relative;
    z-index: 1;
    display: block;
}

.live-stream-embed iframe {
    position: relative;
    z-index: 1;
    display: block;
}

.live-stream-container {
    position: relative;
    z-index: 1;
    isolation: isolate; /* Creates new stacking context */
}

/* Ensure nothing overlaps the Twitch iframes */
.live-stream-container * {
    position: relative;
}