/*
 * TimeRadio — Cosmic Prog prototype (progressbar width v6)
 * Presentation-only redesign. Existing application IDs and backend JS remain in place.
 */
:root {
    color-scheme: dark;
    --tr-bg: #08090e;
    --tr-panel: #11131c;
    --tr-panel-2: #191b27;
    --tr-text: #f5eee1;
    --tr-muted: #a6a8b7;
    --tr-amber: #ffad4a;
    --tr-blue: #4da8ff;
    --tr-line: rgba(255, 173, 74, .28);
    --tr-glow: rgba(77, 168, 255, .22);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--tr-bg); scroll-behavior: smooth; }
body {
    margin: 0; padding: 0 22px 24px; color: var(--tr-text);
    background:
      radial-gradient(ellipse at 12% 0%, rgba(110, 51, 30, .26), transparent 36rem),
      radial-gradient(ellipse at 92% 12%, rgba(26, 75, 130, .22), transparent 34rem),
      var(--tr-bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.5;
}
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background-image: radial-gradient(rgba(255,255,255,.22) .6px, transparent .6px);
    background-size: 23px 23px; opacity: .12;
}
img { max-width: 100%; height: auto; transition: opacity .35s ease; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--tr-blue); outline-offset: 4px; }
#audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Masthead */
.site-header {
    display: flex; align-items: center; gap: 17px; max-width: 1180px;
    margin: 0 auto; padding: 28px 0 24px; border-bottom: 1px solid var(--tr-line);
}
.brand-mark {
    display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 58px;
    color: #090b11; background: linear-gradient(145deg, #ffd18a, var(--tr-amber));
    font-weight: 950; font-size: 20px; letter-spacing: -2px;
    border-radius: 50%; box-shadow: 0 0 30px rgba(255,173,74,.15);
}
.brand-copy { min-width: 0; }
.eyebrow, .player-label, .player-mode, .player-status, .section-kicker {
    font-size: 10px; font-weight: 800; letter-spacing: .19em;
}
.eyebrow { margin: 0 0 1px; color: var(--tr-blue); }
.brand-title { font-size: clamp(27px, 4vw, 39px); line-height: 1; font-weight: 900; letter-spacing: .04em; }
.brand-title span { color: var(--tr-amber); }
.brand-tagline { margin: 7px 0 0; color: var(--tr-muted); font-size: 12px; letter-spacing: .04em; }
.header-signal { display: flex; align-items: center; gap: 4px; height: 35px; margin-left: auto; padding: 0 10px; }
.header-signal span { display: block; width: 3px; border-radius: 4px; background: var(--tr-blue); box-shadow: 0 0 8px var(--tr-glow); }
.header-signal span:nth-child(1), .header-signal span:nth-child(5) { height: 9px; }
.header-signal span:nth-child(2), .header-signal span:nth-child(4) { height: 20px; }
.header-signal span:nth-child(3) { height: 31px; background: var(--tr-amber); }

/* Main column */
.section { max-width: 1180px; margin: 0 auto; }
.container { width: 100%; margin: 0 auto; }
.row { display: flex; flex-direction: column; gap: 14px; }
.personal-greeting {
    display: none; padding: 12px; margin: 10px 0; text-align: center;
    background: var(--tr-panel); color: var(--tr-text); border: 1px solid var(--tr-line); border-radius: 8px;
}

