/* =========================
   RESET AND BASE STYLES
   ========================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  background-color: #ffffff;
  color: #111111; /* default readable color */
}

/* Page title */
h1 {
  background-color: #197349;
  color: #ffffff;
  margin: 0;
  padding: 12px 18px;
  font-size: 2rem;
}

/* =========================
   MAP + LAYOUT
   ========================= */
#map-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: #f0f0f0; /* fallback if map fails */
  color: #111111;
}

#map {
  flex: 1 1 auto;
  height: 100%;
}

/* =========================
   SIDEBAR
   ========================= */
#sidebar {
  position: fixed;
  top: 0;
  right: -420px; /* hidden by default */
  width: 380px;
  height: 100%;
  background-color: #f7f5e3; /* slightly higher contrast */
  color: #111;
  border-left: 2px solid #ddd;
  box-shadow: -6px 0 18px rgba(0,0,0,0.08);
  padding: 18px;
  overflow-y: auto;
  opacity: 0;
  transition: right 0.8s ease-in-out, opacity 0.6s ease-in-out;
  z-index: 20;
}

#sidebar.open {
  right: 0;
  opacity: 1;
}

#sidebar h2 {
  margin-top: 0;
  margin-bottom: 16px;
  padding-right: 5%;
  font-size: 2rem;
  line-height: 1.3;
  font-weight: 700;
  color: #135637;
  background-color: #f7f5e3;
}

/* list wrapper */
#disaster-list {
  display: block;
  gap: 10px;
}

/* =========================
   DISASTER CARDS
   ========================= */
.disaster-item {
  background-color: #f8f6e7;
  color: #111111;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.disaster-item:hover {
  background-color: #afc7b8;
  color: #111111;
}

/* Title + meta */
.disaster-title {
  font-weight: 700;
  font-size: 1.6rem;
  display: block;
  margin-bottom: 6px;
  color: #135637;
  background-color: transparent;
  text-decoration: none;
}

.disaster-meta {
  font-size: 1.1rem;
  color: #BF3326;
  background-color: transparent;
  margin-bottom: 6px;
}

/* =========================
   IMAGES
   ========================= */
.disaster-img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #eee;
}

.disaster-aftermath {
  font-size: 13px;
  color: #333;
}

/* image source */
.disaster-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.5rem;
}

.image-source {
  font-size: 0.75rem;
  color: #555;
  margin-top: 2px;
  text-align: center;
}

.image-source a {
  color: #197349;
  text-decoration: none;
}

.image-source a:hover {
  text-decoration: underline;
}

/* =========================
   CUSTOM MAP MARKERS
   ========================= */
.custom-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #f8f6e7;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.custom-marker:hover {
  transform: scale(3);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

/* =========================
   ANIMATIONS
   ========================= */
.highlight {
  animation: highlightFlash 1s ease forwards;
}

@keyframes highlightFlash {
  0% { background: #fff7d6; }
  70% { background: #fff7d6; }
  100% { background: #fafafa; }
}

@keyframes markerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1.4); }
}

/* =========================
   CONTROLS & BUTTONS
   ========================= */
.controls {
  position: absolute;
  left: 16px;
  bottom: 18px;
  z-index: 30;
}

button {
  cursor: pointer;
}

#resetMap {
  font-size: 1.3rem;
  color: #ffffff;
  background-color: #197349;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #197349;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#resetMap:hover {
  background-color: #ADD96C;
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Close button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #197349;
  color: #ffffff;
  border: 3px solid #197349;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.close-btn:hover {
  background-color: #ADD96C;
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
