/* ===== MASJID DIGITAL CLOCK - DISPLAY CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Poppins:wght@300;400;500;600;700;800;900&family=Cinzel:wght@400;600;700&display=swap');

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

:root {
  --gold: #D4AF37;
  --gold-light: #F5E17A;
  --gold-dark: #A0810A;
  --green-dark: #0A3D1F;
  --green-mid: #1A6B3A;
  --green-light: #2EAD5C;
  --blue-dark: #0A1F3D;
  --blue-mid: #1A3D6B;
  --blue-light: #2E6BAD;
  --white: #FFFFFF;
  --cream: #FFF8E7;
  --shadow: rgba(0,0,0,0.5);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  background: #000;
}

/* ========== TEMPLATES ========== */

/* TEMPLATE 1: Hijau Emas Elegan */
.template-1 {
  width: 100vw; height: 100vh;
  background: linear-gradient(135deg, #0A2E0A 0%, #1A5C1A 30%, #0D3D20 60%, #0A2E0A 100%);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  overflow: hidden;
}

.template-1::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('../images/islamic-pattern.jpg');
  background-size: 400px;
  opacity: 0.04;
  z-index: 0;
}

/* TEMPLATE 2: Biru Langit Malam */
.template-2 {
  width: 100vw; height: 100vh;
  background: linear-gradient(180deg, #020B18 0%, #051A35 30%, #071F40 60%, #020B18 100%);
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

/* TEMPLATE 3: Full Screen Media */
.template-3 {
  width: 100vw; height: 100vh;
  position: relative;
  overflow: hidden;
}

.template-3 .bg-media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

.template-3 .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
}

/* TEMPLATE 4: Minimal Modern */
.template-4 {
  width: 100vw; height: 100vh;
  background: #0D0D0D;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 80px 1fr 120px;
  overflow: hidden;
}

/* ========== COMPONENTS ========== */

/* --- TOP HEADER --- */
.header-bar {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05), rgba(212,175,55,0.15));
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 80px;
  position: relative;
  z-index: 10;
}

.header-masjid-name {
  font-family: 'Amiri', serif;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
  letter-spacing: 1px;
}

.header-hijri {
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  color: var(--gold);
  text-align: center;
  font-family: 'Amiri', serif;
}

.header-gregorian {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  color: rgba(255,255,255,0.7);
  text-align: right;
}

/* --- DIGITAL CLOCK --- */
.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  padding: 20px;
}

.clock-digital {
  font-family: 'Courier New', 'Cinzel', monospace;
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 900;
  color: var(--white);
  text-shadow:
    0 0 30px rgba(212,175,55,0.8),
    0 0 60px rgba(212,175,55,0.4),
    0 0 100px rgba(212,175,55,0.2);
  letter-spacing: 4px;
  line-height: 1;
  animation: clockPulse 1s ease-in-out infinite alternate;
}

@keyframes clockPulse {
  from { text-shadow: 0 0 20px rgba(212,175,55,0.6), 0 0 40px rgba(212,175,55,0.3); }
  to { text-shadow: 0 0 40px rgba(212,175,55,1), 0 0 80px rgba(212,175,55,0.6), 0 0 120px rgba(212,175,55,0.3); }
}

.clock-colon {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--gold);
}

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

.clock-seconds {
  font-size: clamp(1rem, 3vw, 2.5rem);
  color: var(--gold);
  margin-top: -10px;
  font-weight: 600;
}

.clock-period {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: rgba(255,255,255,0.7);
  letter-spacing: 6px;
  margin-top: 5px;
  font-weight: 300;
}

/* --- PRAYER TIMES --- */
.prayer-times-container {
  padding: 15px 25px;
  position: relative;
  z-index: 5;
}

.prayer-times-title {
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 600;
}

.prayer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.prayer-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 10px;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.prayer-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.3s;
}

.prayer-item.active {
  background: linear-gradient(90deg, rgba(212,175,55,0.25), rgba(212,175,55,0.1));
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212,175,55,0.3), inset 0 0 20px rgba(212,175,55,0.05);
  animation: activePrayer 2s ease-in-out infinite alternate;
}

.prayer-item.active::before { opacity: 1; }

@keyframes activePrayer {
  from { box-shadow: 0 0 10px rgba(212,175,55,0.2), inset 0 0 10px rgba(212,175,55,0.03); }
  to { box-shadow: 0 0 30px rgba(212,175,55,0.5), inset 0 0 20px rgba(212,175,55,0.1); }
}

.prayer-item.next {
  border-color: rgba(212,175,55,0.5);
  background: rgba(212,175,55,0.08);
}

.prayer-name-id {
  font-size: clamp(0.65rem, 1.2vw, 0.9rem);
  color: rgba(255,255,255,0.6);
  font-weight: 300;
}

.prayer-name-ar {
  font-family: 'Amiri', serif;
  font-size: clamp(0.9rem, 1.8vw, 1.3rem);
  color: var(--white);
  font-weight: 700;
}

.prayer-time {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--gold-light);
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.prayer-item.active .prayer-time {
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(212,175,55,0.8);
}

.next-prayer-info {
  text-align: center;
  padding: 8px;
  background: rgba(212,175,55,0.1);
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.3);
  margin-top: 10px;
}

.next-prayer-countdown {
  font-size: clamp(0.7rem, 1.5vw, 1.1rem);
  color: var(--gold);
  font-weight: 600;
}

/* --- CONTENT PANEL (Ayat, Doa, Pengumuman, Petugas) --- */
.content-panel {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
  overflow: hidden;
}

.slide-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.slide-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  color: #000;
  font-size: clamp(0.55rem, 1vw, 0.75rem);
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  width: fit-content;
}

