/* Swalah — calm, premium, mobile-first prayer times page. */

.pt-body {
  background: linear-gradient(180deg, #f0fbf7, #f8fbff);
}

.pt-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 12px 56px;
}

.pt-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pt-back-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
  text-decoration: none;
  font-size: 1.1rem;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pt-back-link:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.pt-page-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  color: #0f5132;
  line-height: 1.25;
}

.pt-page-title i {
  color: #059669;
}

.pt-location-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pt-location-pill:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.pt-location-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estimated-location banner */
.pt-estimated-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.pt-estimated-banner__text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.pt-estimated-banner__actions {
  display: flex;
  gap: 14px;
}

.pt-link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: #b45309;
  text-decoration: underline;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pt-link-btn:hover {
  color: #92400e;
}

/* Card shell */
.pt-card {
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 20px;
  padding: 20px 18px 22px;
  box-shadow: 0 10px 30px rgba(5, 150, 105, 0.08);
  position: relative;
  min-height: 260px;
}

/* Skeleton */
.pt-skeleton {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@keyframes pt-shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.pt-skeleton__row,
.pt-skeleton__block,
.pt-skeleton__bar,
.pt-skeleton__cell {
  border-radius: 10px;
  background: linear-gradient(90deg, #ecfdf5 25%, #d1fae5 37%, #ecfdf5 63%);
  background-size: 400px 100%;
  animation: pt-shimmer 1.4s ease-in-out infinite;
}

.pt-skeleton__row--date {
  height: 18px;
  width: 60%;
}

.pt-skeleton__hero {
  display: flex;
  gap: 14px;
}

.pt-skeleton__block {
  flex: 1;
  height: 74px;
}

.pt-skeleton__bar {
  height: 8px;
  border-radius: 999px;
}

.pt-skeleton__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pt-skeleton__cell {
  height: 40px;
}

/* Error / empty states */
.pt-state {
  text-align: center;
  padding: 28px 12px 8px;
}

.pt-state i {
  font-size: 2.1rem;
  color: #94a3b8;
}

.pt-state--error i {
  color: #dc2626;
}

.pt-state__title {
  margin: 12px 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.pt-state__message {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
}

.pt-state__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Buttons */
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.pt-btn--primary {
  background: #059669;
  color: #fff;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
}

.pt-btn--primary:hover {
  background: #047857;
}

.pt-btn--ghost {
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.pt-btn--ghost:hover {
  background: #dcfce7;
}

.pt-btn--block {
  width: 100%;
}

.pt-btn:active {
  transform: scale(0.98);
}

/* Main content */
.pt-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pt-date-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  color: #475569;
  font-size: 0.92rem;
  text-align: center;
}

.pt-date-gregorian {
  font-weight: 700;
  color: #0f172a;
}

.pt-date-sep {
  margin: 0 6px;
  color: #cbd5e1;
}

.pt-date-hijri {
  font-family: "Amiri", "Traditional Arabic", "Segoe UI", serif;
}

.pt-share-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid #d1fae5;
  border-radius: 50%;
  background: #f0fdf4;
  color: #059669;
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pt-share-btn:hover {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.pt-share-btn:active {
  transform: translateY(-50%) scale(0.92);
}

/* Previous / next hero */
.pt-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pt-hero__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 16px 10px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.pt-hero__side--previous {
  background: linear-gradient(135deg, #fdf2f8 0%, #fff1f6 100%);
  border-color: #f9a8d4;
}

.pt-hero__side--next {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border-color: #6ee7b7;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.14);
}

.pt-hero__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2px;
}

.pt-hero__side--previous .pt-hero__name {
  color: #9d174d;
}

.pt-hero__side--next .pt-hero__name {
  color: #065f46;
}

.pt-hero__time {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.pt-hero__relative {
  font-size: 0.8rem;
  color: #64748b;
}

.pt-hero__relative--countdown {
  color: #64748b;
}

.pt-hero__iqamah {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.4);
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.pt-hero__side--previous .pt-hero__iqamah {
  color: #be185d;
}

.pt-hero__side--next .pt-hero__iqamah {
  color: #059669;
}

.pt-hero__iqamah-top {
  display: block;
}

.pt-hero__iqamah-label {
  font-size: 1em;
}

.pt-hero__iqamah-time {
  font-size: 1.4rem;
  font-weight: 700;
  margin-left: 2px;
}

.pt-hero__iqamah-relative {
  display: block;
  margin-top: 3px;
  color: #64748b;
}

/* Progress line */
.pt-progress {
  padding: 0 6px;
}

.pt-progress__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: visible;
}

.pt-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #059669);
  transition: width 0.6s ease;
}

.pt-progress__dot {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #059669;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25);
  transform: translate(-50%, -50%);
  transition: left 0.6s ease;
}

/* Timings grid */
.pt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.pt-grid__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid transparent;
}

.pt-grid__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  color: #475569;
  font-weight: 600;
}

.pt-grid__name i {
  color: #94a3b8;
  width: 14px;
  text-align: center;
}

.pt-grid__time {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.pt-grid__row--previous {
  background: #fdf2f8;
  border-color: #f9a8d4;
}

.pt-grid__row--previous .pt-grid__name,
.pt-grid__row--previous .pt-grid__time {
  color: #9d174d;
}

.pt-grid__row--previous .pt-grid__name i {
  color: #db2777;
}

.pt-grid__row--next {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.pt-grid__row--next .pt-grid__name,
.pt-grid__row--next .pt-grid__time {
  color: #047857;
}

.pt-grid__row--next .pt-grid__name i {
  color: #059669;
}

@media (min-width: 480px) {
  .pt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Footer actions */
.pt-actions {
  display: flex;
  gap: 10px;
}

.pt-actions .pt-btn {
  flex: 1;
  padding-left: 10px;
  padding-right: 10px;
}

/* Dialogs (native <dialog>) */
.pt-dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  max-width: 420px;
  width: 92vw;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
}

.pt-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.pt-dialog__inner {
  padding: 18px 18px 22px;
  max-height: 82vh;
  overflow-y: auto;
}

.pt-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pt-dialog__header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f5132;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pt-dialog__close:hover {
  background: #e2e8f0;
}

/* Bottom-sheet variant (change location) */
.pt-dialog--sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  top: auto;
  margin: 0 0 0 -46vw;
  width: 92vw;
  border-radius: 20px 20px 0 0;
}

@media (min-width: 560px) {
  .pt-dialog--sheet {
    position: static;
    margin: auto;
    border-radius: 18px;
  }
}

.pt-dialog__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 0 auto 14px;
}

@media (min-width: 560px) {
  .pt-dialog__handle {
    display: none;
  }
}

.pt-dialog__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #94a3b8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pt-dialog__divider::before,
.pt-dialog__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.pt-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
}

