@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Work+Sans:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  font-family: "Cormorant Garamond", "Iowan Old Style", serif;
  background: #0b0d10;
  color: #1b1b1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.hero {
  background: linear-gradient(120deg, #0c4a6e, #0f766e);
  color: #f8fafc;
  padding: 3rem 1.5rem;
}

.hero__content {
  max-width: 960px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

main {
  max-width: 1100px;
  margin: -3rem auto 3rem;
  padding: 0 1.5rem;
  display: grid;
  gap: 2rem;
}

.landing-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.landing-card {
  display: grid;
  gap: 1rem;
}

.top-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.card {
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.card__header {
  margin-bottom: 1.5rem;
}

.card__subtext {
  margin-top: 0.25rem;
  color: #475569;
}

.prayer-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
  color: #0f172a;
}

input,
select,
button {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
}

button {
  background: #0f766e;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prayer-form__actions {
  grid-column: 3;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: -1.1rem;
}

.prayer-form__actions button {
  align-self: start;
}

@media (max-width: 640px) {
  .prayer-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .prayer-form__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(15, 118, 110, 0.3);
}

.times-grid,
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.offsets {
  margin-bottom: 1.5rem;
}

.offsets__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
  padding: 0.25rem 0;
}

.offsets__summary::-webkit-details-marker {
  display: none;
}

.offsets__summary::after {
  content: "+";
  font-size: 1.25rem;
  color: #0f172a;
}

.offsets[open] .offsets__summary::after {
  content: "−";
}

.offsets__hint {
  font-weight: 600;
  color: #94a3b8;
  margin-left: 0.75rem;
}

.offsets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.time-card,
.surah-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid #e2e8f0;
}

.surah-card .button {
  margin-top: 0.75rem;
  width: 100%;
}

.time-card h3,
.surah-card h3 {
  margin: 0 0 0.35rem;
}

.meta {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 1rem;
}

.status {
  margin-top: 1rem;
  color: #b91c1c;
}

.next-prayer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  margin-bottom: 1rem;
}

.next-prayer__name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

.next-prayer__meta {
  text-align: right;
}

.next-prayer__time {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.next-prayer__countdown {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  color: #475569;
}

.prayer-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: #0f766e;
  color: #f8fafc;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.35);
}

.prayer-banner.is-hidden {
  display: none;
}

.prayer-banner__close {
  border: 1px solid rgba(248, 250, 252, 0.4);
  background: transparent;
  color: inherit;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.quran-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.button.ghost {
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: 1px solid #0f766e;
  color: #0f766e;
  text-decoration: none;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}

.surah-content {
  display: block;
  line-height: 1.9;
  font-size: 1.2rem;
  direction: rtl;
  text-align: right;
  font-family: "Amiri", "Noto Naskh Arabic", serif;
}

.ayah {
  display: inline;
  margin: 0;
  white-space: normal;
}

.ayah--solo {
  display: block;
  text-align: center;
  margin: 0 0 0.75rem;
}

.ayah-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid #0f766e;
  color: #0f766e;
  font-size: 0.95em;
  line-height: 1;
  margin-right: 0.5rem;
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  background: #f8fafc;
}

.page-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-controls .button {
  min-width: 140px;
}

.page-meta {
  display: grid;
  gap: 0.35rem;
  text-align: center;
}

