/* =========================================================
   MOSQUE FINDER — Uses index.css theme variables
   Light / Dim / Dark · Responsive · Professional
========================================================= */

/* Mosque page overrides — inherits --bg-main, --text-main, --accent from index.css */
.mosque-main {
  max-width: 1150px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.8rem) max(1rem, env(safe-area-inset-right)) clamp(1rem, 3vw, 1.4rem) max(1rem, env(safe-area-inset-left));
  padding-bottom: max(6rem, calc(6rem + env(safe-area-inset-bottom)));
}

/* Hero card — matches premium-card style */
.mosque-hero {
  margin-bottom: 1.5rem;
}

.mosque-hero .section-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.mosque-hero .section-title .arabic {
  font-family: "Amiri", serif;
  color: var(--accent);
  font-size: clamp(1.8rem, 5vw, 2.9rem);
}

.ramadan-subtitle {
  max-width: 620px;
  margin: 0.8rem auto 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.crescent {
  margin-top: 1.5rem;
  font-size: 2rem;
  color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .crescent {
    animation: mosqueGlow 3s ease-in-out infinite;
  }
}

@keyframes mosqueGlow {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

/* =========================================================
   CONTROLS — Professional search bar
========================================================= */
.controls {
  margin-bottom: 1.5rem;
}

.controls-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.search-wrap {
  display: flex;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  position: relative;
}

.search-input {
  flex: 1;
  padding: 0.65rem 3rem 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated-strong);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.search-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  font-size: 1.1rem;
  transition: color 0.2s, background 0.2s;
}

.search-btn:hover {
  color: var(--accent);
  background: var(--gold-soft);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.search-status {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.4em;
  margin-top: 0.5rem;
}

.search-status.loading {
  color: var(--accent);
}

.search-status.error {
  color: #ef4444;
}

/* =========================================================
   MAP
========================================================= */
.map-section {
  margin-bottom: 2rem;
}

#map {
  height: clamp(320px, 50vh, 520px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
  background: var(--bg-elevated);
}

/* Leaflet overrides — theme-aware */
.leaflet-control-zoom a {
  background: var(--bg-elevated) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-soft) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-elevated-strong);
  color: var(--text-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
}

.leaflet-popup-content strong {
  color: var(--accent);
}

/* Direction buttons */
.dir-btn {
  display: inline-block;
  margin: 0.35rem 0.25rem 0 0;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #111;
  background: var(--accent);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dir-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--gold-soft);
}

.dir-btn.dir-apple {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.dir-btn.dir-apple:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.leaflet-popup-content .dir-btn {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
}

.direction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* =========================================================
   MOSQUE GRID — Feature cards style
========================================================= */
.ramadan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.ramadan-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  display: flex;
  gap: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ramadan-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-gold);
}

.ramadan-content {
  flex: 1;
  min-width: 0;
}

.ramadan-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.25rem;
  color: var(--text-main);
}

.arabic-text {
  font-family: "Amiri", serif;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.ramadan-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.ramadan-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  align-self: center;
}

.no-mosques-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-soft);
}

.no-mosques-msg p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.no-mosques-msg .hint {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* =========================================================
   RESPONSIVE — Small mobile → Tablet → Desktop
========================================================= */
@media (max-width: 359px) {
  .mosque-main { padding: 1rem 1rem 5.5rem; }
  .search-wrap { min-width: 100%; max-width: 100%; }
  .controls-inner { flex-direction: column; align-items: stretch; }
  .controls-inner .btn-primary { width: 100%; }
  #map { height: 280px; }
  .ramadan-card { padding: 1rem; }
}

@media (min-width: 360px) and (max-width: 479px) {
  .mosque-main { padding: 1.2rem 1.2rem 5.5rem; }
  #map { height: 340px; }
}

@media (min-width: 480px) and (max-width: 767px) {
  #map { height: 400px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .mosque-main { padding: 1.5rem 1.5rem 6rem; }
  #map { height: 450px; }
}

@media (min-width: 1024px) {
  .mosque-main { padding-bottom: 2rem; }
  #map { height: 480px; }
}

@media (min-width: 1280px) {
  #map { height: 520px; }
}

