/* ==========================================================================
   iMasjid - Tampilan baru (3D) + Popup Hari Besar Islam
   Dimuat SETELAH style.css, jadi cukup hapus 1 baris <link> di header.php
   untuk kembali ke tampilan lama.
   ========================================================================== */

:root {
  --hb-row: 46px;   /* tinggi baris bawah: kotak jam, hitung mundur, teks berjalan */
  --hb-bar: 58px;   /* tinggi bar jadwal sholat */
}

/* --------------------------------------------------------------------------
   1) BAR JADWAL SHOLAT - gradasi 3D
   -------------------------------------------------------------------------- */
#prayer {
  bottom: calc(var(--hb-row) + var(--hb-bar));   /* bar berhenti tepat di atas baris jam */
  z-index: 3;
}

#prayer .bg1 {
  height: var(--hb-bar);
  align-items: center;
  padding: 0 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 46%),
    linear-gradient(180deg, #6f52ff 0%, #4b22ea 40%, #3512c6 74%, #240a92 100%);
  border-top: 1px solid rgba(255,255,255,.65);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -4px 8px rgba(8,0,70,.55),
    0 -8px 22px rgba(25,0,120,.5);
}

#prayer .bg1 > .p-2 {
  position: relative;
  padding: 0 .5rem !important;      /* bootstrap .p-2 memakai !important */
}

#prayer h2 {
  color: #e3e0ff;
  font-weight: 700;
  font-size: 24px;                      /* cadangan untuk browser lama */
  font-size: clamp(17px, 1.34vw, 28px);
  line-height: 1.2;
  letter-spacing: .3px;
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(10,0,80,.55), 0 4px 8px rgba(0,0,0,.35);
}

/* waktu sholat yang sedang aktif / berikutnya: tombol timbul */
#prayer .selected {
  color: #2a0aa8;
  padding: 4px 24px;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f2ff 42%, #cfd6ff 100%);
  box-shadow:
    0 4px 0 #7683e2,
    0 9px 16px rgba(0,0,0,.45),
    0 0 20px rgba(255,255,255,.35),
    inset 0 2px 0 #fff,
    inset 0 -3px 5px rgba(70,50,210,.28);
  text-shadow: 0 1px 0 #fff;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   2) BARIS BAWAH: kotak jam & hitung mundur (emas 3D) + teks berjalan
   -------------------------------------------------------------------------- */
#clock {
  height: var(--hb-row);
}

#clock .left,
#clock .right {
  top: auto;
  bottom: 0;
  height: var(--hb-row);
  padding: 0 14px;
  white-space: nowrap;
  color: #241700;
  background:
    linear-gradient(180deg, rgba(255,255,255,.65) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(180deg, #fff3a0 0%, #ffe03a 32%, #ffc400 68%, #e69a00 100%);
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.95),
    inset 0 -5px 0 #c58400,
    inset 0 -6px 6px rgba(120,60,0,.3),
    0 -4px 14px rgba(0,0,0,.4);
}

#clock .left  { width: 300px; border-radius: 0 16px 0 0; }
#clock .right { width: 380px; border-radius: 16px 0 0 0; }

#clock h2, #clock h3 {
  margin: 0;
  padding-bottom: 5px;                 /* ruang untuk tepi bawah 3D */
  font-size: 21px;
  font-size: clamp(17px, 1.2vw, 24px);
  font-weight: 800;
  line-height: 1;
  color: #241700;
  text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 2px 2px rgba(120,70,0,.25);
  font-variant-numeric: tabular-nums;
}
#clock small {
  font-size: .72em;
  font-weight: 700;
  color: #5b3a00;
}

#text .running-text {
  height: var(--hb-row);
  left: 300px;                         /* mulai tepat di sisi kotak jam */
  right: 380px;                        /* berhenti tepat di sisi hitung mundur */
  width: auto;
  background: linear-gradient(180deg, #e4e6fb 0%, #ffffff 40%, #f1f2ff 100%);
  box-shadow: inset 0 4px 8px rgba(40,20,140,.28), inset 0 -2px 0 rgba(40,20,140,.12);
  border-top: 1px solid rgba(60,40,180,.25);
  display: flex;
  align-items: center;
}
#text .running-text h2 {
  margin: 0;
  width: 100%;
  font-size: 22px;
  font-size: clamp(18px, 1.3vw, 26px);
  line-height: 1.2;
  color: #1a1450;
  text-shadow: 0 1px 0 rgba(255,255,255,.9);
}

/* --------------------------------------------------------------------------
   3) POPUP HARI BESAR ISLAM
   -------------------------------------------------------------------------- */