.slide-title {
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.3;
}

.arabic-text {
  font-family: 'Amiri', serif;
  font-size: clamp(1.5rem, 3.5vw, 2.8rem);
  color: var(--white);
  text-align: right;
  line-height: 1.8;
  direction: rtl;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.latin-text {
  font-size: clamp(0.7rem, 1.3vw, 1rem);
  color: var(--gold);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
}

.translation-text {
  font-size: clamp(0.7rem, 1.3vw, 1rem);
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  margin-top: 5px;
}

.source-text {
  font-size: clamp(0.55rem, 1vw, 0.75rem);
  color: rgba(212,175,55,0.7);
  margin-top: 8px;
  font-style: italic;
}

/* Pengumuman */
.pengumuman-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.pengumuman-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-dark));
}

.pengumuman-judul {
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 5px;
  padding-left: 10px;
}

.pengumuman-isi {
  font-size: clamp(0.6rem, 1.1vw, 0.85rem);
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  padding-left: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pengumuman-meta {
  font-size: clamp(0.55rem, 1vw, 0.72rem);
  color: rgba(212,175,55,0.7);
  margin-top: 6px;
  padding-left: 10px;
  display: flex;
  gap: 12px;
}

/* Petugas */
.petugas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.petugas-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 12px;
  padding: 15px 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.petugas-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  margin: 0 auto 10px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold-dark), var(--green-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gold-light);
  overflow: hidden;
}

.petugas-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.petugas-nama {
  font-size: clamp(0.6rem, 1.1vw, 0.8rem);
  color: var(--white);
  font-weight: 600;
  margin-bottom: 3px;
  line-height: 1.3;
}

.petugas-jabatan {
  font-size: clamp(0.55rem, 0.9vw, 0.7rem);
  color: var(--gold);
  font-weight: 500;
}

.petugas-jadwal {
  font-size: clamp(0.5rem, 0.8vw, 0.65rem);
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
}

/* --- BOTTOM TICKER --- */
.ticker-bar {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
  height: 50px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.ticker-label {
  background: rgba(0,0,0,0.5);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-right: 2px solid rgba(0,0,0,0.3);
  text-transform: uppercase;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.ticker-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  color: #000;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 600;
  animation: tickerScroll 40s linear infinite;
}

@keyframes tickerScroll {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* --- DECORATIVE ELEMENTS --- */
.ornament-top, .ornament-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 30px;
  z-index: 1;
}

.ornament-top { top: 80px; }
.ornament-bottom { bottom: 50px; }

.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 15px 0;
}

.divider-ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1.2rem;
  margin: 10px 0;
  opacity: 0.7;
}

/* Stars animation */
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: starTwinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.5); }
}

/* --- SLIDE INDICATORS --- */
.slide-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.slide-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.slide-dot.active {
  background: var(--gold);
  width: 20px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(212,175,55,0.8);
}

/* --- IQAMAH COUNTDOWN --- */
.iqamah-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0A2E0A, #1A5C1A);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.iqamah-overlay.show { display: flex; }

.iqamah-title {
  font-family: 'Amiri', serif;
  font-size: clamp(2rem, 6vw, 5rem);
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(212,175,55,0.8);
  margin-bottom: 20px;
}

.iqamah-countdown {
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 900;
  color: var(--white);
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 50px rgba(212,175,55,1), 0 0 100px rgba(212,175,55,0.5);
  line-height: 1;
}

/* --- RESPONSIVE FOR TV --- */
@media (min-width: 1920px) {
  .clock-digital { font-size: 10rem; }
  .arabic-text { font-size: 3.5rem; }
  .prayer-time { font-size: 1.8rem; }
}

@media (max-width: 1366px) {
  .clock-digital { font-size: 6rem; }
  .prayer-grid { grid-template-columns: 1fr; }
}

/* Adzan notification */
@keyframes adzanFlash {
  0%, 100% { background: rgba(212,175,55,0.1); }
  50% { background: rgba(212,175,55,0.3); }
}

.adzan-time { animation: adzanFlash 1s ease-in-out infinite; }

/* Floating particles */
@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.5; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.particle {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  animation: float linear infinite;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: #0A2E0A;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 80px; height: 80px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Template 2 specific */
.t2-left {
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(212,175,55,0.15);
}

.t2-right {
  display: flex;
  flex-direction: column;
}

/* Grid vertical divider */
.vertical-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  margin: 20px 0;
  align-self: stretch;
}

/* Location info */
.location-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.6rem, 1.1vw, 0.82rem);
  color: rgba(255,255,255,0.6);
  margin-top: 8px;
}

.location-badge svg {
  width: 14px; height: 14px;
  fill: var(--gold);
}

/* Prayer method badge */
.method-badge {
  font-size: 0.65rem;
  color: rgba(212,175,55,0.7);
  text-align: center;
  margin-top: 5px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
}

.section-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(0.75rem, 1.4vw, 1rem);
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Gradient borders */
.gold-border-box {
  border: 1px solid transparent;
  background: linear-gradient(rgba(20,60,20,0.8), rgba(20,60,20,0.8)) padding-box,
              linear-gradient(135deg, var(--gold), transparent, var(--gold)) border-box;
  border-radius: 12px;
}

/* Temperature & weather widget */
.weather-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  color: var(--gold);
}

/* Mosque name Arabic */
.mosque-name-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  color: var(--gold);
  text-align: center;
  direction: rtl;
  margin-top: 5px;
}

/* Content fade in */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.6s ease forwards; }

/* Scrolling text for long content */
@keyframes scrollUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.scroll-content {
  animation: scrollUp 20s linear infinite;
}
