/* ===========================================================
   TV Digital Masjid — tema hijau tua & emas, gaya ornamen masjid
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --bg-deep:      #06231a;
  --bg-panel:     #0b3a29;
  --bg-panel-2:   #0f4a34;
  --gold:         #d8b25c;
  --gold-bright:  #f0d488;
  --cream:        #f4ecd8;
  --line:         rgba(216, 178, 92, 0.35);
  --shadow:       rgba(0, 0, 0, 0.45);
  --radius-lg:    22px;
  --radius-md:    14px;
  --font-display: 'Amiri', serif;
  --font-body:    'Poppins', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  font-family: var(--font-body);
  color: var(--cream);
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(216,178,92,0.08), transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(216,178,92,0.07), transparent 45%),
    linear-gradient(160deg, #04140f 0%, #06231a 45%, #082e21 100%);
}

.tv-frame {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 1.6vw, 30px);
  gap: clamp(10px, 1.4vh, 20px);
  position: relative;
}

/* subtle geometric border frame, echoing the arabesque corners in the brief */
.tv-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line);
  border-radius: 28px;
  pointer-events: none;
}

/* ---------- HEADER ---------- */
.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(10px,1.2vh,18px) clamp(16px,2vw,32px);
  background: linear-gradient(135deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px var(--shadow);
}

.brand { display: flex; align-items: center; gap: 18px; }

.brand-icon {
  width: clamp(42px, 4.2vw, 64px);
  height: clamp(42px, 4.2vw, 64px);
  flex-shrink: 0;
}
.mosque-icon path, .mosque-icon circle, .mosque-icon rect { fill: var(--gold); }

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: clamp(22px, 2.6vw, 40px);
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.brand-text .tagline {
  margin: 2px 0 0;
  font-size: clamp(11px, 0.95vw, 16px);
  color: var(--cream);
  opacity: 0.8;
}

.date-block {
  display: flex;
  gap: clamp(14px, 2vw, 34px);
  text-align: right;
}
.date-item { display: flex; flex-direction: column; gap: 2px; }
.date-label {
  font-size: clamp(10px, 0.7vw, 12px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  opacity: 0.85;
}
.date-value {
  font-size: clamp(13px, 1.15vw, 19px);
  font-weight: 600;
  color: var(--cream);
}

/* ---------- MAIN GRID ---------- */
.tv-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 26%) 1fr minmax(280px, 27%);
  gap: clamp(10px, 1.4vw, 20px);
  min-height: 0;
}