.hb-popup {
  position: fixed;
  left: 24px;
  bottom: calc(var(--hb-row) + var(--hb-bar) + 22px);
  z-index: 900;
  width: 36em;
  width: min(36em, 38vw);
  min-width: 340px;
  font-size: 15px;
  font-size: clamp(11px, .84vw, 16px);    /* seluruh kartu skala mengikuti lebar layar */
  font-family: "Montserrat", "Open Sans", sans-serif;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-46px) scale(.97);
  transition: opacity .6s ease, transform .7s cubic-bezier(.2,.85,.25,1), visibility 0s linear .7s;
  will-change: transform, opacity;
}
.hb-popup.hb-show {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.hb-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.35em;
  align-items: center;
  padding: 1.35em 1.6em 2.3em 1.35em;
  color: #fff;
  border-radius: 1.5em;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(135deg, #1a0f66 0%, #3a1bb8 52%, #23097f 100%);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow:
    0 1.4em 3em rgba(6,0,60,.6),
    0 .3em 0 rgba(10,0,70,.8),
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -3px 0 rgba(0,0,0,.28);
}

/* hiasan bulan sabit samar di pojok kanan atas */
.hb-card::after {
  content: '';
  position: absolute;
  right: -1.2em; top: -1.4em;
  width: 9em; height: 9em;
  opacity: .13;
  pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='white' d='M21 14.5A9 9 0 0 1 9.5 3a9 9 0 1 0 11.5 11.5z'/></svg>");
}

/* lencana hitung mundur: koin emas 3D */
.hb-badge {
  position: relative;
  z-index: 1;
  width: 7.5em; height: 7.5em;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 50%;
  color: #2b1a00;
  background: radial-gradient(circle at 30% 24%, #fffbc2 0%, #ffd93f 36%, #f4a900 76%, #c98100 100%);
  border: .22em solid #fff1a6;
  box-shadow:
    0 .4em 0 #9a6200,
    0 .9em 1.5em rgba(0,0,0,.5),
    inset 0 .2em .3em rgba(255,255,255,.9),
    inset 0 -.5em .8em rgba(150,90,0,.5);
}
.hb-num {
  font-size: 2.9em; font-weight: 800; line-height: 1;
  text-shadow: 0 .06em 0 rgba(255,255,255,.7), 0 .12em .12em rgba(120,70,0,.3);
  font-variant-numeric: tabular-nums;
}
.hb-num.hb-word { font-size: 1.7em; letter-spacing: .02em; }
.hb-unit {
  margin-top: .3em;
  font-size: .8em; font-weight: 800; letter-spacing: .14em;
}
.hb-unit:empty { display: none; }

.hb-today .hb-badge {
  color: #fff;
  background: radial-gradient(circle at 30% 24%, #b9ffd9 0%, #2fe08b 36%, #0aa65a 76%, #067a41 100%);
  border-color: #c9ffe3;
  box-shadow: 0 .4em 0 #04552d, 0 .9em 1.5em rgba(0,0,0,.5),
              inset 0 .2em .3em rgba(255,255,255,.8), inset 0 -.5em .8em rgba(0,70,30,.5);
  animation: hb-pulse 1.6s ease-in-out infinite;
}
.hb-today .hb-num, .hb-today .hb-unit { text-shadow: 0 .08em .12em rgba(0,60,25,.6); }
.hb-soon .hb-badge {
  background: radial-gradient(circle at 30% 24%, #ffe9c2 0%, #ffb347 36%, #f07a00 76%, #b44f00 100%);
  border-color: #ffe0b0;
  box-shadow: 0 .4em 0 #7a3500, 0 .9em 1.5em rgba(0,0,0,.5),
              inset 0 .2em .3em rgba(255,255,255,.85), inset 0 -.5em .8em rgba(120,40,0,.5);
}

.hb-body { position: relative; z-index: 1; min-width: 0; }

.hb-kicker {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .28em .85em;
  font-size: .78em; font-weight: 700; letter-spacing: .18em;
  color: #ffe36a;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,227,106,.35);
  border-radius: 2em;
}
.hb-ico { display: inline-flex; font-size: 1.05em; line-height: 1; }

.hb-title {
  margin: .5em 0 .45em;
  font-size: 1.85em; font-weight: 800; line-height: 1.12;
  text-shadow: 0 .08em 0 rgba(0,0,0,.35), 0 .15em .3em rgba(0,0,0,.35);
  text-wrap: balance;
}

.hb-row {
  display: flex; align-items: center; gap: .6em;
  font-size: 1.08em; font-weight: 600; line-height: 1.35;
}
.hb-hijri  { color: #ffe36a; }
.hb-masehi { color: rgba(255,255,255,.92); margin-top: .12em; }
.hb-row .hb-ico { opacity: .9; }

.hb-foot {
  position: absolute; z-index: 1;
  left: 1.6em; right: 1.6em; bottom: .75em;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .68em; letter-spacing: .03em;
  color: rgba(255,255,255,.7);
}
.hb-dots { display: inline-flex; gap: .45em; }
.hb-dots b {
  display: block; width: .65em; height: .65em; border-radius: .4em;
  background: rgba(255,255,255,.35);
  transition: width .3s ease, background .3s ease;
}
.hb-dots b.on { width: 1.9em; background: #ffd63a; }

.hb-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: .32em;
  background: rgba(0,0,0,.3);
}
.hb-progress i {
  display: block; height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #ffe36a, #ffb300);
}

.hb-card.hb-swap .hb-badge,
.hb-card.hb-swap .hb-body { animation: hb-swap .6s cubic-bezier(.2,.8,.2,1) both; }

@keyframes hb-swap     { from { opacity: 0; transform: translateY(.7em); } to { opacity: 1; transform: none; } }
@keyframes hb-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes hb-pulse    { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
