* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  overflow: hidden;
}

#map {
  width: 100vw;
  height: 100vh;
}

/* ---- Control Panel ---- */
#controls {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 300px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  z-index: 10;
  font-size: 14px;
}

.controls-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.controls-header .subtitle {
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
}

.control-group {
  margin-bottom: 14px;
}

.control-group label {
  display: block;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.preset-buttons {
  display: flex;
  gap: 8px;
}

.preset-btn {
  flex: 1;
  padding: 7px 0;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.preset-btn.active {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

.toggle-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400 !important;
}

.toggle-label input[type="checkbox"] {
  accent-color: #e74c3c;
  width: 16px;
  height: 16px;
}

/* ---- Legend ---- */
.legend {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}

.legend h3 {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #555;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-fill {
  width: 20px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ---- Stats ---- */
.stats-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #888;
}

/* ---- Prayer Times ---- */
.prayer-info {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.prayer-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.prayer-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #555;
  padding: 3px 0;
}

.prayer-note {
  font-size: 11px;
  color: #999;
  margin-top: 8px;
  line-height: 1.4;
}

/* ---- Mapbox Popups ---- */
.mapboxgl-popup-content {
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  max-width: 240px;
}

.popup-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: #1a1a2e;
}

.popup-detail {
  color: #666;
  font-size: 12px;
  line-height: 1.5;
}

/* ---- Hotel button ---- */
.hotel-btn {
  width: 100%;
  padding: 9px 0;
  border: 1.5px solid #3498db;
  border-radius: 6px;
  background: #fff;
  color: #3498db;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.hotel-btn:hover,
.hotel-btn.active {
  background: #3498db;
  color: #fff;
}

/* ---- Header row ---- */
.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

#btn-info {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
  margin-top: 2px;
}

#btn-info:hover { opacity: 1; }

/* ---- Context modal ---- */
#context-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#context-modal.hidden { display: none !important; }

#context-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  font-size: 14px;
  line-height: 1.55;
  color: #333;
}

.context-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

#context-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

.context-lead {
  font-size: 15px;
  color: #444;
  margin-bottom: 0;
}

.context-divider {
  border-top: 1px solid #eee;
  margin: 16px 0;
}

.context-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.context-times span {
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  color: #c0392b;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}

.context-tip {
  background: #f0f8f0;
  border-left: 3px solid #27ae60;
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  margin-top: 0;
  font-size: 13px;
  color: #2c5f2e;
}

#context-dismiss {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#context-dismiss:hover { background: #c0392b; }

/* ---- Built by ---- */
.built-by {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  text-align: center;
}

.built-by a {
  font-size: 11px;
  font-style: italic;
  color: #bbb;
  text-decoration: none;
}

.built-by a:hover {
  color: #888;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  #controls {
    width: calc(100vw - 32px);
    max-height: 50vh;
    bottom: 16px;
    top: auto;
  }
}