/* ---------- CLOCK PANEL ---------- */
.clock-panel {
  background: linear-gradient(160deg, var(--bg-panel), #072a1e);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2vh, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vh, 20px);
  box-shadow: 0 10px 30px var(--shadow);
  text-align: center;
}

.panel-label {
  font-size: clamp(11px, 0.85vw, 14px);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  opacity: 0.9;
}
.panel-label.small { font-size: clamp(9px, 0.65vw, 11px); }

.digital-clock {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 72px);
  color: var(--cream);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.next-prayer {
  width: 100%;
  background: rgba(216, 178, 92, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(12px, 1.6vh, 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.next-prayer-name {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 30px);
  color: var(--gold-bright);
  font-weight: 700;
}
.countdown {
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

/* ---------- PRAYER GRID ---------- */
.prayer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr;
  gap: clamp(8px, 1vw, 16px);
  grid-column: 2 / 3;
}
@media (max-width: 900px) {
  .prayer-grid { grid-template-columns: repeat(5, 1fr); }
}

.tv-main { grid-template-rows: 1fr; }

.prayer-card {
  background: linear-gradient(160deg, var(--bg-panel), #072a1e);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(10px, 1.4vh, 20px) clamp(8px, 1vw, 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vh, 12px);
  box-shadow: 0 8px 24px var(--shadow);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.prayer-card.active {
  background: linear-gradient(160deg, #2f5f30, #1c4426);
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--gold) inset, 0 10px 28px rgba(0,0,0,0.5);
}

.prayer-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prayer-name {
  font-size: clamp(13px, 1.05vw, 19px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--gold-bright);
}

.prayer-icon {
  width: clamp(16px, 1.3vw, 22px);
  height: clamp(16px, 1.3vw, 22px);
  display: inline-block;
  background: var(--gold);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.icon-sunrise, .icon-sunset { -webkit-mask-image: radial-gradient(circle, black 55%, transparent 56%); mask-image: radial-gradient(circle, black 55%, transparent 56%); border-radius: 50%; }
.icon-sun { -webkit-mask-image: radial-gradient(circle, black 60%, transparent 61%); mask-image: radial-gradient(circle, black 60%, transparent 61%); border-radius: 50%; }
.icon-sun-half { border-radius: 50%; }
.icon-moon { border-radius: 50% 50% 50% 0; }

.prayer-time {
  font-size: clamp(24px, 2.4vw, 40px);
  font-weight: 800;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.prayer-azan {
  font-size: clamp(10px, 0.8vw, 13px);
  color: var(--gold);
  opacity: 0.85;
  letter-spacing: 1px;
}

/* ---------- SIDE PANEL ---------- */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 18px);
  min-height: 0;
}

.info-box {
  background: linear-gradient(160deg, var(--bg-panel), #072a1e);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 1.6vh, 20px);
  box-shadow: 0 8px 24px var(--shadow);
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.info-box h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.3vw, 21px);
  color: var(--gold-bright);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.jumat-date {
  font-size: clamp(12px, 0.95vw, 15px);
  color: var(--cream);
  opacity: 0.85;
  margin-bottom: 8px;
}

.petugas-list, .kajian-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.petugas-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.petugas-list li span {
  font-size: clamp(10px, 0.8vw, 13px);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.petugas-list li strong {
  font-size: clamp(13px, 1vw, 16px);
  color: var(--cream);
  text-align: right;
}

.tema-khutbah {
  margin-top: 10px;
  font-size: clamp(11px, 0.85vw, 14px);
  color: var(--cream);
  opacity: 0.8;
  font-style: italic;
}

.kajian-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.kajian-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.kajian-top strong {
  font-size: clamp(12px, 0.95vw, 15px);
  color: var(--cream);
}
.kajian-jam {
  font-size: clamp(12px, 0.95vw, 15px);
  color: var(--gold-bright);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kajian-sub {
  margin-top: 3px;
  font-size: clamp(10px, 0.8vw, 12px);
  color: var(--cream);
  opacity: 0.75;
}

.empty-note {
  font-size: clamp(11px, 0.85vw, 14px);
  opacity: 0.6;
  font-style: italic;
}

/* ---------- MARQUEE ---------- */
.marquee-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright), var(--gold));
  border-radius: var(--radius-md);
  padding: clamp(8px, 1vh, 14px) clamp(14px, 1.6vw, 26px);
  box-shadow: 0 8px 24px var(--shadow);
}

.marquee-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--bg-deep);
  font-size: clamp(12px, 1vw, 16px);
  padding-right: 16px;
  border-right: 2px solid rgba(6,35,26,0.35);
}

.icon-speaker {
  width: 18px; height: 18px;
  display: inline-block;
  background: var(--bg-deep);
  clip-path: polygon(0% 35%, 30% 35%, 55% 15%, 55% 85%, 30% 65%, 0% 65%);
}

.marquee-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  font-size: clamp(13px, 1.05vw, 18px);
  font-weight: 600;
  color: var(--bg-deep);
  animation: scroll-left 30s linear infinite;
}

.marquee-item { margin-right: 14px; }
.marquee-sep { margin-right: 14px; opacity: 0.6; font-size: 10px; vertical-align: middle; }

@keyframes scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Respect reduced motion for accessibility, still show text (just static) */
@media (prefers-reduced-motion: reduce) {
  .marquee-content { animation: none; padding-left: 0; }
}

/* ---------- RESPONSIVE FALLBACK (smaller / portrait TVs) ---------- */
@media (max-aspect-ratio: 4/3) {
  .tv-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    overflow-y: auto;
  }
  .prayer-grid { grid-column: 1 / 2; grid-template-columns: repeat(5, 1fr); }
  html, body { overflow: auto; }
}