.page-meta label {
  justify-items: center;
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.surah-page {
  background: radial-gradient(circle at top, #2a2d33 0%, #1b1e23 35%, #14161a 100%);
  color: #f8fafc;
  min-height: 100vh;
}

.surah-page .reader {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.surah-page .reader-header {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.surah-page .reader-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.surah-page .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 0.55rem 1.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
}

.surah-page .page-pill {
  min-width: 70px;
  justify-content: center;
}

.surah-page .back-link {
  color: rgba(248, 250, 252, 0.8);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.surah-page .reader-body {
  padding: 2.5rem 2rem 3rem;
  border-radius: 36px;
  background: radial-gradient(circle at top, rgba(36, 40, 46, 0.9), rgba(16, 18, 22, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.45);
}

.surah-page .surah-content {
  font-size: 1.8rem;
  line-height: 2.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  max-width: 860px;
  margin: 1.25rem auto 0;
  word-spacing: 0;
  letter-spacing: 0;
}

.surah-page .page-controls {
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.surah-page .page-meta {
  color: rgba(248, 250, 252, 0.6);
  text-align: center;
}

.surah-page .page-meta label {
  color: rgba(248, 250, 252, 0.75);
  font-size: 0.85rem;
}

.surah-page select,
.surah-page button {
  border-color: rgba(248, 250, 252, 0.2);
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.surah-page .button.ghost {
  border-color: rgba(248, 250, 252, 0.3);
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.55rem 2.2rem;
  font-size: 0.95rem;
  min-width: 140px;
}

.surah-page .reader-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 2rem;
}

.surah-page .ayah-number {
  background: rgba(255, 255, 255, 0.08);
  border-color: #d2b985;
  color: #d2b985;
  vertical-align: middle;
}

.surah-page #page-status {
  font-size: 0.8rem;
  margin: 0.35rem 0 0;
  color: rgba(248, 250, 252, 0.45);
}

.surah-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.75rem;
  max-width: 760px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 2px solid rgba(210, 185, 133, 0.8);
  color: #d2b985;
  position: relative;
  cursor: pointer;
}

.surah-banner::before,
.surah-banner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 64px;
  height: 2px;
  background: rgba(210, 185, 133, 0.7);
}

.surah-banner::before {
  left: -70px;
}

.surah-banner::after {
  right: -70px;
}

.surah-banner__text {
  font-family: "Amiri", "Noto Naskh Arabic", serif;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.surah-search {
  max-width: 520px;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: rgba(12, 14, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.surah-search__label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(248, 250, 252, 0.7);
}

.surah-search__input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.surah-search__list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.surah-search__item {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.ayah--solo {
  display: block;
  text-align: center;
  margin: 0 0 0.75rem;
}

footer {
  text-align: center;
  color: #64748b;
  padding: 2rem 1.5rem 3rem;
}

.dark-app {
  background: #0b0d10;
  color: #f8fafc;
  min-height: 100vh;
  font-family: "Work Sans", "Segoe UI", sans-serif;
  color-scheme: dark;
}

.dark-app .hero {
  background: radial-gradient(circle at top, rgba(36, 42, 50, 0.95), rgba(14, 18, 22, 0.95));
  color: #f8fafc;
}

.dark-app .badge {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.85);
}

.dark-app main {
  margin-top: -3rem;
}

.dark-app .card {
  background: rgba(18, 22, 27, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}

.dark-app .card__subtext,
.dark-app .meta {
  color: rgba(248, 250, 252, 0.65);
}

.dark-app label {
  color: rgba(248, 250, 252, 0.9);
}

.dark-app input,
.dark-app select,
.dark-app button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.dark-app button {
  background: transparent;
  border: 1px solid rgba(210, 185, 133, 0.65);
  color: #d2b985;
  box-shadow: none;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.6rem 1.6rem;
}

.dark-app .button.ghost {
  border-color: rgba(210, 185, 133, 0.65);
  color: #d2b985;
}

.dark-app .time-card,
.dark-app .surah-card {
  background: rgba(12, 14, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.dark-app .next-prayer {
  background: rgba(12, 14, 18, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-app .next-prayer__countdown {
  color: rgba(248, 250, 252, 0.65);
}

.dark-app .status {
  color: #d2b985;
}

.dark-app .offsets__summary {
  color: #f8fafc;
}

.dark-app .offsets__summary::after {
  color: rgba(248, 250, 252, 0.8);
}

.dark-app .offsets__hint {
  color: rgba(248, 250, 252, 0.55);
}

.dark-app footer {
  color: rgba(248, 250, 252, 0.6);
}

.dark-app .top-nav .button.ghost {
  border-color: rgba(210, 185, 133, 0.65);
  color: #d2b985;
}

.dark-app .landing-card .button {
  background: transparent;
  border-color: rgba(210, 185, 133, 0.65);
  color: #d2b985;
}

@media (max-width: 600px) {
  .hero {
    padding: 2.5rem 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }
}