/* Custom player */
.player-panel {
    margin: 24px auto 10px; padding: 18px 22px 14px; max-width: 920px;
    background: linear-gradient(120deg, rgba(30,27,31,.98), rgba(13,19,30,.98));
    border: 1px solid rgba(255,173,74,.38); border-radius: 16px;
    box-shadow: 0 16px 50px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.04);
    overflow: hidden; position: relative;
}
.player-panel::after {
    content: ""; position: absolute; width: 240px; height: 240px; right: -100px; top: -145px;
    border: 1px solid rgba(77,168,255,.22); border-radius: 50%;
    box-shadow: 0 0 0 22px rgba(77,168,255,.025), 0 0 0 48px rgba(77,168,255,.02);
    pointer-events: none;
}
.player-topline { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.live-indicator { display: inline-flex; align-items: center; gap: 8px; color: var(--tr-amber); font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.live-indicator i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 10px rgba(255,90,79,.8); }
.player-mode { color: #858da0; font-size: 9px; }
.player-main { display: flex; align-items: center; gap: 19px; padding: 20px 0 17px; }
.player-toggle {
    display: grid; place-items: center; flex: 0 0 68px; width: 68px; height: 68px;
    padding: 0 0 0 4px; border: 1px solid #ffd08b; border-radius: 50%;
    color: #14131a; background: linear-gradient(145deg, #ffd18a, var(--tr-amber));
    box-shadow: 0 0 0 6px rgba(255,173,74,.07), 0 0 28px rgba(255,173,74,.16);
    font-size: 23px; transition: transform .18s, box-shadow .18s, background .18s;
}
.player-toggle:hover { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(255,173,74,.09), 0 0 32px rgba(255,173,74,.22); }
.player-toggle.is-playing { padding-left: 0; color: #e9f5ff; background: #132b43; border-color: var(--tr-blue); box-shadow: 0 0 0 6px rgba(77,168,255,.08), 0 0 25px var(--tr-glow); }
.player-copy { flex: 1; min-width: 0; }
.player-label { color: var(--tr-blue); font-size: 9px; }
.player-title { margin-top: 4px; font-size: clamp(16px, 2.7vw, 23px); font-weight: 750; letter-spacing: -.025em; }
.player-subtitle { margin-top: 2px; color: var(--tr-muted); font-size: 12px; }
.player-orbit { width: 68px; height: 68px; flex: 0 0 68px; display: grid; place-items: center; border: 1px solid rgba(77,168,255,.2); border-radius: 50%; }
.orbit-disc { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: repeating-radial-gradient(circle, #171923 0 3px, #282a34 4px 5px); border: 1px solid #414554; }
.orbit-disc span { width: 9px; height: 9px; border-radius: 50%; background: var(--tr-amber); box-shadow: 0 0 9px rgba(255,173,74,.55); }
.player-controls { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.volume-control { display: flex; align-items: center; gap: 10px; color: #8d95a7; font-size: 9px; letter-spacing: .12em; }
#playerVolume { width: 105px; accent-color: var(--tr-blue); cursor: pointer; }
.player-status { color: #858da0; font-size: 9px; text-align: right; }

/* Stream quality */
.stream-selector { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 13px auto 24px; }
button:not(.player-toggle) {
    padding: 9px 15px; color: var(--tr-text); background: #171923;
    border: 1px solid #3c3e49; border-radius: 7px; font-size: 12px;
    transition: border-color .15s, background .15s, color .15s;
}
button:not(.player-toggle):hover { border-color: var(--tr-blue); background: #1c2634; }
#mp3-btn.active, #aac-btn.active { color: #11131a; background: var(--tr-amber); border-color: var(--tr-amber); font-weight: 800; }

/* Track information and album art */
.album-art-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(130px, 28%, 220px);
    align-items: start;
    gap: clamp(12px, 2.5vw, 24px);
    width: 100%;
}
.album-column { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.art-heading {
    margin: 8px 0 10px;
    color: var(--tr-amber);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}
.now-playing, .next-up {
    min-width: 0;
    margin-bottom: 10px;
    padding: 10px 12px;
    text-align: center;
    overflow-wrap: anywhere;
    background: rgba(18,20,30,.88);
    border: 1px solid #292d3b;
    border-radius: 9px;
}
.now-playing { border-top: 2px solid var(--tr-blue); }
.next-up { border-top: 2px solid var(--tr-amber); }
h1 { margin: 0; font-size: clamp(16px, 2.5vw, 25px); line-height: 1.2; letter-spacing: -.03em; text-align: center; }
h3 { position: relative; color: var(--tr-amber); font-size: 12px; text-align: center; }
h4 { position: relative; margin: 0; color: #e9c18c; font-size: 13px; text-align: center; }
h5 { width: 100%; padding: 5px; font-size: 12px; text-align: center; }
#nowPlaying, #nextSong { transition: opacity .35s ease; }
.current-album-art {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
}
.current-album-art img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: none;
    object-fit: contain;
    object-position: center;
    border: 1px solid rgba(255, 173, 74, .2);
    border-radius: 10px;
    background: #0d0e14;
}
.right-image {
    display: block;
    width: 100%;
    max-height: none;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: #0d0e14;
    opacity: .82;
}

/* Countdown bar and shuffle */
.song-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 90vw;
    max-width: 1060px;
    box-sizing: border-box;
    margin: 16px auto 0;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(77, 168, 255, .18);
    border-radius: 10px;
    background: rgba(13, 15, 24, .92);
}
#songDuration, #elapsedTime {
    color: var(--tr-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
#progressBar {
    display: block;
    grid-column: auto;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
    max-width: none;
    height: 14px;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: #252a38;
    accent-color: var(--tr-blue);
}
#progressBar::-webkit-progress-bar {
    border-radius: 999px;
    background: linear-gradient(180deg, #292e3e, #1a1d29);
}
#progressBar::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #ffad4a, #4da8ff);
    box-shadow: 0 0 8px rgba(77, 168, 255, .3);
    transition: width .25s linear;
}
#progressBar::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #ffad4a, #4da8ff);
    box-shadow: 0 0 8px rgba(77, 168, 255, .3);
}
.shuffle-row { display: flex; justify-content: center; align-items: center; width: 100%; padding: 10px 0 0; }
#shuffle { width: 100%; min-height: 38px; padding: 8px 10px; color: var(--tr-amber); background: rgba(255,173,74,.07); border: 1px solid var(--tr-line); border-radius: 7px; font-size: 11px; text-align: center; }
/* Artist, search, playlist and chat */
.artist-box { padding: 15px; background: rgba(18,20,30,.88); border: 1px solid #292d3b; border-radius: 9px; }
#artist { color: var(--tr-blue); font-weight: 800; }
.artist-bio { padding: 8px 0 0; color: #c4c5ce; }
.artist-bio h5 { color: var(--tr-muted); margin: 0; }
#searchInput, #messageInput { width: 100%; padding: 12px 14px; color: var(--tr-text); background: #11131b; border: 1px solid #373b49; border-radius: 7px; font-size: 15px; }
#searchInput:focus, #messageInput:focus { border-color: var(--tr-blue); outline: none; box-shadow: 0 0 0 3px rgba(77,168,255,.1); }
#results { margin: -6px 0 5px; padding: 0; list-style: none; }
#results li { padding: 9px 12px; overflow-wrap: anywhere; cursor: pointer; background: #141722; border-bottom: 1px solid #292d3b; }
#results li:hover { background: #1d2a3a; }
#songListContainer { width: 100%; max-width: 100%; height: 300px; margin: 0; padding: 8px; overflow-y: auto; border: 1px solid #373b49; border-radius: 8px; background: #0d0f16; }
.song { margin: 2px; padding: 5px 7px; color: #d6d4ce; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; border-radius: 4px; }
.song:hover { background: #1b202d; }
.song.highlighted { background: #202e40; color: #fff; font-weight: 700; }
.song-list-spacer { display: flex; justify-content: center; align-items: center; flex-direction: column; margin-top: 5px; }
#messages { height: 260px; margin: 8px 0 10px; padding: 10px; overflow-y: auto; overflow-wrap: anywhere; background: #10121a; border: 1px solid #373b49; border-radius: 8px; }
#submitButton { margin-top: 8px; }
.flex-container { display: flex; align-items: center; justify-content: center; max-width: 90%; margin: 5px auto; padding: 5px; }
.flex-container img { width: 50px; height: 50px; margin-right: 30px; }
.flex-container .text { color: var(--tr-text); font-size: 20px; }
.songdurationcontainer { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100px; }
.duration-time { margin-top: 1px; padding: 5px; border: 1px solid var(--tr-text); border-radius: 5px; font-size: 1.2rem; font-weight: bold; }
footer { width: 100%; margin-top: 25px; padding: 18px 8px 10px; color: var(--tr-muted); font-size: 12px; line-height: 2; text-align: center; border-top: 1px solid var(--tr-line); }
footer a { color: #e8b66e; text-decoration: none; }
footer a:hover { color: var(--tr-blue); text-decoration: underline; }

@media (max-width: 700px) {
    body { padding: 0 13px 18px; }
    .site-header { padding: 20px 0 17px; gap: 12px; }
    .brand-mark { width: 47px; height: 47px; flex-basis: 47px; font-size: 17px; }
    .eyebrow { font-size: 8px; letter-spacing: .12em; }
    .brand-tagline { font-size: 10px; }
    .header-signal { display: none; }
    .player-panel { margin-top: 16px; padding: 15px; }
    .player-main { gap: 14px; }
    .player-toggle { flex-basis: 58px; width: 58px; height: 58px; }
    .player-orbit { width: 48px; height: 48px; flex-basis: 48px; }
    .orbit-disc { width: 34px; height: 34px; }
    .player-mode { font-size: 8px; letter-spacing: .1em; }
    .player-title { font-size: 16px; }
    .player-controls { align-items: flex-start; flex-direction: column; gap: 8px; }
    .player-status { text-align: left; }
    .album-art-row {
        grid-template-columns: minmax(0, 1fr) minmax(105px, 0.58fr);
        gap: 10px;
        align-items: start;
    }
    .now-playing, .next-up { padding: 8px 7px; }
    .art-heading { font-size: 11px; letter-spacing: .04em; }
    #shuffle { padding: 8px 5px; font-size: 10px; }
   .song-info { gap: 8px; }
    #songListContainer { width: 100%; }
}
@media (max-width: 420px) {
    .player-orbit { display: none; }
    .player-topline { align-items: flex-start; }
    .player-mode { text-align: right; }
    .album-art-row {
        grid-template-columns: minmax(0, 1fr) minmax(94px, .62fr);
        gap: 8px;
    }
    .right-image { opacity: .75; }
    .art-heading { font-size: 10px; }
    h1 { font-size: 15px; }
    h4 { font-size: 11px; }
   .song-info { gap: 8px; padding: 8px; }
    #songDuration, #elapsedTime { font-size: 11px; }
    #progressBar { height: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