.pt-search:focus-within {
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.pt-search i {
  color: #94a3b8;
  font-size: 0.85rem;
}

.pt-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 16px;
  outline: none;
}

.pt-search-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pt-search-results li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pt-search-results li button:hover {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.pt-search-results li button i {
  color: #059669;
  flex-shrink: 0;
}

.pt-search-hint {
  margin: 14px 0 0;
  text-align: center;
  color: #64748b;
  font-size: 0.86rem;
}

.pt-search-hint--error {
  color: #b91c1c;
}

/* Prayer time settings dialog */
.pt-dialog--settings .pt-dialog__inner {
  max-height: 84vh;
}

.pt-settings-change-location {
  margin-bottom: 16px;
}

.pt-settings-section {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
}

.pt-settings-section:last-of-type {
  margin-bottom: 0;
}

.pt-settings-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: #f8fafc;
  color: #0f5132;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.pt-settings-section__toggle::-webkit-details-marker {
  display: none;
}

.pt-settings-section__toggle i {
  color: #059669;
  transition: transform 0.2s ease;
}

.pt-settings-section[open] .pt-settings-section__toggle i {
  transform: rotate(180deg);
}

.pt-settings-section__hint {
  margin: 10px 16px 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.pt-settings-section__body {
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pt-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.pt-settings-row--iqamah {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.pt-settings-row__name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1e293b;
}

.pt-fixed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-fixed-row__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

/* Yes/No radio pills — chosen over a checkbox, which has shown rendering/tap
   issues with custom styling on iOS Safari. Same pattern as org-asset.ejs. */
.pt-yesno-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pt-yesno-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 14px 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.pt-yesno-opt:has(input:checked) {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
}

.pt-yesno-opt input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #059669;
  cursor: pointer;
}

.pt-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pt-settings-row--iqamah .pt-stepper {
  justify-content: flex-start;
}

.pt-stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  padding: 0;
}

