/* ===== مواقيت الصلاة — واجهة تلفزيون ===== */
:root {
  --bg: #060f19;
  --bg2: #0b1c2c;
  --card: #0e2134;
  --card2: #0a1826;
  --ink: #f4f8fc;
  --muted: #9db4c9;
  --accent: #ffc75a;
  --accent2: #ffb01f;
  --line: rgba(255, 255, 255, .10);
  --good: #6ee7b7;
}

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

html, body { height: 100%; }

body {
  background:
    radial-gradient(120% 90% at 80% 0%, #12304a 0%, rgba(18, 48, 74, 0) 55%),
    radial-gradient(100% 80% at 10% 100%, #10283c 0%, rgba(16, 40, 60, 0) 60%),
    linear-gradient(160deg, var(--bg2) 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: 'Cairo', 'Noto Kufi Arabic', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.nocursor { cursor: none; }

.frame {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.6vh;
  padding: 2.4vh 2.4vw 1.6vh;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2vw;
  padding: 0 1vw .4vh;
}

.city {
  font-size: 5.2vh;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.01em;
}

.dates {
  margin-top: .9vh;
  font-size: 2.7vh;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  gap: .9vw;
  align-items: center;
  flex-wrap: wrap;
}

.dates .hijri { color: #cfe4f5; }
.dates .sep { color: rgba(255, 255, 255, .28); }

.clockWrap { text-align: left; }

.clock {
  font-family: 'Roboto Mono', 'Cairo', monospace;
  font-size: 7.6vh;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  display: flex;
  align-items: baseline;
  gap: .06em;
  direction: ltr;
}

.clock .ampm {
  font-family: 'Cairo', sans-serif;
  font-size: 3.2vh;
  font-weight: 700;
  color: var(--accent);
  margin-inline-start: .5vw;
}

.clock .c { color: rgba(255, 255, 255, .45); }

.statusLine {
  margin-top: .8vh;
  font-size: 2.2vh;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- main ---------- */
.main {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 2.2vw;
  min-height: 0;
}

/* next prayer card */
.nextCard {
  position: relative;
  background: linear-gradient(165deg, #10273c 0%, var(--card2) 78%);
  border: 1px solid rgba(255, 199, 90, .34);
  border-radius: 2.2vh;
  padding: 2.4vh 2.4vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 2vh 6vh rgba(0, 0, 0, .45);
  overflow: hidden;
}

.nextCard::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 60%;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255, 199, 90, .18), rgba(255, 199, 90, 0) 70%);
  pointer-events: none;
}

.nextLabel {
  font-size: 3vh;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .16em;
  opacity: .95;
}

.nextName {
  font-size: 10.6vh;
  font-weight: 900;
  line-height: 1.06;
  margin-top: .4vh;
  text-shadow: 0 0 4vh rgba(255, 199, 90, .22);
}

.nextTime {
  font-size: 5vh;
  font-weight: 700;
  color: #ffe6ae;
  margin-top: .2vh;
  font-variant-numeric: tabular-nums;
}

.countLabel {
  margin-top: 2.6vh;
  font-size: 2.6vh;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .05em;
}

.countdown {
  font-family: 'Roboto Mono', 'Cairo', monospace;
  font-size: 12.6vh;
  font-weight: 700;
  line-height: 1.02;
  direction: ltr;
  display: flex;
  align-items: baseline;
  gap: .04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.countdown .c { color: rgba(255, 255, 255, .38); }

/* fixed-width digits so the clock never jitters */
.d { display: inline-block; min-width: 1.02em; text-align: center; }
.countdown > .d { display: inline-flex; min-width: 0; }
.dd { display: inline-block; width: .62em; text-align: center; }
body.locked .frame { padding-bottom: 19vh; }

.progress {
  width: 100%;
  height: 1.1vh;
  min-height: 8px;
  background: rgba(255, 255, 255, .10);
  border-radius: 99px;
  margin-top: 2.6vh;
  overflow: hidden;
}

.progress .bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent2), #ffe1a0);
  transition: width .5s linear;
}

.progressFoot {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 1.1vh;
  font-size: 2.2vh;
  color: var(--muted);
  font-weight: 600;
}

/* times list */
.times {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 1.05vh;
  min-height: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1vw;
  padding: 0 2vw;
  border-radius: 1.6vh;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
}

.row .name { font-size: 4.5vh; font-weight: 700; }
.row .time {
  font-size: 4.7vh;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e8f2fb;
}

.row.sunrise .name, .row.sunrise .time { color: #a8c8e2; font-weight: 600; }
.row.past { opacity: .52; }

.row.next {
  background: linear-gradient(90deg, #ffd37a 0%, var(--accent) 55%, #ffbe3d 100%);
  border-color: #ffe3a8;
  color: #08131f;
  box-shadow: 0 1.4vh 3.4vh rgba(255, 178, 40, .26);
  opacity: 1;
}

.row.next .name, .row.next .time { color: #08131f; font-weight: 900; }

.row .badge {
  font-size: 1.9vh;
  font-weight: 800;
  background: rgba(8, 19, 31, .16);
  color: #08131f;
  padding: .35vh 1.1vw;
  border-radius: 99px;
  margin-inline-start: 1.2vw;
  display: none;
}

.row.next .badge { display: inline-block; }

/* ---------- footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2vw;
  font-size: 1.95vh;
  color: #7f97ad;
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding: .9vh 1vw 0;
  font-weight: 600;
}

.footer .state { color: var(--good); }

/* ---------- corner buttons ---------- */
.corner {
  position: fixed;
  top: 1vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .6vw;
  opacity: .35;
  transition: opacity .25s;
  z-index: 40;
}

.corner:hover, .corner:focus-within { opacity: 1; }

.iconBtn {
  font-size: 3.4vh;
  line-height: 1;
  width: 5.4vh;
  height: 5.4vh;
  border-radius: 1.2vh;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  cursor: pointer;
}

.iconBtn:hover { background: rgba(255, 255, 255, .16); }

/* ---------- unlock bar ---------- */
.unlockBar {
  position: fixed;
  bottom: 2vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
}

.unlockBar.hidden { display: none; }

#unlockBtn {
  display: flex;
  align-items: center;
  gap: 1.2vw;
  background: linear-gradient(90deg, #ffd37a, var(--accent));
  color: #08131f;
  border: none;
  border-radius: 1.6vh;
  padding: 1.4vh 2.4vw;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1.6vh 4vh rgba(255, 178, 40, .35);
}

#unlockBtn .ubIcon { font-size: 4.6vh; }
#unlockBtn .ubText { display: flex; flex-direction: column; text-align: start; }
#unlockBtn strong { font-size: 2.9vh; font-weight: 900; }
#unlockBtn small { font-size: 1.9vh; font-weight: 700; opacity: .8; }

/* ---------- banner ---------- */
.banner {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%) translateY(-2vh);
  background: rgba(9, 24, 38, .96);
  border: 2px solid var(--accent);
  color: var(--ink);
  border-radius: 1.6vh;
  padding: 1.8vh 3vw;
  font-size: 3.4vh;
  font-weight: 800;
  text-align: center;
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  box-shadow: 0 2vh 5vh rgba(0, 0, 0, .5);
  max-width: 80vw;
}

.banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.banner .sub { display: block; font-size: 2.2vh; color: var(--accent); margin-top: .6vh; font-weight: 700; }

/* ---------- adhan overlay ---------- */
.adhanOverlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(80% 80% at 50% 40%, rgba(14, 40, 62, .97), rgba(4, 10, 16, .99));
}

.adhanOverlay.show { display: flex; }

.adhanBox { text-align: center; padding: 4vh 6vw; }

.adhanKicker { font-size: 3.2vh; color: var(--muted); font-weight: 700; letter-spacing: .1em; }

.adhanPrayer {
  font-size: 16vh;
  font-weight: 900;
  line-height: 1.05;
  color: var(--accent);
  text-shadow: 0 0 6vh rgba(255, 199, 90, .3);
}

.adhanTime { font-size: 5vh; font-weight: 700; margin-top: .4vh; }

.eq { display: flex; gap: .8vw; justify-content: center; align-items: flex-end; height: 7vh; margin: 2.4vh 0; }
.eq i {
  width: 1.1vh;
  background: linear-gradient(180deg, #ffe1a0, var(--accent2));
  border-radius: 99px;
  animation: pulse 1.1s ease-in-out infinite;
}
.eq i:nth-child(1) { animation-delay: 0s; }
.eq i:nth-child(2) { animation-delay: .15s; }
.eq i:nth-child(3) { animation-delay: .3s; }
.eq i:nth-child(4) { animation-delay: .45s; }
.eq i:nth-child(5) { animation-delay: .6s; }
.eq i:nth-child(6) { animation-delay: .75s; }
.eq i:nth-child(7) { animation-delay: .9s; }

@keyframes pulse {
  0%, 100% { height: 1.6vh; opacity: .6; }
  50% { height: 6.4vh; opacity: 1; }
}

.adhanMsg { font-size: 3.6vh; font-weight: 700; color: #d8e8f5; margin-bottom: 3vh; }

/* ---------- settings panel ---------- */
.panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 16, .82);
  backdrop-filter: blur(6px);
}

.panel.show { display: flex; }

.panelInner {
  width: min(1180px, 92vw);
  max-height: 92vh;
  overflow: auto;
  background: linear-gradient(170deg, #11263a, #0a1724);
  border: 1px solid rgba(255, 199, 90, .3);
  border-radius: 2vh;
  padding: 3vh 3vw;
  box-shadow: 0 3vh 8vh rgba(0, 0, 0, .6);
}

.panelInner h2 { font-size: 4.2vh; font-weight: 900; margin-bottom: 2.4vh; }

.panelGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2vh 2vw;
}

.field { display: flex; flex-direction: column; gap: .8vh; }
.field > span { font-size: 2.4vh; color: var(--muted); font-weight: 700; }

.field select, .field input[type="text"] {
  font-family: inherit;
  font-size: 2.8vh;
  font-weight: 700;
  color: var(--ink);
  background: #0a1a29;
  border: 1px solid var(--line);
  border-radius: 1.2vh;
  padding: 1.2vh 1vw;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1vw;
  font-size: 2.7vh;
  font-weight: 700;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 1.2vh;
  padding: 1.2vh 1.4vw;
  cursor: pointer;
}

.toggle input { width: 3.4vh; height: 3.4vh; accent-color: var(--accent); cursor: pointer; }

.panelActions { display: flex; gap: 1vw; margin-top: 2.6vh; flex-wrap: wrap; }

.btn {
  font-family: inherit;
  font-size: 2.7vh;
  font-weight: 800;
  padding: 1.3vh 2.2vw;
  border-radius: 1.2vh;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  cursor: pointer;
}

.btn:hover { background: rgba(255, 255, 255, .16); }

.btn.primary {
  background: linear-gradient(90deg, #ffd37a, var(--accent));
  color: #08131f;
  border-color: transparent;
  margin-inline-start: auto;
}

.panelNote { margin-top: 1.6vh; font-size: 2vh; color: var(--muted); line-height: 1.6; }

.hidden { display: none !important; }

/* small screens / phones: keep it usable */
@media (max-width: 900px), (max-height: 500px) {
  .main { grid-template-columns: 1fr; }
  .times { grid-template-rows: repeat(6, minmax(7vh, auto)); }
  .countdown { font-size: 9vh; }
  .nextName { font-size: 7vh; }
  .panelGrid { grid-template-columns: 1fr; }
  .footer { display: none; }
}
