/* ==========================================================================
   Tracks Section
   ========================================================================== */

/* Overlay */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 40;
}

.sheet-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Tracks Sheet/Overlay */
.tracks-sheet {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 45;
    visibility: hidden;
    display: flex;
    flex-direction: column;
}

.tracks-sheet.is-visible {
    transform: translateX(0);
    visibility: visible;
}

/* Sheet Header */
.sheet-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    text-align: center;
}

.sheet-drag-handle {
    display: none;
}

.sheet-close {
    position: absolute;
    right: 16px;
    top: 16px;
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-album-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-right: 48px;
    padding-left: 48px;
    margin-top: 0;
}

.sheet-album-cover {
    width: 160px;
    height: 160px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.sheet-album-info h3 {
    font-size: 24px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    font-weight: 600;
}

.sheet-album-info p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 16px;
}

/* Sheet Content */
.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Track List */
.tracks-list {
    overflow: visible;
    height: auto;
    padding: 16px 0;
    margin: 0;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 16px;
    transition: background-color 0.2s ease;
}

.track-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.track-item.is-playing {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Track Play Button */
.track-play-button {
    display: flex;
    align-items: center;
    gap: 16px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.play-button-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.play-icon, .pause-icon {
    width: 20px;
    height: 20px;
    color: var(--color-text);
}

.pause-icon {
    display: none;
}

.track-item.is-playing .play-icon {
    display: none;
}

.track-item.is-playing .pause-icon {
    display: block;
}

/* Track Information */
.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
    color: var(--color-text);
}

/* Streaming Links */
.streaming-links {
    display: flex;
    gap: var(--spacing-sm);
    margin: 0;
    padding: 24px;
    background: white;
}

.streaming-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    min-height: 32px;
}

.streaming-link:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 2rem;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 40px;
    height: 40px;
}

.spinner .path {
    stroke: #3b82f6;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Error Message */
.error-message {
    padding: 24px;
    text-align: center;
    color: var(--color-text);
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .tracks-sheet {
        width: 100%;
    }

    .sheet-album-cover {
        width: 120px;
        height: 120px;
    }
}