/**
 * Show List Item Component Styles
 *
 * Displays a show row with image, date, venue, artists, audio controls, and favorite.
 * Used in venue_details (upcoming shows), show_details (similar shows), and artist_details.
 *
 * Features:
 * - Audio playback controls with progress ring
 * - Thumbs up/down rating buttons
 * - Artist highlighting during playback
 * - Favorite button inline with meta
 */

/* ============================================
   SHOW LIST ITEM - BASE
   ============================================ */

.show-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3, 12px);
    padding: var(--space-2, 8px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: background 0.15s ease;
}

.show-list-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hidden state for expand/collapse */
.show-list-item--hidden {
    display: none;
}

/* ============================================
   IMAGE
   ============================================ */

.show-list-item__image {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    background: var(--bg-tertiary, #222);
}

.show-list-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.show-list-item__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #222);
    color: var(--text-tertiary, #666);
}

.show-list-item__placeholder svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   MATCH SCORE BADGE
   ============================================ */

.show-list-item__match {
    position: absolute;
    bottom: 2px;
    left: 2px;
    padding: 2px 4px;
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 3px;
    line-height: 1;
}

/* ============================================
   INFO CONTAINER
   ============================================ */

.show-list-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 2px;
}

/* ============================================
   META LINE (Venue · Date + Heart)
   ============================================ */

.show-list-item__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #aaa);
}

.show-list-item__meta-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Favorite button inline with meta */
.sli-favorite {
    flex-shrink: 0;
}

/* ============================================
   ARTISTS LINE
   ============================================ */

.show-list-item__artists {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Playing state - allow wrapping */
.show-list-item--playing .show-list-item__artists {
    white-space: normal;
}

/* Artist spans for individual highlighting */
.sli-artist {
    transition: color 0.15s ease;
}

.sli-artist-sep {
    color: var(--text-secondary, #aaa);
}

/* Currently playing artist - green highlight */
.sli-artist--playing {
    color: var(--color-success, #1DB954) !important;
}

/* ============================================
   SONG TITLE
   ============================================ */

.sli-song-title {
    position: absolute;
    top: 100%;
    right: 0;
    font-size: 12px;
    color: var(--text-tertiary, #888);
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    font-style: italic;
    pointer-events: none;
}

/* Show song title when playing */
.show-list-item--playing .sli-song-title {
    opacity: 1;
}

/* ============================================
   CONTROLS CONTAINER
   ============================================ */

.sli-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ============================================
   THUMBS BUTTONS
   ============================================ */

.sli-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    opacity: 0;
    overflow: hidden;
    transition: width 0.2s ease-out, opacity 0.2s ease-out, background 0.15s ease, color 0.15s ease, margin 0.2s ease-out;
}

.sli-thumb svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Show thumbs when playing */
.show-list-item--playing .sli-thumb {
    width: 32px;
    opacity: 1;
    margin-right: 0;
}

/* First thumb gets margin */
.show-list-item--playing .sli-thumb--down {
    margin-right: 4px;
}

/* Hover states */
.sli-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary, #fff);
}

/* Active states */
.sli-thumb--up.sli-thumb--active {
    background: rgba(34, 197, 94, 0.8);
    color: #fff;
}

.sli-thumb--up.sli-thumb--active:hover {
    background: rgba(34, 197, 94, 1);
}

.sli-thumb--down.sli-thumb--active {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
}

.sli-thumb--down.sli-thumb--active:hover {
    background: rgba(239, 68, 68, 1);
}

/* Hide thumbs if no song_id (can't rate) */
.sli-thumb[style*="visibility: hidden"] {
    display: none;
}

/* ============================================
   AUDIO BUTTON
   ============================================ */

.sli-audio-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.sli-audio-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sli-audio-btn:active {
    transform: scale(0.95);
}

/* Icon sizing */
.sli-audio-btn svg:not(.sli-progress-ring) {
    width: 16px;
    height: 16px;
    position: absolute;
    transition: opacity 0.15s ease;
}

/* Icon visibility based on state */
.sli-icon-play,
.sli-icon-next,
.sli-icon-pause,
.sli-icon-loading {
    opacity: 0;
    pointer-events: none;
}

/* Idle state - show play icon */
.sli-audio-btn[data-state="idle"] .sli-icon-play {
    opacity: 1;
}

/* Loading state - show spinner */
.sli-audio-btn[data-state="loading"] .sli-icon-loading {
    opacity: 1;
}

/* Playing state - show next icon */
.sli-audio-btn[data-state="playing"] .sli-icon-next {
    opacity: 1;
}

/* Playing last artist - show pause icon */
.sli-audio-btn[data-state="playing-last"] .sli-icon-pause {
    opacity: 1;
}

/* ============================================
   PROGRESS RING
   ============================================ */

.sli-progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Show progress ring when playing */
.sli-audio-btn[data-state="playing"] .sli-progress-ring,
.sli-audio-btn[data-state="playing-last"] .sli-progress-ring {
    opacity: 1;
}

.sli-progress-bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.sli-progress-bar {
    stroke: var(--color-success, #1DB954);
    transition: stroke-dashoffset 0.1s linear;
}

/* ============================================
   TICKET LINK (deprecated but kept for compatibility)
   ============================================ */

.show-list-item__ticket {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #aaa);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.show-list-item__ticket:hover {
    background: var(--accent-primary, #1DB954);
    color: #000;
}

.show-list-item__ticket svg {
    width: 16px;
    height: 16px;
}

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

@media (max-width: 767px) {
    .show-list-item__meta {
        font-size: 11px;
    }

    .show-list-item__artists {
        font-size: 13px;
    }

    .sli-audio-btn {
        width: 32px;
        height: 32px;
    }

    .sli-audio-btn svg:not(.sli-progress-ring) {
        width: 14px;
        height: 14px;
    }

    .sli-progress-ring {
        width: 32px;
        height: 32px;
    }

    .sli-thumb svg {
        width: 12px;
        height: 12px;
    }

    .show-list-item--playing .sli-thumb {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   PLAYING STATE ADJUSTMENTS
   ============================================ */

/* Playing state - content stays at top, container grows downward */
.show-list-item--playing {
    align-items: flex-start;
}
