@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700;900&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --teal:   #009688;
  --green:  #084c2e;   /* forest green for masjid detail */
  --green2: #84D02C;   /* accent green */
  --gold:   #C9A84C;
  --dark:   #333333;
  --white:  #FFFFFF;
  --dim:    rgba(255,255,255,0.6);
  --border: rgba(255,255,255,0.2);
  --radius: 16px;
  --font:   'Titillium Web', sans-serif;
}
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: #fff;
  color: #222;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
.ibtn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background .2s;
  flex-shrink: 0;
  text-decoration: none;
}
.ibtn:hover { background: rgba(255,255,255,.15); }
.ibtn.gold { color: var(--gold); }
.ibtn svg { width: 22px; height: 22px; fill: currentColor; }

/* ── PROGRESS BAR ── */
#prog {
  height: 3px;
  background: var(--teal);
  width: 0%;
  transition: width linear;
}

/* ── NOTICE TICKER ── */
#notice-ticker {
  display: none;
  background: var(--teal);
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.2);
  overflow: hidden;
  white-space: nowrap;
}
#notice-ticker.visible { display: block; }
.ticker-inner {
  display: inline-block;
  animation: ticker 18s linear infinite;
}
@keyframes ticker {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ── ARCH CARD ── */
.arch-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
}
.arch-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}
.arch-bg.dark   { background-color: var(--dark); }
.arch-bg.green  { background-color: var(--green); }
.arch-bg.fajr   { background-image: url('bg_fajr.jpg'); }
.arch-bg.zohar  { background-image: url('bg_zohar.png'); }
.arch-bg.asr    { background-image: url('bg_asr.png'); }
.arch-bg.maghrib{ background-image: url('bg_maghrib.png'); }
.arch-bg.esha   { background-image: url('bg_esha.png'); }
.arch-bg.tomorrow { background-image: url('bg_fajr.jpg'); filter: grayscale(60%) brightness(.6); }

.arch-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.08);  /* very subtle — just enough for text readability */
}
/* SVG arch mask — white shape sits on top, masking the corners */
.arch-svg {
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%;
  display: block;
  pointer-events: none;
  z-index: 3;
}
.arch-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 20px;
}

/* ── BISMILLAH ── */
.bismillah {
  width: 27%;
  max-width: 105px;
  display: block;
  margin: 6px auto 8px;   /* 6px top padding */
  filter: brightness(10);
  opacity: .9;
}

/* ── SLIDE HEADER TEXT ── */
.slide-date {
  font-size: 22px;
  font-weight: 400;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}
.hdivider {
  width: 70%;
  height: 1px;
  background: rgba(255,255,255,.4);
  margin: 5px auto;
}
.hdivider.full { width: 100%; }
.hdivider.w85  { width: 85%; }
.slide-hijri {
  font-size: 22px;
  font-weight: 400;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}
.slide-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 4px 0;
}
.slide-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.masjid-name-gold {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
  margin: 3px 0;
}

/* ── ARCH MASJID LIST ROWS ── */
.arch-list { width: 100%; }
.arch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;          /* reduced padding */
  border-bottom: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: background .15s;
  border-radius: 4px;
}
.arch-row:hover  { background: rgba(255,255,255,.07); }
.arch-row:last-child { border-bottom: none; }
.arch-info { flex: 1; min-width: 0; }
.arch-name {
  font-size: 25px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
.arch-loc {
  font-size: 15px;         /* 10px × 1.5 */
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1.1;
}
.arch-time {
  font-size: 25px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 68px;
  text-align: right;
  line-height: 1.1;
  align-self: flex-start;  /* aligns with first line (name), not center */
  padding-top: 2px;
}
.arch-time.red   { color: #E53935; }
.dot8 {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 6px;
}

/* ── JAMAAT TIME ROWS (masjid detail) ── */
.time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.15);
  width: 100%;
}
.time-row:last-child { border-bottom: none; }
.time-label {
  font-size: 31px;       /* 22 × 1.4 */
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}
.time-val {
  font-size: 31px;       /* 22 × 1.4 */
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.time-val.red { color: #E53935; }
.time-val.grn { color: var(--green2); }

/* ── BUTTONS ── */
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 10px;
  background: #fff;
}
.abtn {
  flex: 1;
  min-width: 70px;
  padding: 12px 8px;
  border: none;
  border-radius: 30px;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity .2s;
  text-decoration: none;
}
.abtn:hover { opacity: .85; }
.abtn.wa     { background: #25D366; }
.abtn.red    { background: #E53935; width: 48px; min-width: 48px; flex: 0; border-radius: 50%; height: 48px; padding: 0; }
.abtn.blue   { background: #1565C0; width: 48px; min-width: 48px; flex: 0; border-radius: 50%; height: 48px; padding: 0; }
.abtn.purple { background: #6A1B9A; }
.wa-big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 80%;
  max-width: 320px;
  margin: 12px auto;
  padding: 13px 20px;
  background: #25D366;
  border: none;
  border-radius: 30px;
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(37,211,102,.3);
}

/* ── MODALS ── */
.ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 300;
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ov.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 22px;
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  animation: mi .22s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
@keyframes mi { from { transform: scale(.93); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mhdr {
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
}
.mtitle { font-size: 18px; font-weight: 700; color: #222; }
.mclose {
  background: none;
  border: none;
  color: #999;
  font-size: 22px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.mbody { padding: 16px 18px; }

/* Glass menu modal */
.glass-menu .modal {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(20px);
  max-width: 300px;
}
.menu-item {
  padding: 16px 22px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,.08);
  cursor: pointer;
  color: #222;
  transition: background .15s;
}
.menu-item:hover { background: rgba(0,0,0,.04); }
.menu-item:last-child { border-bottom: none; }

/* Town picker */
.town-item {
  padding: 12px 4px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #222;
  transition: background .15s;
  border-radius: 6px;
}
.town-item:hover { background: #f5f5f5; }

/* ── LOADING ── */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 14px;
}
.spin {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: sp .8s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }
#loading p { color: #888; font-size: 13px; }

/* ── DESKTOP MAX WIDTH 30% ── */
@media (min-width: 700px) {
  body { background: #d0d0d0; }
  .topbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 30vw;
    min-width: 340px;
    max-width: 500px;
  }
  #prog, #notice-ticker {
    width: 30vw;
    min-width: 340px;
    max-width: 500px;
    margin: 0 auto;
    display: block;
  }
  #app, #loading, .page-content,
  .jumuah-screen, .settings-page,
  #taq-year-wrap {
    width: 30vw;
    min-width: 340px;
    max-width: 500px;
    margin: 0 auto;
  }
  body { padding-top: 54px; }
}

/* ── SWIPE HINT ── */
.swipe-hint {
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 6px 0 2px;
}

/* ── INPUT / SELECT ── */
.sel {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  padding: 8px 10px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  width: 100%;
}
.form-row {
  margin-bottom: 16px;
}
.form-label {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: block;
}
