/**
 * WaveformPlaylist - Core Styles
 * Minimal, semantic styling for playlist functionality
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.waveform-playlist {
    font-family: inherit;
    color: inherit;
}

.waveform-playlist * {
    box-sizing: border-box;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Player Container */
.wp-player {
    margin-bottom: 1rem;
}

/* List Container */
.wp-list-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.wp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Track Items
   ========================================================================== */

.wp-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
}

.wp-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wp-item.wp-active {
    background: rgba(168, 85, 247, 0.1);
}

.wp-item:last-child {
    border-bottom: none;
}

/* Track Number Indicator */
.wp-indicator {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.wp-item.wp-active .wp-indicator {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* Track Artwork */
.wp-artwork-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.wp-artwork {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.wp-artwork-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.wp-artwork-overlay i {
    color: white;
    font-size: 18px;
}

/* Track Info */
.wp-info {
    flex: 1;
    min-width: 0;
}

.wp-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wp-subtitle {
    font-size: 0.875rem;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wp-duration {
    font-size: 0.875rem;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ==========================================================================
   Chapters
   ========================================================================== */

/* Chapters under tracks (multi-track playlists) */
.wp-chapters {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0.5rem 3rem;
    background: rgba(0, 0, 0, 0.2);
}

.wp-chapter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.wp-chapter:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wp-chapter.wp-active {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.wp-chapter-time {
    font-family: monospace;
    opacity: 0.5;
    min-width: 3rem;
}

.wp-chapter.wp-active .wp-chapter-time {
    color: #a855f7;
    font-weight: 600;
}

.wp-chapter-label {
    flex: 1;
}

/* Chapters only layout (single track with chapters) */
.wp-chapters-only .wp-chapter-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
}

.wp-chapters-only .wp-chapter-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.wp-chapters-only .wp-chapter-item.wp-active {
    background: rgba(168, 85, 247, 0.1);
}

.wp-chapters-only .wp-chapter-item:last-child {
    border-bottom: none;
}

.wp-chapters-only .wp-time {
    font-family: monospace;
    color: rgba(168, 85, 247, 0.9);
    min-width: 3rem;
}

.wp-chapters-only .wp-chapter-item.wp-active .wp-time {
    color: #a855f7;
    font-weight: 600;
}

.wp-chapters-only .wp-label {
    flex: 1;
}

/* ==========================================================================
   Minimal Layout
   ========================================================================== */

.wp-minimal .wp-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.wp-track-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wp-track-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.wp-track-btn.wp-active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 480px) {
    .wp-item {
        padding: 0.625rem 0.75rem;
    }

    .wp-chapters {
        padding-left: 2rem;
    }

    .wp-artwork-container,
    .wp-artwork {
        width: 32px;
        height: 32px;
    }

    .wp-title {
        font-size: 0.9375rem;
    }

    .wp-subtitle,
    .wp-duration {
        font-size: 0.8125rem;
    }
}