/* Music Player Styles - Theme-aware */
/* Note: Base theme variables come from ../theme.css */

/* Music page specific body styles */
body {
    display: flex;
    flex-direction: column;
}

/* Main Layout */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 350px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 2rem;
    padding: 2rem;
}

/* Player Container */
.player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
}

/* Now Playing */
.now-playing {
    text-align: center;
    margin-bottom: 2rem;
}

.cover-art {
    width: 300px;
    height: 300px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 24px var(--shadow);
}

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

.cover-art img.loaded {
    display: block;
}

.cover-art img.loaded + .no-cover {
    display: none;
}

.no-cover {
    font-size: 5rem;
    color: var(--text-secondary);
}

.track-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.track-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    margin-bottom: 1.5rem;
}

.progress-container span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-bar:hover .progress {
    background: var(--accent-hover);
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.control-btn:hover {
    color: var(--text-primary);
}

.control-btn.active {
    color: var(--accent);
}

.play-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    width: 56px;
    height: 56px;
}

.play-btn:hover {
    transform: scale(1.05);
    background: var(--text-primary);
}

.play-btn svg {
    width: 28px;
    height: 28px;
}

.play-btn .icon-pause {
    display: none;
}

.play-btn.playing .icon-play {
    display: none;
}

.play-btn.playing .icon-pause {
    display: block;
}

/* Volume */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

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

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.tab-content.active {
    display: block;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.action-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Item Lists */
.item-list {
    list-style: none;
}

.item-list li {
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-list li:hover {
    background: var(--bg-tertiary);
}

.item-list li.active {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.item-list .item-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-list .item-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

.item-list .item-info {
    flex: 1;
    min-width: 0;
}

.item-list .item-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-list .item-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-list .item-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.breadcrumb span {
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Queue Section */
.queue-section {
    border-top: 1px solid var(--border);
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.queue-section .list-header span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.queue li {
    padding: 0.5rem;
}

.queue li.current {
    color: var(--accent);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error State */
.error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }

    .cover-art {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 500px) {
    .site-header {
        padding: 1rem;
    }

    main {
        padding: 1rem;
    }

    .cover-art {
        width: 150px;
        height: 150px;
    }

    .track-info h2 {
        font-size: 1.2rem;
    }

    .progress-container {
        max-width: 100%;
    }
}

/* Light theme adjustments */
[data-theme="light"] .sidebar {
    border: 1px solid var(--border);
}

[data-theme="light"] .item-list .item-icon {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}