/* assets/css/player.css */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #0f0f0f;
    --bg2:        #1a1a1a;
    --bg3:        #242424;
    --border:     #2e2e2e;
    --text:       #e8e8e8;
    --text2:      #dcdcdc;
    --accent:     #c8a96e;
    --accent2:    #a8843e;
    --star-on:    #c8a96e;
    --star-off:   #3a3a3a;
    --heard:      #5a9e6f;
    --unheard:    #555;
    --radius:     8px;
    --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.site-header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    border-bottom: 1px solid var(--border);
}
.site-header h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--accent);
}
.site-header .tagline {
    color: var(--text2);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.4rem;
}
.site-header .welcome {
    margin-top: 1rem;
    color: var(--text2);
    font-size: 0.9rem;
}
.site-header .welcome strong { color: var(--text); }

/* Layout */
.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.instructions {
    color: var(--text2);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    text-align: center;
}

.dashboard-message {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text1);
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Error / notice */
.error-box, .notice-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text2);
}
.error-box { border-color: #5c2a2a; }

/* Release list */
.release-list { display: flex; flex-direction: column; gap: 1rem; }

/* Release card */
.release-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Release toggle button */
.release-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    color: var(--text);
    transition: background 0.15s;
}
.release-toggle:hover { background: var(--bg3); }
.release-toggle[aria-expanded="true"] { border-bottom: 1px solid var(--border); }

.release-toggle-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-width: 0;
}
.release-title {
    font-size: 0.97rem;
    font-weight: 500;
    color: #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.release-meta {
    font-size: 0.72rem;
    color: var(--text2);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.release-toggle-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.listened-summary {
    font-size: 0.75rem;
    color: var(--text2);
    white-space: nowrap;
}
.listened-summary.all-heard { color: var(--heard); }

.chevron {
    color: var(--text2);
    font-size: 0.9rem;
    transition: transform 0.2s;
    display: inline-block;
    width: 14px;
    text-align: center;
}
.release-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* Release body */
.release-body { padding: 1rem 1.25rem 1.25rem; }

/* Track list inside release */
.track-list { display: flex; flex-direction: column; gap: 1rem; }

/* Track card */
.track-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.track-header {
    padding: 0.75rem 1rem 0.6rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Heard dot indicator -- three states */
.heard-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--unheard);
    transition: background 0.3s;
}
.heard-dot--unheard  { background: var(--unheard); }
.heard-dot--partial  { background: #c8a140; }
.heard-dot--heard    { background: var(--heard); }

.track-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #e8e8e8;
    flex: 1 1 auto;
}
.track-desc {
    font-size: 0.82rem;
    color: var(--text2);
}
.play-badge {
    font-size: 0.75rem;
    color: var(--text2);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.1rem 0.6rem;
    white-space: nowrap;
}

