/* ===== Player-specific overrides ===== */

body {
    background-color: #000;
    overflow: hidden;
}

.controls-hidden {
    cursor: none;
    overflow: hidden;
}

.controls-visible {
    cursor: default;
}

.controls-visible #main {
    height: calc(100vh - 72px);
}

.controls-visible #info-bar {
    bottom: 72px;
}

/* ===== Transport bar ===== */

#transport-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(18, 18, 18, 0.95);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    z-index: 10;
    box-sizing: border-box;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.controls-hidden #transport-bar {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.controls-visible #transport-bar {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Transport: now-playing zone ===== */

#transport-now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

#transport-cover {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: #333;
}

#transport-text {
    overflow: hidden;
}

#transport-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#transport-subtitle {
    color: #aaa;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Transport: progress zone ===== */

#transport-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

#transport-time-current,
#transport-time-total {
    color: #aaa;
    font-size: 11px;
    font-family: 'Noto Sans Mono', 'Noto Sans Mono Blank';
    min-width: 40px;
}

#transport-time-current {
    text-align: right;
}

#transport-time-total {
    text-align: left;
}

/* ===== Range slider shared styles (seek + volume) ===== */

#transport-seek {
    flex: 1;
    height: 14px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
}

#transport-seek::-webkit-slider-runnable-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
}

#transport-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-teal);
    cursor: pointer;
    margin-top: -5px;
}

#transport-seek::-moz-range-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
}

#transport-seek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-teal);
    border: none;
    cursor: pointer;
}

/* ===== Transport: controls zone ===== */

#transport-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.transport-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 8px;
    font-size: 0;
    transition: color 0.15s;
}

.transport-btn:hover {
    color: #fff;
}

.transport-btn .material-symbols {
    font-size: 24px;
}

.transport-btn-main .material-symbols {
    font-size: 32px;
}

/* ===== Volume slider ===== */

#volume-slider {
    width: 80px;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-teal);
    cursor: pointer;
    margin-top: -4px;
}

#volume-slider::-moz-range-track {
    height: 4px;
    background: #444;
    border-radius: 2px;
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-teal);
    border: none;
    cursor: pointer;
}

/* ===== Queue panel ===== */

#queue-panel {
    position: fixed;
    bottom: 72px;
    right: 0;
    width: 320px;
    max-height: 30vh;
    background: rgba(18, 18, 18, 0.98);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    border-left: 1px solid #333;
    padding: 16px;
}

#queue-panel.open {
    transform: translateX(0);
}

.queue-item {
    padding: 0.5em 0.75em;
    cursor: pointer;
    color: #aaa;
    font-size: 0.95em;
    border-radius: 4px;
    transition: background 0.15s;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.queue-item.active {
    color: var(--color-teal);
    font-weight: 700;
}

/* ===== Audio layout: artwork left 1/3, track list right 2/3, visualizer bg ===== */

#main.audio-layout {
    display: flex;
    position: relative;
    height: 100vh;
    padding: 0 10em;
    box-sizing: border-box;
}

#main.audio-layout #main-canvas-gl {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#main.audio-layout #main-image {
    position: relative;
    z-index: 1;
    width: 33.33%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    padding: 2em;
    box-sizing: border-box;
    flex-shrink: 0;
    align-self: center;
    border: none;
    background-color: transparent;
}

#main.audio-layout #track-list {
    position: relative;
    z-index: 1;
    left: auto;
    top: auto;
    transform: none;
    width: 66.67%;
    max-height: calc(100% - 20em);
    overflow-y: auto;
    scrollbar-width: none;
    padding: 1em 2em;
    margin: 10em 0;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
}

#main.audio-layout #track-list::-webkit-scrollbar {
    display: none;
}

/* ===== Track list (audio renderer) ===== */

#track-list {
    display: none;
}

.track-list-header {
    font-family: Rubik, 'Rubik Blank';
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #333;
}

.track-list-artist-link {
    color: var(--color-teal);
    text-decoration: none;
}

.track-list-artist-link:hover {
    text-decoration: underline;
}

.track-row {
    padding: 0.5em 0.75em;
    cursor: pointer;
    color: #aaa;
    font-size: 0.95em;
    border-radius: 4px;
    transition: background 0.15s;
}

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

.track-row.active {
    color: var(--color-teal);
    background: rgba(76, 168, 161, 0.1);
}

.track-row-title {
    font-weight: inherit;
}

.track-row.active .track-row-title::before {
    content: '\25B6';
    font-size: 0.8em;
    margin-right: 0.5em;
}

.track-row-meta {
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}

/* ===== Autoplay gate overlay ===== */

#autoplay-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--black-layer-index);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#autoplay-overlay.visible {
    display: flex;
}

#autoplay-play {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

#autoplay-play:hover {
    transform: scale(1.1);
}

#autoplay-play .material-symbols {
    font-size: 96px;
}

/* ===== Mobile responsive ===== */

@media (max-width: 768px) {
    /* Transport bar — compact */
    #transport-bar {
        height: 56px;
        padding: 0 8px;
        gap: 8px;
    }

    .controls-visible #main {
        height: calc(100vh - 56px);
    }

    .controls-visible #info-bar {
        bottom: 56px;
    }

    /* Now-playing zone — allow shrinking */
    #transport-now-playing {
        min-width: 0;
        max-width: 35%;
    }

    #transport-cover {
        width: 36px;
        height: 36px;
    }

    #transport-text {
        width: 0;
    }

    #transport-title {
        font-size: 12px;
    }

    #transport-subtitle {
        font-size: 10px;
    }

    /* Progress zone — hide time labels */
    #transport-time-current,
    #transport-time-total {
        display: none;
    }

    /* Controls — hide volume (use device buttons) */
    #volume-slider,
    #btn-volume {
        display: none;
    }

    /* Seek bar — larger touch targets */
    #transport-seek::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        margin-top: -7px;
    }

    #transport-seek::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }

    #transport-seek::-webkit-slider-runnable-track {
        height: 6px;
        border-radius: 3px;
    }

    #transport-seek::-moz-range-track {
        height: 6px;
        border-radius: 3px;
    }

    /* Queue panel — full width */
    #queue-panel {
        width: 100%;
        bottom: 56px;
    }

    /* Audio layout — stack vertically */
    #main.audio-layout {
        flex-direction: column;
        padding: 0;
    }

    #main.audio-layout #main-image {
        width: 100%;
        max-height: 40vh;
        padding: 1em;
    }

    #main.audio-layout #track-list {
        width: 100%;
        margin: 0;
        padding: 0.75em 1em;
        flex: 1;
    }
}
