/* SoundCloud-Style Music Player Layout - Fixed for Requirements */

#embeddedMusicPlayer {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Main SoundCloud Player Container */
.soundcloud-player {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Top Section: Album Art + Main Content */
.player-main {
    display: flex;
    background: #ffffff;
    min-height: 200px;
}

/* Left Side - Album Art Only (No Text) */
.album-art-section {
    width: 200px;
    flex-shrink: 0;
    padding: 20px;
    border-right: 1px solid #e5e5e5;
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.album-art {
    width: 160px;
    height: 160px;
    border-radius: 6px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.art-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
    background: #f5f5f5;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header - Left Aligned Artist Over Track Name */
.track-header {
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left {
    flex: 1;
    min-width: 0;
    text-align: left; /* Force left alignment */
}

/* Showreel Title - New */
.showreel-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    text-align: left;
    line-height: 1.2;
    letter-spacing: 0.05em;
}

/* Artist Name on Top - Left Aligned */
.artist-name-header {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    text-align: left;
    line-height: 1.2;
}

/* Track Title Below - Left Aligned */
.track-title-header {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin: 0;
    line-height: 1.3;
    text-align: left;
}

.timestamp {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    flex-shrink: 0;
    display: none; /* Hidden since we removed it */
}

/* Waveform Section - Fixed */
.waveform-section {
    flex: 1;
    padding: 20px 25px;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 120px;
}

.waveform-controls {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.control-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px; /* Square with slight rounding */
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.play-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 6px; /* Square with slight rounding */
    background: #87CEEB;
}

.play-btn:hover {
    background: #6BB6E8;
}

.waveform-container {
    flex: 1;
    height: 80px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    position: relative;
    min-width: 200px; /* Ensure minimum width */
    overflow: hidden; /* Ensure content doesn't overflow */
}

#waveform {
    width: 100% !important;
    height: 100% !important;
    border-radius: 4px;
    display: block !important; /* Force display */
    position: relative !important;
}

/* Force WaveSurfer visibility and SoundCloud styling */
#waveform > div {
    width: 100% !important;
    height: 100% !important;
}

#waveform canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Ensure waveform bars are visible */
#waveform .wavesurfer-wrapper {
    overflow: visible !important;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    z-index: 5;
    border-radius: 4px;
}

.time-display {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    font-family: monospace;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #e5e5e5;
}

/* Track List */
.track-list {
    border-top: 1px solid #e5e5e5;
    background: #ffffff;
    /* Removed max-height and overflow to show all tracks without scrolling */
}

.track-item {
    display: flex;
    align-items: center;
    padding: 8px 25px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.track-item:hover {
    background: #f8f9fa;
}

.track-item.active {
    background: #e6f3ff;
    border-left: 3px solid #87CEEB;
}

.track-number {
    width: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-align: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.track-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    margin-right: 12px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.track-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    background: #f5f5f5;
}

.track-details {
    flex: 1;
    min-width: 0;
    text-align: left; /* Force left alignment */
}

.track-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-align: left; /* Force left alignment */
}

.track-duration {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    font-family: monospace;
    margin-left: 15px;
}

/* No Music Message */
.no-music-message {
    padding: 60px 40px;
    text-align: center;
    color: #666;
}

.no-music-message h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.no-music-message p {
    font-size: 14px;
    margin: 0;
    color: #666;
}