.pt-stepper__btn:hover {
  background: #d1fae5;
}

.pt-stepper__btn:active {
  transform: scale(0.94);
}

.pt-stepper__value {
  min-width: 60px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.pt-time-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 16px;
  color: #0f172a;
  background: #fff;
  font-family: inherit;
}

.pt-time-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.pt-settings-footer {
  margin-top: 6px;
}

/* Qibla compass */
.pt-compass {
  display: flex;
  justify-content: center;
  margin: 6px 0 18px;
}

.pt-compass__ring {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #f0fdf4 0%, #ecfdf5 70%, #d1fae5 100%);
  border: 3px solid #a7f3d0;
  box-shadow: inset 0 0 24px rgba(5, 150, 105, 0.12);
}

.pt-compass__cardinal {
  position: absolute;
  font-size: 0.78rem;
  font-weight: 800;
  color: #059669;
}

.pt-compass__cardinal--n {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.pt-compass__cardinal--e {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.pt-compass__cardinal--s {
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.pt-compass__cardinal--w {
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}

.pt-compass__needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 78px;
  margin-top: -78px;
  margin-left: -2px;
  transform-origin: bottom center;
  transform: rotate(0deg);
  transition: transform 0.35s ease;
  display: flex;
  justify-content: center;
}

.pt-compass__needle::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 78px;
  background: linear-gradient(180deg, #d97706, #059669);
  border-radius: 4px;
  transform: translateX(-50%);
}

.pt-compass__needle i {
  position: relative;
  top: -18px;
  color: #d97706;
  font-size: 1.3rem;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.pt-qibla-bearing {
  text-align: center;
  margin: 0 0 4px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.pt-qibla-instruction {
  text-align: center;
  margin: 0 0 14px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Nearest Masjid dialog */
.pt-masjid-status {
  text-align: center;
  padding: 10px 6px 22px;
}

.pt-masjid-status i {
  font-size: 2.2rem;
  color: #d97706;
}

.pt-masjid-status__text {
  margin: 12px 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #92400e;
}

.pt-masjid-status__hint {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
}

.pt-dialog .pt-btn--primary.pt-btn--block {
  text-decoration: none;
}

.pt-masjid-cta-wrap {
  text-align: center;
}

.pt-masjid-cta {
  width: auto;
  min-width: 220px;
  text-decoration: none;
}

@media (max-width: 480px) {
  .pt-page {
    padding: 12px 8px 48px;
  }

  .pt-card {
    padding: 16px 14px 18px;
    border-radius: 16px;
  }

  .pt-hero__time,
  .pt-hero__iqamah-time {
    font-size: 1.2rem;
  }

  .pt-actions {
    gap: 6px;
  }

  .pt-actions .pt-btn {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 0.82rem;
    gap: 5px;
  }

  .pt-compass__ring {
    width: 170px;
    height: 170px;
  }

  .pt-compass__needle {
    height: 66px;
    margin-top: -66px;
  }

  .pt-compass__needle::before {
    height: 66px;
  }
}