/* Custom player */
.player-wrap {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
audio { display: none; }

.custom-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.play-btn {
    background: var(--accent);
    border: none;
    color: #000;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.play-btn:hover { background: var(--accent2); }

.progress-wrap { flex: 1; }
.progress-bar {
    height: 4px;
    background: var(--bg2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin-bottom: 0.4rem;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
    transition: width 0.1s linear;
}
.time-display {
    font-size: 0.75rem;
    color: var(--text2);
    font-variant-numeric: tabular-nums;
}
.time-sep { margin: 0 0.2rem; }

/* Feedback section */
.feedback-section { padding: 0.75rem 1rem 1rem; }
.feedback-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

/* Stars */
.rating-wrap { margin-bottom: 0.85rem; }
.stars {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}
.star {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--star-off);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.1s;
}
.star.active,
.star.hover { color: var(--star-on); }
.rating-value {
    font-size: 0.85rem;
    color: var(--accent);
    margin-left: 0.5rem;
    min-width: 2.5rem;
}

/* Comment */
.comment-wrap { margin-bottom: 0.85rem; }
.comment-box {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    resize: vertical;
    transition: border-color 0.15s;
}
.comment-box:focus { outline: none; border-color: var(--accent); }

/* Submit */
.submit-wrap { display: flex; align-items: center; gap: 1rem; }
.submit-btn {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.submit-btn:hover { background: var(--accent2); }
.submit-status { font-size: 0.82rem; color: var(--text2); }
.submit-status.ok  { color: #6abf7b; }
.submit-status.err { color: #c45c5c; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text2);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 520px) {
    .site-header h1 { font-size: 1.5rem; }
    .star { font-size: 1.05rem; }
    .release-toggle { padding: 0.85rem 1rem; }
}

/* Logo */

/* Logo */
.site-header h1 { line-height: 1; }
.site-logo {
    display: block;
    margin: 0 auto;
    height: 150px;
    width: auto;
}

/* Version / copyright footer line */
.footer-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text2);
    opacity: 0.6;
}

/* Updated file badge */
.updated-badge {
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(200, 169, 110, 0.12);
    border: 1px solid rgba(200, 169, 110, 0.3);
    border-radius: 20px;
    padding: 0.1rem 0.6rem;
    white-space: nowrap;
    font-weight: 500;
}

/* Loading indicator */
.player-loading {
    font-size: 0.78rem;
    color: var(--text2);
    font-style: italic;
    margin-left: 0.5rem;
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* Resume badge */
.resume-badge {
    font-size: 0.72rem;
    color: #c8a140;
    background: rgba(200, 161, 64, 0.12);
    border: 1px solid rgba(200, 161, 64, 0.3);
    border-radius: 20px;
    padding: 0.1rem 0.6rem;
    white-space: nowrap;
    cursor: pointer;
}

/* Loading indicator */
.loading-indicator {
    color: #ffff00;
    font-size: 0.75rem;
    font-style: italic;
    font-weight: 500;
}

/* Resume hint */
.resume-hint {
    font-size: 0.75rem;
    color: var(--text2);
    margin-top: 0.3rem;
}
.resume-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}
.resume-link:hover { color: var(--accent2); }

/* Session expiry error box */
.error-box--expired {
    border-color: #6b4c1a;
    background: #1e1509;
}
.error-greeting {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.error-title {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.error-body {
    font-size: 0.9rem;
    color: var(--text2);
    margin-top: 0.4rem;
    line-height: 1.6;
}

/* =====================================================
   v1.02 -- Release artwork (listener portal)
   ===================================================== */

/* Thumbnail in collapsed release toggle header */
.release-thumb {
    width: 44px;
    height: 44px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
    display: block;
    background: #111;
}
.release-thumb--default {
    object-fit: contain;
    padding: 6px;
    opacity: 0.4;
}

/* Artwork strip shown at top of expanded release body */
.release-artwork-expanded {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0 1rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.release-artwork-expanded img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: block;
}
.release-artwork-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.release-artwork-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}
.release-artwork-meta {
    font-size: 0.72rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

@media (max-width: 520px) {
    .release-thumb { width: 36px; height: 36px; }
    .release-artwork-expanded img { width: 56px; height: 56px; }
}

/* =====================================================
   v1.05 -- Artwork lightbox
   ===================================================== */

.artwork-clickable {
    cursor: zoom-in;
    transition: opacity 0.15s;
}
.artwork-clickable:hover { opacity: 0.85; }

.artwork-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.artwork-lightbox.is-open {
    display: flex;
}
.artwork-lightbox-inner {
    position: relative;
    max-width: 1024px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.artwork-lightbox-inner img {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 4rem);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}
.artwork-lightbox-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.06em;
    text-align: center;
    margin: 0;
}
.artwork-lightbox-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.artwork-lightbox-close:hover { background: rgba(200, 50, 50, 0.8); }

/* v1.20 -- access & social settings */
.site-socials {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}
.site-social-link {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.site-social-link:hover { background: rgba(255,255,255,0.12); }
.auth-box, .listener-settings-card {
    max-width: 760px;
    margin: 0 auto 1.5rem;
}
.auth-box-title, .listener-settings-card h2 {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
}
.auth-box-text, .auth-box-note {
    color: var(--text2);
}
.listener-auth-form,
.listener-preferences-form {
    display: grid;
    gap: 0.85rem;
}
.listener-auth-form label,
.listener-preferences-form label {
    display: grid;
    gap: 0.4rem;
    color: var(--text);
    font-size: 0.92rem;
}
.listener-auth-form input,
.listener-preferences-form input[type="email"] {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text);
    padding: 0.8rem 0.9rem;
}
.listener-pref-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    color: var(--text2);
    font-size: 0.9rem;
}
.listener-pref-checks label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.listener-pref-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.submit-btn--inline {
    width: auto;
    min-width: 220px;
}
.listener-preferences-form--secondary {
    margin-top: 0.8rem;
}
@media (max-width: 640px) {
    .submit-btn--inline { width: 100%; min-width: 0; }
}
