body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f6f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: #6c9ecf;
  color: white;
  padding: 15px 0;
  text-align: center;
}

#controls {
  margin: 20px 0;
  text-align: center;
}

.toggle-container {
  display: inline-flex;
  border: 2px solid #6c9ecf;
  border-radius: 25px;
  cursor: pointer;
}

.toggle-option {
  padding: 10px 20px;
  background-color: white;
  color: #6c9ecf;
  transition: all 0.3s;
}

.toggle-option.active {
  background-color: #6c9ecf;
  color: white;
}

#timeline {
  width: 80%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#dateSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #d3d3d3;
  border-radius: 10px;
  outline: none;
  margin-bottom: 4px;
}

#currentDate {
  font-size: 16px;
  margin-left: 10px;
}

.button {
  padding: 10px 20px;
  background-color: #6c9ecf;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

footer {
  background-color: #6c9ecf;
  color: white;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
}

#map {
  margin: 20px auto;
  display: block;
}

.tooltip {
  position: absolute;
  padding: 8px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  opacity: 0;
}

#legend {
  width: 220px;
  margin: 10px auto 30px;
  font-size: 14px;
  color: #333;
  text-align: center;
}

.legend-title {
  margin-bottom: 5px;
  font-weight: bold;
}

.legend-scale {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.legend-labels {
  width: 200px;
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

#monthLabels {
  position: relative;
  width: 100%;
  height: 20px;
}

.month-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  color: #555;
}

#countryChartContainer {
  position: absolute;
  top: 100px;
  left: 100px;
  width: 400px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

#closeChart {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

#countryChartTitle {
  font-size: 15px;
  margin-bottom: 8px;
  text-align: center;
  color: #444;
}

#countryChart svg {
  width: 100%;
  height: auto;
}

.hidden {
  display: none;
}

#currentIndicatorLabel {
  margin-top: 10px;
  font-weight: bold;
  color: #444;
}

#searchContainer {
  width: 300px;
  margin: 0 auto 20px auto;
  position: relative;
}

#countrySearch {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

#searchResults {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 5;
}

#searchResults li {
  padding: 6px 10px;
  cursor: pointer;
}

#searchResults li:hover {
  background: #f0f0f0;
}

.hidden {
  display: none;
}

#zoomHint {
  text-align: center;
  font-size: 13px;
  color: #666;
  margin-top: 8px;
  margin-bottom: 20px;
  font-style: italic;
}

#playButton {
  margin-top: 10px;
}

#countryInfoPanel {
  position: absolute;
  top: 80px;
  left: 60px;
  width: 420px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 20;
}

#closeInfo {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

#countryInfoPanel .header {
  display: flex;
  align-items: center;
  padding: 10px;
  gap: 10px;
  background-color: #f0f0f0;
}

#countryFlag {
  width: 40px;
  height: 25px;
  object-fit: cover;
  border: 1px solid #ccc;
}

#countryName {
  font-size: 18px;
  margin: 0;
  color: #333;
}

#countryBackground {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

#countryInfoPanel .details {
  padding: 10px 15px;
  font-size: 14px;
  color: #444;
}

#countryChart {
  padding: 10px;
}

#modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#modalContent {
  background: white;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 20px;
  position: relative;
}

#closeInfo {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #555;
}

#modalContent .header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

#countryFlag {
  width: 50px;
  height: 32px;
  object-fit: cover;
  border: 1px solid #ccc;
}

#countryName {
  font-size: 22px;
  margin: 0;
  color: #333;
}

#countryBackground {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  margin-bottom: 15px;
}

#modalContent .details {
  font-size: 15px;
  color: #444;
  margin-bottom: 20px;
}

#countryChart svg {
  width: 100%;
  height: auto;
}

.hidden {
  display: none !important;
}

#introSection {
  width: 100%;
  padding: 40px 5%;
  background-color: #e9f1f9;
  border-bottom: 2px solid #d3e0ef;
}

.intro-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: auto;
  gap: 30px;
}

.intro-text {
  flex: 1;
  min-width: 300px;
}

.intro-text h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #2a5a88;
}

.intro-text p {
  font-size: 16px;
  margin-bottom: 12px;
  color: #444;
}

#globalStats p {
  font-size: 15px;
  margin: 6px 0;
  color: #333;
}

.intro-image img {
  max-width: 260px;
  height: auto;
  display: block;
  margin: auto;
}

#timelineSection {
  background-color: #1f2b38;
  padding: 60px 5%;
  color: white;
  border-top: 3px solid #6c9ecf;
}

#timelineSection h2 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 40px;
  color: #9cc3e5;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 800px;
  margin: auto;
  position: relative;
  padding-left: 20px;
}

.timeline-container::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #6c9ecf;
  border-radius: 2px;
}

.timeline-event {
  position: relative;
  padding-left: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.timeline-event.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-event::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  width: 12px;
  height: 12px;
  background-color: #9cc3e5;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #6c9ecf;
}

.timeline-date {
  font-weight: bold;
  color: #cce0f5;
  font-size: 14px;
  margin-bottom: 4px;
  display: inline-block;
}

.timeline-event p {
  margin: 4px 0 0 0;
  font-size: 15px;
  color: #e4eaf0;
}

#gallerySection {
  padding: 60px 5%;
  background-color: #f3f7fa;
  border-top: 2px solid #d0dce8;
  text-align: center;
}

#gallerySection h2 {
  font-size: 24px;
  color: #2a5a88;
  margin-bottom: 10px;
}

.gallery-subtitle {
  font-size: 16px;
  color: #555;
  margin-bottom: 30px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.image-grid a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-grid a:hover {
  transform: scale(1.04);
}

.image-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
