/* ============================================================
   Gaya Tampilan TV Display Antrian PTSP Kemenag DIY
   Format: Layar Lebar 16:9 / Full HD / 4K
   ============================================================ */

:root {
  --tv-bg-dark: #042414;
  --tv-bg-mid: #0a4628;
  --tv-panel: rgba(7, 43, 25, 0.85);
  --tv-panel-solid: #09371f;
  --tv-green: #0ea659;
  --tv-gold: #f5c016;
  --tv-gold-light: #ffea85;
  --tv-text: #ffffff;
  --tv-text-muted: #b9d8c7;
  --tv-border: rgba(255, 255, 255, 0.12);
  --tv-radius: 16px;
  --tv-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--tv-bg-dark);
  font-family: "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tv-text);
  line-height: 1.3;
}

.tv-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 10%, #0d5833 0%, var(--tv-bg-dark) 80%);
}

/* ============================================================
   1. HEADER TV
   ============================================================ */
.tv-header {
  height: 90px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-bottom: 2px solid rgba(245, 192, 22, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

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

.tv-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tv-logo-fallback {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--tv-gold), #b38500);
  color: #042414;
  font-weight: 900;
  font-size: 18px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tv-brand-text h1 {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.tv-brand-text p {
  font-size: 14px;
  color: var(--tv-gold);
  font-weight: 600;
  letter-spacing: 1px;
}

.tv-time-box {
  display: flex;
  align-items: center;
  gap: 22px;
}

.tv-date {
  text-align: right;
  font-size: 15px;
  color: var(--tv-text-muted);
  font-weight: 600;
}

.tv-clock {
  font-size: 38px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 18px;
  border-radius: 12px;
  border: 1px solid var(--tv-border);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

/* ============================================================
   2. BODY UTAMA (VIDEO DI TENGAH, INFO DI SAMPING)
   ============================================================ */
.tv-main {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr 340px;
  gap: 20px;
  padding: 18px 24px 14px;
  min-height: 0;
}

.tv-card {
  background: var(--tv-panel);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius);
  box-shadow: var(--tv-shadow);
  backdrop-filter: blur(8px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Kolom Kiri: Panggilan Utama Terkini */
.tv-callout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 24px 20px;
  background: linear-gradient(160deg, rgba(14, 166, 89, 0.25) 0%, rgba(4, 36, 20, 0.85) 100%);
  border: 2px solid rgba(245, 192, 22, 0.4);
}

.callout-header {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--tv-gold);
  text-transform: uppercase;
}

.callout-number-box {
  margin: auto 0;
  padding: 16px 0;
}

.callout-sub {
  font-size: 18px;
  font-weight: 600;
  color: var(--tv-text-muted);
  margin-bottom: 4px;
}

.callout-number {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  color: var(--tv-gold);
  text-shadow: 0 4px 15px rgba(245, 192, 22, 0.4);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.callout-number.pulse {
  animation: callPulse 1.2s infinite alternate;
}

@keyframes callPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.08); filter: brightness(1.3); }
}

.callout-target {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 10px;
}

.callout-service {
  font-size: 15px;
  color: var(--tv-text-muted);
  margin-top: 6px;
  line-height: 1.3;
}

/* Kolom Tengah: Video Player Playlist */
.tv-video-container {
  position: relative;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tv-radius);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.tv-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000000;
}

.tv-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--tv-text-muted);
  text-align: center;
  padding: 30px;
}

.tv-video-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.5;
}

.tv-video-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-video-badge .dot {
  width: 8px;
  height: 8px;
  background: #ff3333;
  border-radius: 50%;
  animation: blinkDot 1s infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Kolom Kanan: Ringkasan Sisa & Info */
.tv-summary-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  padding: 20px;
}

.summary-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--tv-border);
}

.summary-card.highlight {
  background: linear-gradient(135deg, rgba(245, 192, 22, 0.25) 0%, rgba(0, 0, 0, 0.35) 100%);
  border-color: rgba(245, 192, 22, 0.5);
}

