/* ============================================
   Gazetteer - Design System (reduced per tutor)
   ============================================ */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --primary: #4A90E2;
  --secondary: #5E9EC2;
  --danger: #FF6B6B;
  --bg-primary: #0D1117;
  --card-bg: #1B2330;
  --card-border: rgba(255,255,255,0.1);
  --text-primary: #FFFFFF;
  --text-secondary: #AAB6C5;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background: var(--bg-primary);
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Map Container */
.map-container {
  height: 100vh;
  width: 100% !important;
  z-index: 1;
  position: fixed;
  top: 0;
  left: 0;
  background: white;
  overflow: hidden;
}

/* Widen Bootstrap modals slightly (Weather modal needs space for 3 cards) */
.modal-dialog {
  max-width: 650px;
}

#map {
  height: 100%;
  width: 100%;
}

/* Country Selector (top center) */
#selectContainer {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1030;
  min-width: 260px;
  max-width: 340px;
}

#selectContainer .form-select {
  background: rgba(255,255,255,0.96);
  color: #111827;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.15);
  box-shadow: 0 10px 30px rgba(15,23,42,0.35);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

#selectContainer .form-select:focus,
#selectContainer .form-select:hover {
  border-color: #4A90E2;
  box-shadow: 0 14px 40px rgba(15,23,42,0.45);
  background: #ffffff;
  transform: translateY(-1px);
}

#selectContainer .form-select option {
  background: #0f172a;
  color: #e5e7eb;
}

/* Info Modal feature list */
.feature-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.feature-item:hover {
  background-color: rgba(15, 23, 42, 0.04);
}

/* Preloader */
#preloader {
  position: fixed;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Leaflet zoom bar icons */
.leaflet-bar button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaflet-bar button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

/* Loader overlay */
#loaderOverlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 9999;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  color: white;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  font-family: var(--font-family);
}

/* Dark theme (when Dark map layer active) */
.dark-theme {
  --bg-primary: #0D1117;
  --card-bg: #1B2330;
}

/* Marker clusters */
.marker-cluster {
  background-clip: padding-box;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.marker-cluster div {
  background: #1a1a1a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-family: var(--font-family) !important;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4) !important;
}

.marker-cluster span {
  line-height: 26px;
  font-size: 13px;
  font-weight: 700 !important;
  color: #ffffff !important;
}

.marker-cluster-small div { width: 32px; height: 32px; }
.marker-cluster-medium div { width: 38px; height: 38px; }
.marker-cluster-large div { width: 46px; height: 46px; }

.dark-theme .marker-cluster div {
  background: #0a0a0a !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
}

/* Weather modal - template style (IT Career Switch CodePen) */
.weather-modal-dialog .modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.weather-modal-header {
  background: #4A90E2;
  color: #fff;
  border-bottom: none;
  padding: 0.75rem 1rem;
}

.weather-modal-header .modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.weather-modal-body {
  background: #fff;
  color: #333;
}

.weather-modal-body .border-bottom {
  border-color: #e5e7eb !important;
}

.weather-today-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 0.5rem;
}

.weather-today-conditions {
  font-size: 0.95rem;
  color: #333;
}

.weather-today-icon {
  width: 48px;
  height: 48px;
}

.weather-today-max {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.weather-today-sep {
  color: #999;
  margin: 0 0.25rem;
}

.weather-today-min {
  color: #666;
  font-size: 1rem;
}

.weather-forecast-cards {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.weather-day-card {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.weather-day-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.weather-day-icon {
  width: 40px;
  height: 40px;
  margin: 0.25rem auto;
  display: block;
}

.weather-day-temp {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.weather-footer {
  font-size: 0.8rem;
  color: #666;
}

.weather-footer a {
  color: #4A90E2;
  text-decoration: none;
}

.weather-footer a:hover {
  text-decoration: underline;
}

.weather-preload {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-preload::before {
  content: "";
  width: 48px;
  height: 48px;
  border: 4px solid #f2f2f2;
  border-top: 4px solid #4A90E2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.weather-preload.fadeOut {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.5s, opacity 0.5s linear;
}

/* Responsive */
@media (max-width: 768px) {
  #selectContainer {
    top: 10px;
    min-width: 210px;
    max-width: 260px;
  }
  #selectContainer .form-select {
    font-size: 13px;
    padding: 6px 12px;
  }
  .map-container {
    width: 100% !important;
    height: 100vh !important;
  }
}