/* Scrollbar Styling - Removed since playlist no longer scrolls */
/* 
.track-list::-webkit-scrollbar {
    width: 6px;
}

.track-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.track-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.track-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
*/

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .player-main {
        flex-direction: column;
    }

    .album-art-section {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 15px 20px;
        justify-content: flex-start;
    }

    .album-art {
        width: 100px;
        height: 100px;
    }

    .track-header {
        padding: 15px 20px 12px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .artist-name-header {
        font-size: 20px;
    }

    .track-title-header {
        font-size: 14px;
    }

    .showreel-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .waveform-section {
        padding: 15px 20px;
        min-height: 100px;
    }

    .waveform-container {
        height: 70px;
        min-width: 150px;
    }

    .control-btn {
        width: 20px;
        height: 20px;
        font-size: 9px;
        border-radius: 3px; /* Square with slight rounding */
    }

    .play-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 5px; /* Square with slight rounding */
    }

    .track-item {
        padding: 6px 20px;
    }

    .track-thumbnail {
        width: 28px;
        height: 28px;
    }

    .track-name {
        font-size: 12px;
    }

    .track-duration {
        font-size: 11px;
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .album-art-section {
        padding: 12px 15px;
    }

    .album-art {
        width: 80px;
        height: 80px;
    }

    .track-header {
        padding: 12px 15px 10px 15px;
    }

    .artist-name-header {
        font-size: 18px;
    }

    .track-title-header {
        font-size: 13px;
    }

    .showreel-title {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .waveform-section {
        padding: 12px 15px;
        gap: 12px;
        min-height: 90px;
    }

    .waveform-container {
        height: 60px;
        min-width: 120px;
    }

    .control-btn {
        width: 18px;
        height: 18px;
        font-size: 8px;
        border-radius: 2px; /* Square with slight rounding */
    }

    .play-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
        border-radius: 4px; /* Square with slight rounding */
    }

    .time-display {
        font-size: 10px;
        padding: 3px 6px;
    }

    .track-item {
        padding: 5px 15px;
    }

    .track-number {
        width: 16px;
        font-size: 11px;
        margin-right: 8px;
    }

    .track-thumbnail {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }

    .track-name {
        font-size: 11px;
    }

    .track-duration {
        font-size: 10px;
        margin-left: 8px;
    }
}

/* Enhanced Playlist Clicking Styles - Minimal and Clean */
.enhanced-track {
    position: relative;
    transition: opacity 0.1s ease;
    cursor: pointer;
}

.enhanced-track:hover {
    opacity: 0.8;
}

.enhanced-track.current {
    background: #e6f3ff;
    border-left: 3px solid #87CEEB;
}

.enhanced-track.current .track-name {
    color: #2980b9;
    font-weight: 600;
}

.enhanced-track.current .track-number {
    color: #87CEEB;
    font-weight: 700;
}

.enhanced-track.keyboard-selected {
    outline: 2px solid rgba(135, 206, 235, 0.5);
    outline-offset: 2px;
}

/* Hide removed elements - ensure clean layout */
.playlist-name,
.current-track-title,
.sidebar,
.sidebar-content,
.track-info-sidebar {
    display: none !important;
}

/* Hide ALL old/basic audio player elements + skip buttons */
#basicAudioPlayer,
.basic-audio-player,
.audio-controls,
.track-info,
#trackTitle,
#trackArtist,
#timeDisplay,
#currentTime,
#totalTime,
#waveformContainer,
.track-selector,
#trackSelector,
.track-select,
#prevBtn,
#nextBtn {
    display: none !important;
}

/* Legacy CSS cleanup - hide old elements */
.player-container,
.current-track {
    display: none !important;
}

/* Ensure only the SoundCloud-style player shows */
.soundcloud-player {
    display: block !important;
}

/* Force waveform visualization for ALL instances */
#waveform,
#waveform canvas,
#waveform > div,
#waveform wave,
.soundcloud-player #waveform,
.soundcloud-player #waveform canvas,
.soundcloud-player #waveform > div {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure WaveSurfer.js elements are visible */
wave,
wave > wave,
[data-wavesurfer] {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* ULTIMATE WAVEFORM VISIBILITY FIX */
#waveform,
#waveform *,
#waveform canvas,
#waveform > div,
#waveform wave {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: auto !important;
}

/* Force WaveSurfer container to be visible */
.waveform-container {
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure loading overlay doesn't block waveform when hidden */
.loading-overlay {
    pointer-events: none !important;
}

.loading-overlay[style*="display: none"] {
    display: none !important;
}
