/* RADIO SABUR – javni player */
:root {
  --green: #16a34a;
  --green-2: #22c55e;
  --green-d: #0f7a37;
  --bg: #050a07;
  --card: #0c1510;
  --line: #1b2b21;
  --txt: #ffffff;
  --muted: #9db3a5;
  --radius: 24px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  background: radial-gradient(120% 70% at 50% -10%, #14462a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--green-2); outline-offset: 3px; }
[hidden] { display: none !important; }

.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

/* ---------- zaglavlje ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 4px 0 18px; }
.top-logo { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: contain; }
.brand { flex: 1; min-width: 0; }
.brand h1 { font-size: 17px; font-weight: 800; letter-spacing: 2.5px; line-height: 1.2; }
.brand p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.live {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 99px; background: #171d19; color: #8a998f;
  font-size: 11px; letter-spacing: 1.5px;
}
.live b { font-weight: 800; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #56635b; }
.live.on { background: rgba(34, 197, 94, .14); color: var(--green-2); }
.live.on i { background: var(--green-2); animation: pulse 1.8s infinite; }
.live.off { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.live.off i { background: #ef4444; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------- omot ---------- */
.cover-wrap {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .85), 0 0 0 1px var(--line);
}
.cover { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .35s; }
.cover.fade { opacity: 0; }
/* logo Džemata kad nema omota albuma */
.cover[src$="logo.png"] { object-fit: contain; padding: 14%; background: radial-gradient(circle at 50% 40%, #14532d 0%, #07100a 72%); }
.history img[src$="logo.png"] { object-fit: contain; padding: 5px; background: #0f2418; }
.eq {
  position: absolute; left: 14px; bottom: 14px; display: flex; gap: 3px; align-items: flex-end;
  height: 30px; padding: 7px 9px; border-radius: 10px; background: rgba(0, 0, 0, .55);
  opacity: 0; transition: opacity .3s;
}
.eq span { width: 3px; height: 4px; background: var(--green-2); border-radius: 2px; }
.playing .eq { opacity: 1; }
.playing .eq span { animation: eq 1s infinite ease-in-out; }
.eq span:nth-child(2) { animation-delay: -.4s !important; }
.eq span:nth-child(3) { animation-delay: -.7s !important; }
.eq span:nth-child(4) { animation-delay: -.2s !important; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* ---------- naslov ---------- */
.now { padding: 22px 2px 4px; min-height: 108px; }
.label { font-size: 11px; letter-spacing: 1.8px; color: var(--green-2); font-weight: 700; margin-bottom: 6px; }
.title {
  font-size: 23px; font-weight: 800; line-height: 1.25; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.artist { color: var(--muted); font-size: 16px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }

/* ---------- play ---------- */
.controls { display: flex; flex-direction: column; align-items: center; padding: 18px 0 6px; }
.play {
  position: relative; width: 88px; height: 88px; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center;
  box-shadow: 0 14px 34px -8px rgba(22, 163, 74, .75);
  transition: transform .15s, background .2s;
}
.play:hover { background: var(--green-2); }
.play:active { transform: scale(.94); }
.play svg { width: 38px; height: 38px; fill: currentColor; grid-area: 1 / 1; }
.play .i-pause, .play .spinner { display: none; }
.play .spinner {
  grid-area: 1 / 1; width: 36px; height: 36px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .9s linear infinite;
}
.state-playing .play .i-play, .state-loading .play .i-play { display: none; }
.state-playing .play .i-pause { display: block; }
.state-loading .play .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg { min-height: 20px; margin-top: 10px; font-size: 13px; color: #fca5a5; text-align: center; }

/* ---------- jačina zvuka ---------- */
.volume { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
.mute { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); flex: none; }
.mute svg { width: 22px; height: 22px; grid-area: 1 / 1; fill: currentColor; }
.mute svg .w { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mute .i-mute { display: none; }
.muted .mute .i-vol { display: none; }
.muted .mute .i-mute { display: block; }
#volPct { width: 44px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
input[type=range] {
  flex: 1; min-width: 0; height: 28px; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 5px;
  background: linear-gradient(90deg, var(--green-2) var(--p, 80%), #26332b var(--p, 80%));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
input[type=range]::-moz-range-track { height: 5px; border-radius: 5px; background: #26332b; }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--green-2); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; }
.ios-note { font-size: 12.5px; color: var(--muted); text-align: center; }

.stats { text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px 0 0; min-height: 26px; }

/* ---------- historija ---------- */
.history {
  margin-top: 16px; padding: 14px 14px 6px;
  background: rgba(12, 21, 16, .75); border: 1px solid var(--line); border-radius: 18px;
}
.history h3 { font-size: 11.5px; letter-spacing: 1.8px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.history ol { list-style: none; }
.history li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: #13201a; }
.history .t { flex: 1; min-width: 0; }
.history .t b, .history .t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history .t b { font-size: 14px; font-weight: 600; }
.history .t span { font-size: 12.5px; color: var(--muted); }
.history time { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.foot { margin-top: auto; padding-top: 24px; text-align: center; font-size: 12px; color: #5b6e62; }

/* ---------- veći ekrani: dvije kolone ---------- */
@media (min-width: 900px) {
  .app {
    max-width: 960px; padding-top: 48px;
    display: grid; grid-template-columns: 420px 1fr; column-gap: 48px; align-content: start;
    grid-template-areas: "top top" "cover now" "cover controls" "cover volume" "cover ios" "cover stats" "hist hist" "foot foot";
  }
  .top { grid-area: top; padding-bottom: 28px; }
  .cover-wrap { grid-area: cover; align-self: start; }
  .now { grid-area: now; padding-top: 30px; }
  .title { font-size: 32px; }
  .controls { grid-area: controls; align-items: flex-start; }
  .msg { text-align: left; }
  .volume { grid-area: volume; max-width: 380px; }
  .ios-note { grid-area: ios; }
  .stats { grid-area: stats; text-align: left; }
  .history { grid-area: hist; margin-top: 32px; }
  .history ol { columns: 2; column-gap: 32px; }
  .history li { break-inside: avoid; border-top: 0; border-bottom: 1px solid var(--line); }
  .foot { grid-area: foot; }
}
/* niski ekrani mobitela – manji omot da play dugme bude vidljivo bez skrolanja */
@media (max-width: 899px) and (max-height: 740px) {
  .cover-wrap { width: 72%; margin: 0 auto; }
  .now { min-height: 96px; padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* prijenos uživo iz džemata */
.live.mic { background: rgba(239, 68, 68, .16); color: #fecaca; }
.live.mic i { background: #ef4444; animation: pulseRed 1.4s infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); } 70% { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.mic #nowLabel { color: #f87171; }
.mic .cover-wrap { box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .85), 0 0 0 2px #ef4444; }

/* raspored */
.sched li { gap: 12px; }
.sched time { width: 46px; min-width: 46px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; order: -1; flex: none; }
.sched li.cur time, .sched li.cur .t span { color: var(--green-2); }
.sched li.event time { color: #facc15; font-weight: 700; }
.sched li.event .t span { color: #facc15; opacity: .8; }
.mic .sched li.cur time, .mic .sched li.cur .t span { color: #f87171; }
.sched time { min-width: 50px; white-space: nowrap; }

/* vaktija */
.vakat { margin-top: 16px; }
@media (min-width: 900px) { .vakat { grid-area: hist; } .app { grid-template-areas: "top top" "cover now" "cover controls" "cover volume" "cover ios" "cover stats" "vk vk" "tl tl" "hist hist" "foot foot"; } .vakat { grid-area: vk; } .sched { grid-area: tl; } }

/* ---------- vaktija: sljedeći namaz ---------- */
.vakat { margin-top: 22px; padding: 16px; border-radius: 20px; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, rgba(34,197,94,.22), transparent 55%), linear-gradient(160deg, #0f2318, #08120c);
  border: 1px solid #1f4a30; box-shadow: 0 20px 40px -24px rgba(0,0,0,.9); }
.vk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.vk-kick { display: block; font-size: 10.5px; letter-spacing: 2px; font-weight: 800; color: var(--green-2); }
.vk-next { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.5px; line-height: 1.1; }
.vk-cdw { text-align: right; }
.vk-cd { display: inline-block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; color: #052e16; background: var(--green-2); padding: 4px 12px; border-radius: 99px; box-shadow: 0 0 20px rgba(34,197,94,.45); }
.vk-at { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.vk-prog { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin: 12px 0; overflow: hidden; }
.vk-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--green-2)); border-radius: 4px; transition: width 1s linear; }
.vk { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.vk-c { text-align: center; padding: 9px 2px; border-radius: 12px; min-width: 0; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.05); }
.vk-c span { display: block; font-size: 10px; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vk-c b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.vk-c.past { opacity: .45; }
.vk-c.sun { background: rgba(250,204,21,.05); }
.vk-c.next { background: linear-gradient(180deg, rgba(34,197,94,.4), rgba(22,163,74,.2)); border-color: var(--green-2); box-shadow: 0 8px 22px -10px rgba(34,197,94,.8); }
.vk-c.next span { color: #fff; }
.vk-src { margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: center; }
@media (max-width: 360px) { .vk { grid-template-columns: repeat(3, 1fr); } }

/* ---------- raspored: vremenska linija ---------- */
.sched ol { position: relative; }
.sched ol::before { content: ""; position: absolute; left: 53px; top: 14px; bottom: 14px; width: 2px; background: linear-gradient(var(--line), #23402d, var(--line)); }
.sched li { position: relative; border-top: 0 !important; padding: 8px 0; }
.sched li::before { content: ""; position: absolute; left: 49px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #2a3b30; border: 2px solid var(--bg); }
.sched li .t { padding-left: 18px; }
.sched li.cur::before { background: var(--green-2); box-shadow: 0 0 0 4px rgba(34,197,94,.25); }
.sched li.cur .t b { color: #fff; }
.sched li.prayer::before { background: #facc15; box-shadow: 0 0 0 4px rgba(250,204,21,.18); }
.sched li.prayer .t b { color: #fde68a; }
.sched li.prayer .t b::before { content: "🕌 "; }
.sched li.prog::before { background: #60a5fa; }
.sched li.prog time, .sched li.prog .t span { color: #93c5fd; }
.sched li.prog .t b { color: #bfdbfe; }
@media (min-width: 900px) { .sched ol { columns: auto; max-width: 620px; } .sched li { border-bottom: 0 !important; } }

/* ---------- footer, autor, kontakt ---------- */
.foot p { margin-top: 4px; }
.foot .author { color: #6f8a79; } .foot .author b { color: #9fd8b2; font-weight: 600; }
.contact-btn { display: inline-block; margin-bottom: 12px; padding: 10px 18px; border-radius: 99px; background: rgba(34,197,94,.12); border: 1px solid #2a5a3b; color: var(--green-2); font-weight: 700; font-size: 14px; }
.contact-btn:hover { background: rgba(34,197,94,.22); }
dialog.ct { margin: auto; width: min(440px, calc(100vw - 32px)); border: 1px solid #1f4a30; border-radius: 20px; padding: 0; background: linear-gradient(160deg, #0f2318, #08120c); color: var(--txt); box-shadow: 0 30px 80px rgba(0,0,0,.7); }
dialog.ct::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.ct form { padding: 20px; display: grid; gap: 10px; }
.ct-h { display: flex; justify-content: space-between; align-items: center; }
.ct-h h3 { font-size: 20px; }
.ct-x { font-size: 28px; line-height: 1; color: var(--muted); padding: 0 6px; }
.ct-sub { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ct label { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.ct input, .ct textarea { font: inherit; font-size: 15px; color: var(--txt); background: rgba(0,0,0,.35); border: 1px solid #23402d; border-radius: 12px; padding: 11px 12px; width: 100%; }
.ct textarea { resize: vertical; min-height: 110px; }
.ct input:focus, .ct textarea:focus { outline: 2px solid var(--green-2); border-color: transparent; }
.ct .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ct-send { margin-top: 4px; padding: 13px; border-radius: 14px; background: var(--green); color: #fff; font-weight: 800; font-size: 15px; }
.ct-send:hover { background: var(--green-2); } .ct-send:disabled { opacity: .6; }
.ct-msg { font-size: 13.5px; min-height: 18px; } .ct-msg.ok { color: var(--green-2); } .ct-msg.err { color: #fca5a5; }
.top-mail { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(34,197,94,.12); border: 1px solid #2a5a3b; color: var(--green-2); transition: background .2s, transform .2s; }
.top-mail:hover { background: rgba(34,197,94,.24); transform: translateY(-1px); }
.top-mail svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* sleep timer + autoplay */
.sleep-w { position: relative; margin-top: 10px; }
.sleep-b { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; transition: .2s; font-variant-numeric: tabular-nums; }
.sleep-b:hover { color: var(--txt); border-color: #2a5a3b; }
.sleep-b svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.sleep-b.on { color: #c4b5fd; border-color: rgba(167,139,250,.45); background: rgba(139,92,246,.12); }
.sleep-m { position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); top: calc(100% + 8px); width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.sleep-m p { margin: 0 0 8px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; }
.sleep-o { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sleep-o button, .sleep-off { background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt); border-radius: 10px; padding: 8px 4px; font: inherit; font-size: 13px; cursor: pointer; }
.sleep-o button:hover { border-color: var(--green-2); color: var(--green-2); }
.sleep-off { width: 100%; margin-top: 8px; color: #fca5a5; }
.tap-note { margin: 10px 0 0; font-size: 13px; color: var(--green-2); animation: tapn 1.6s ease-in-out infinite; }
@keyframes tapn { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .tap-note { animation: none; } }
