/* ===== QIBLA DIRECTION PAGE STYLES ===== */

/* Page wrapper */
body {
  background: #f5efe8;
  color: #2d1810;
}

/* ===== HERO ===== */
.qibla-hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d4a96a;
  margin-bottom: 0.75rem;
}

.qibla-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1d5d56;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1rem;
  color: #5a3828;
  margin: 0 0 1.5rem;
}

.location-status {
  display: inline-block;
  background: rgba(29,93,86,0.1);
  color: #1d5d56;
  border-radius: 24px;
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

/* ===== COMPASS SECTION ===== */
.qibla-compass-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  text-align: center;
}

.qibla-compass-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1d5d56;
  margin: 0 0 1.25rem;
}

.makkah-msg {
  font-size: 1.2rem;
  color: #1d5d56;
  font-weight: 600;
  background: #e8f5f3;
  border: 2px solid #1d5d56;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin: 0 auto 1.5rem;
  display: inline-block;
}

.compass-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 1.25rem;
}

/* Outer wrapper gives position:relative context for the floating Makkah badge */
.compass-outer-wrap {
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 4px 16px rgba(29,93,86,0.20));
}

/* Floating badge that JS moves to the arrow tip */
.makkah-badge {
  position: absolute;
  top: 0;      /* JS overrides this — explicit default prevents stale flow position */
  left: 0;     /* JS overrides this */
  background: #1d5d56;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.3s;
  letter-spacing: 0.03em;
}

/* Small hint text below compass */
.compass-hint {
  font-size: 0.8rem;
  color: #888;
  margin: 0.5rem 0 0;
  font-style: italic;
}

.bearing-label {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1d5d56;
  margin: 0 0 0.4rem;
}

.distance-label {
  font-size: 0.95rem;
  color: #5a3828;
  margin: 0 0 1.5rem;
}

/* City selector */
.city-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto 1rem;
}

.city-selector-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2d1810;
  white-space: nowrap;
}

#citySelector {
  border: 1.5px solid #d4a96a;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  background: #fff;
  color: #2d1810;
  min-width: 220px;
  cursor: pointer;
}

#citySelector:focus {
  outline: 2px solid #1d5d56;
  outline-offset: 1px;
}

/* Live compass button — prominent CTA */
.btn-live-compass,
#liveCompassBtn {
  display: none; /* shown by JS only on devices with compass */
  background: #1d5d56;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
}
.btn-live-compass:hover,
#liveCompassBtn:hover  { background: #164843; transform: translateY(-1px); }
.btn-live-compass.active,
#liveCompassBtn.active { background: #d4a96a; color: #2d1810; }

/* Detect button — hidden by default, shown by JS on touch devices only */
.btn-detect-location {
  display: none;
  background: transparent;
  color: #1d5d56;
  border: 2px solid #1d5d56;
  border-radius: 24px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.btn-detect-location:hover {
  background: #1d5d56;
  color: #fff;
}
/* Prominent variant — used when no location is detected yet (bearing = 0) */
.btn-detect-location.prominent {
  background: #1d5d56;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.6rem;
}
.btn-detect-location.prominent:hover {
  background: #164843;
  transform: translateY(-1px);
}
.btn-detect-location:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ===== INFO SECTIONS ===== */
.qibla-info-section {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  padding: 1.5rem 1.5rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(90,57,40,0.08);
}

.qibla-info-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1d5d56;
  margin: 0 0 0.75rem;
}

.qibla-info-section ul {
  margin: 0;
  padding-left: 1.4rem;
}

.qibla-info-section li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.qibla-info-section p {
  line-height: 1.7;
  margin: 0;
  color: #3a2515;
}

/* ===== FAQ ===== */
.qibla-faq-section {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(90,57,40,0.08);
}

.qibla-faq-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1d5d56;
  margin: 0 0 1rem;
}

.qibla-faq-section details {
  border-top: 1px solid #e8d5bc;
  padding: 0.7rem 0;
}

.qibla-faq-section details:last-child {
  border-bottom: 1px solid #e8d5bc;
}

.qibla-faq-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #2d1810;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qibla-faq-section summary::after {
  content: '▾';
  font-size: 0.8rem;
  color: #d4a96a;
  transition: transform 0.2s;
}

.qibla-faq-section details[open] summary::after {
  transform: rotate(180deg);
}

.qibla-faq-section details p {
  margin: 0.6rem 0 0;
  line-height: 1.7;
  color: #3a2515;
  font-size: 0.93rem;
}

/* ===== PRAYER TIMES TABLE ===== */
.prayer-times-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
}
.prayer-times-table thead {
  display: none; /* labels are self-evident — row layout replaces header */
}
.prayer-times-table tbody {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.prayer-times-table tbody tr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 calc(20% - 0.6rem);
  min-width: 80px;
  background: #f7efe6;
  border-radius: 10px;
  padding: 0.65rem 0.5rem;
  gap: 0.25rem;
}
.prayer-times-table tbody tr:hover {
  background: #eee5d8;
}
.prayer-times-table tbody td {
  display: block;
  border: none;
  padding: 0;
  text-align: center;
  line-height: 1.3;
}
/* First td = prayer name */
.prayer-times-table tbody td:first-child {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d5d56;
}
/* Second td = time */
.prayer-times-table tbody td:last-child {
  font-size: 1rem;
  font-weight: 600;
  color: #2d1810;
}
.prayer-times-link {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.prayer-times-link a {
  color: #1d5d56;
  text-decoration: none;
  font-weight: 600;
}
.prayer-times-link a:hover {
  text-decoration: underline;
}

/* ===== RELATED SECTION ===== */
.qibla-related-section {
  max-width: 700px;
  margin: 0 auto 2.5rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(90,57,40,0.08);
}

.qibla-related-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1d5d56;
  margin: 0 0 1rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: #fdf6ee;
  border: 1px solid #e8d5bc;
  border-radius: 10px;
  text-decoration: none;
  color: #1d5d56;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  transition: background 0.2s, border-color 0.2s;
}

.link-card:hover {
  background: #f1d4b7;
  border-color: #d4a96a;
}

/* ===== QIBLA-SPECIFIC LINK ===== */
a.qibla-link {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.5rem 1rem;
  background: #e8f5f3;
  color: #1d5d56;
  border: 1.5px solid #1d5d56;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}

a.qibla-link:hover {
  background: #d0ede8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .qibla-hero h1 {
    font-size: 1.7rem;
  }

  .city-selector-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  #citySelector {
    width: 100%;
  }

  .qibla-info-section,
  .qibla-faq-section,
  .qibla-related-section,
  .qibla-compass-section {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
}
