/* ═══════════════════════════════════════
   QIBLA
═══════════════════════════════════════ */
.qibla-wrap {
  text-align: center;
  padding: 10px 0 32px;
}
.qibla-title {
  font-size: 26px; font-weight: 800; margin-bottom: 6px;
}
.qibla-sub {
  font-size: 14px; color: var(--muted); margin-bottom: 32px;
}

/* Compass */
.compass-outer {
  position: relative;
  width: min(300px, 86vw);
  height: min(300px, 86vw);
  margin: 0 auto 28px;
}

.compass-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(212,169,74,0.25);
  background: rgba(15,30,56,0.8);
}

/* Cardinal letters */
.cardinal {
  position: absolute; font-size: 14px; font-weight: 800;
  font-family: var(--mono); color: var(--muted);
  transform: translate(-50%, -50%);
}
.cardinal.n { top: 8%;  left: 50%; color: var(--teal); }
.cardinal.e { top: 50%; left: 92%; }
.cardinal.s { top: 92%; left: 50%; }
.cardinal.w { top: 50%; left: 8%; }

/* Compass face (rotates with device heading) */
.compass-face {
  position: absolute; inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #1a3060, #0a1628);
  border: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease;
}

/* Qibla needle */
.qibla-needle {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  transform-origin: center bottom;
  /* rotated via JS */
}
.needle-tip { font-size: 22px; }
.needle-body {
  width: 3px; height: 60px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  border-radius: 2px;
}
.needle-tail {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); opacity: 0.4;
}

/* Center dot */
.compass-center {
  position: absolute;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212,169,74,0.6);
}

/* Tick marks */
.ticks { position: absolute; inset: 0; border-radius: 50%; }

/* Stats row */
.qibla-stats {
  display: flex; justify-content: center; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  max-width: 420px; margin: 0 auto 16px;
}
.qibla-stat {
  flex: 1; padding: 14px 10px; text-align: center;
  border-right: 1px solid var(--border);
}
.qibla-stat:last-child { border-right: none; }
.qs-value {
  font-size: 20px; font-weight: 800; color: var(--gold);
  font-family: var(--mono);
}
.qs-label {
  font-size: 11px; color: var(--muted); margin-top: 3px;
}

.qibla-note {
  font-size: 13px; color: var(--muted); margin-top: 8px;
}

/* ═══════════════════════════════════════
   CALENDAR
═══════════════════════════════════════ */
.calendar-wrap { padding: 4px 0 32px; }

.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-title {
  font-size: 18px; font-weight: 800; text-align: center;
}
.cal-nav {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--faint); border: 1px solid var(--border);
  color: var(--text); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.cal-nav:hover { background: rgba(255,255,255,0.1); }

.calendar-loading {
  text-align: center; padding: 40px;
  display: none; flex-direction: column; align-items: center; gap: 12px;
}
.calendar-loading.show { display: flex; }

/* Grid */
.calendar-grid {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.cal-day-header {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr 1fr 1fr;
  border-bottom: 2px solid var(--border);
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--muted); text-transform: uppercase;
  font-family: var(--mono);
}
.cal-day-header div { padding: 10px 12px; }

.cal-day {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.cal-day:last-child { border-bottom: none; }
.cal-day:hover { background: var(--faint); }
.cal-day.today { background: rgba(77,166,255,0.06); }
.cal-day.today .cal-date { color: var(--teal); }

.cal-date {
  padding: 10px 12px; font-size: 13px; font-weight: 700;
  border-right: 1px solid var(--border);
}
.cal-date-g { font-size: 13px; }
.cal-date-h { font-size: 11px; color: var(--gold); font-family: var(--arabic); direction: rtl; margin-top: 2px; }

.cal-time {
  padding: 10px 8px; font-size: 12px; font-family: var(--mono);
  color: var(--muted); display: flex; align-items: center;
}

/* Responsive calendar */
@media (max-width: 600px) {
  .cal-day-header,
  .cal-day {
    grid-template-columns: 64px 1fr 1fr 1fr 1fr 1fr;
    font-size: 11px;
  }
  .cal-time { padding: 8px 4px; font-size: 10px; }
  .cal-date { padding: 8px; }
}