.summary-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--tv-text-muted);
  text-transform: uppercase;
}

.summary-card.highlight .summary-title {
  color: var(--tv-gold);
}

.summary-num {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.summary-card.highlight .summary-num {
  color: var(--tv-gold);
}

.summary-foot {
  font-size: 13px;
  color: var(--tv-text-muted);
}

/* ============================================================
   3. GRID SEMUA LOKET (BARIS BAWAH)
   ============================================================ */
.tv-bottom {
  padding: 0 24px 14px;
  flex-shrink: 0;
}

.tv-loket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.tv-loket-card {
  background: var(--tv-panel-solid);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--tv-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-left: 6px solid var(--loket-color, var(--tv-green));
  transition: transform 0.2s, box-shadow 0.2s;
}

.tv-loket-card.calling {
  animation: cardCalling 0.8s ease-in-out infinite alternate;
  border-color: var(--tv-gold);
}

@keyframes cardCalling {
  0% { transform: translateY(0); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
  100% { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(245, 192, 22, 0.45); }
}

.tl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tl-name {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.tl-badge-sisa {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--tv-gold);
}

.tl-number {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--tv-gold);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 4px;
}

.tl-service {
  font-size: 12px;
  color: var(--tv-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   4. RUNNING TEXT FOOTER
   ============================================================ */
.tv-footer {
  height: 54px;
  background: #000000;
  border-top: 2px solid var(--tv-gold);
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.tv-ticker-tag {
  background: var(--tv-gold);
  color: #042414;
  font-weight: 900;
  font-size: 14px;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
  flex-shrink: 0;
  z-index: 5;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
}

.tv-marquee {
  white-space: nowrap;
  display: inline-block;
  padding-left: 100%;
  animation: marqueeMove 35s linear infinite;
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.5px;
}

@keyframes marqueeMove {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* ============================================================
   5. OVERLAY PANGGILAN ANIMASI (FULL SCREEN BANNER POPUP)
   ============================================================ */
.tv-call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 25, 14, 0.92);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.tv-call-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.call-popup-card {
  width: min(850px, 90vw);
  background: linear-gradient(135deg, #094022 0%, #031b0e 100%);
  border: 4px solid var(--tv-gold);
  border-radius: 28px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(245, 192, 22, 0.3);
  padding: 40px;
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tv-call-overlay.active .call-popup-card {
  transform: scale(1);
}

.popup-tag {
  display: inline-block;
  background: var(--tv-gold);
  color: #042414;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 6px 24px;
  border-radius: 999px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.popup-number {
  font-size: 140px;
  font-weight: 900;
  line-height: 1;
  color: var(--tv-gold);
  letter-spacing: 4px;
  text-shadow: 0 8px 30px rgba(245, 192, 22, 0.5);
  font-variant-numeric: tabular-nums;
  margin: 10px 0 20px;
}

.popup-arrow {
  font-size: 32px;
  color: #ffffff;
  margin-bottom: 10px;
}

.popup-loket {
  font-size: 48px;
  font-weight: 900;
  color: #ffffff;
}

/* ============================================================
   6. MODAL INTERAKSI AWAL AUDIO / FULLSCREEN
   ============================================================ */
.tv-audio-prompt {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.audio-prompt-card {
  background: #0b4527;
  border: 2px solid var(--tv-gold);
  border-radius: 20px;
  padding: 36px 40px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.audio-prompt-card h2 {
  font-size: 26px;
  color: var(--tv-gold);
  margin-bottom: 12px;
}

.audio-prompt-card p {
  font-size: 15px;
  color: var(--tv-text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.btn-tv-start {
  background: linear-gradient(135deg, var(--tv-gold), #cca00a);
  color: #042414;
  font-size: 20px;
  font-weight: 800;
  padding: 14px 36px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 192, 22, 0.4);
  transition: transform 0.15s;
}

.btn-tv-start:hover {
  transform: scale(1.05);
}

/* Tombol Kontrol Kecil di Pojok Kanan Atas TV */
.tv-quick-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-ctrl-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--tv-border);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tv-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
