/**
 * Track List Component
 * Used by: trackA1.php, mixtapeA1.php
 *
 * Provides track listing styles for audio player pages
 * Includes hover effects, playing state, and responsive layouts
 */

/* ====================================
   Track List Section
   ==================================== */
.related-tracks-section {
    margin-top: 40px;
}

.track-list {
    width: 100%;
    margin-top: 20px;
}

/* Hide track actions when disabled */
.track-list.hide-track-actions .track-actions {
    display: none;
}

/* ====================================
   Track Row
   ==================================== */
.track-row {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 0;
    height: 56px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

@media (hover: hover) {
    .track-row:hover {
        background-color: rgba(255, 255, 255, 0.08);
    }
}

.track-row:active {
    background-color: rgba(255, 255, 255, 0.12);
}

/* Playing state */
.track-row.playing {
    background-color: rgba(30, 215, 96, 0.1);
}

.track-row.playing .track-name {
    color: #1ed760;
}

.track-row.playing .track-number {
    color: #1ed760;
}

/* ====================================
   Track Play Column
   ==================================== */
.track-play-col {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-number {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.track-play-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

@media (hover: hover) {
    .track-play-btn:hover {
        transform: scale(1.1);
    }

    .track-row:hover .track-number {
        display: none;
    }

    .track-row:hover .track-play-btn {
        display: block;
    }
}

/* Show play button for playing track */
.track-row.playing .track-number {
    display: none;
}

.track-row.playing .track-play-btn {
    display: block;
    color: #1ed760;
}

/* ====================================
   Track Image
   ==================================== */
.track-image {
    width: 40px;
    height: 40px;
    margin-right: 16px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

/* ====================================
   Track Info
   ==================================== */
.track-info {
    flex: 1;
    min-width: 0;
    margin-right: 16px;
    text-align: left;
}

/* Track list specific alignment */
.track-row .track-info {
    align-self: flex-start;
    padding-top: 2px; /* Fine-tune to align with image */
}

.track-name {
    font-size: 16px;
    font-weight: 400;
    color: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    justify-content: flex-start;
}

.track-artists {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.track-artists a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.track-artists a:hover {
    color: white;
    text-decoration: underline;
}

/* ====================================
   Explicit Badge
   ==================================== */
.explicit-badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 2px;
    line-height: 1;
    flex-shrink: 0;
}

/* Desktop tooltip for explicit badge */
@media (hover: hover) {
    .explicit-badge {
        position: relative;
        cursor: help;
    }

    .explicit-badge::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        margin-bottom: 4px;
        z-index: 10;
    }

    .explicit-badge:hover::after {
        opacity: 1;
    }
}

/* ====================================
   Track Duration
   ==================================== */
.track-duration {
    color: var(--text-secondary);
    font-size: 14px;
    margin-right: 16px;
    flex-shrink: 0;
}

/* ====================================
   Track Actions
   ==================================== */
.track-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.track-like-btn,
.track-more-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-like-btn:hover,
.track-more-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.track-like-btn.liked {
    color: #1ed760;
}

/* ====================================
   Mobile Touch Optimizations
   ==================================== */
.track-row,
.track-play-btn,
.track-like-btn,
.track-more-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ====================================
   Track List Loader
   ==================================== */
.track-list-loader {
    text-align: center;
    padding: 20px;
    display: none;
}

.track-list-loader.loading {
    display: block;
}

.track-list-loader .spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ====================================
   Mobile Responsive
   ==================================== */
@media (max-width: 768px) {
    /* Hide track number column on mobile for more display room */
    .track-play-col {
        display: none;
    }

    .track-row {
        padding: 8px 8px 8px 0;
    }

    .track-image {
        margin-right: 12px;
    }

    .track-info {
        margin-right: 8px;
    }

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

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

    .track-duration {
        font-size: 12px;
        margin-right: 8px;
    }

    .track-like-btn,
    .track-more-btn {
        width: 44px;
        height: 44px;
        padding: 10px;
        font-size: 18px;
    }
}

/* ====================================
   No More Content Message (BSAPP-604)
   ==================================== */
.no-more-content {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary, #6c757d);
}

.no-more-content__icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--accent-color, #00f0ff);
}

.no-more-content__text {
    font-size: 0.95rem;
    margin: 0;
}