/* Global Styles */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --background-color: #f5f7fa;
  --text-color: #333;
  --light-text: #f5f7fa;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 2rem 0;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

header p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Navigation */
nav {
  background-color: var(--secondary-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
}

nav ul li {
  margin: 0 1rem;
}

nav ul li a {
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

nav ul li a:hover {
  color: var(--primary-color);
}

/* Main Content */
main {
  padding: 2rem 0;
}

section {
  margin-bottom: 3rem;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  text-align: center;
}

/* Timeline */
.timeline-container {
  position: relative;
  padding: 2rem 0;
}

.timeline-navigation {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.timeline-navigation button {
  background-color: var(--secondary-color);
  color: var(--light-text);
  border: none;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.timeline-navigation button:hover {
  background-color: var(--primary-color);
}

.timeline-navigation button.active {
  background-color: var(--accent-color);
}

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: var(--secondary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -17px;
  background-color: var(--background-color);
  border: 4px solid var(--accent-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.left {
  left: 0;
}

.right {
  left: 50%;
}

.left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  right: 30px;
  border: medium solid var(--secondary-color);
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--secondary-color);
}

.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  left: 30px;
  border: medium solid var(--secondary-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--secondary-color) transparent transparent;
}

.right::after {
  left: -16px;
}

.timeline-content {
  padding: 20px 30px;
  background-color: white;
  position: relative;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.timeline-content h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.timeline-content p {
  margin-bottom: 0.5rem;
}

.timeline-content .category {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--light-text);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* World Map */
.map-container {
  position: relative;
  height: 600px;
  margin-bottom: 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.map-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.map-controls button {
  background-color: var(--secondary-color);
  color: var(--light-text);
  border: none;
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.map-controls button:hover {
  background-color: var(--primary-color);
}

.map-controls button.active {
  background-color: var(--accent-color);
}

.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 10;
}

.map-legend h4 {
  margin-bottom: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.3rem;
}

.legend-color {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  border-radius: 50%;
}

/* Category Filters */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.category-filter {
  background-color: var(--secondary-color);
  color: var(--light-text);
  border: none;
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.category-filter:hover {
  background-color: var(--primary-color);
}

.category-filter.active {
  background-color: var(--accent-color);
}

/* Stats Section */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
}

.stat-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.stat-card p {
  color: var(--text-color);
}

/* About Section */
.about-content {
  background-color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  max-width: 800px;
  margin: 0 auto;
}

.about-content h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.about-content p {
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 2rem 0;
  text-align: center;
}

footer p {
  margin-bottom: 1rem;
}

footer a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

footer a:hover {
  color: var(--accent-color);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .timeline::after {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  .timeline-item::before {
    left: 60px;
    border: medium solid var(--secondary-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--secondary-color) transparent transparent;
  }

  .left::after, .right::after {
    left: 15px;
  }
  
  .right {
    left: 0%;
  }
  
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  nav ul li {
    margin: 0.5rem 0;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: var(--border-radius);
  max-width: 600px;
  box-shadow: var(--box-shadow);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-header {
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 15px;
}

.modal-body {
  margin-bottom: 15px;
}

.modal-footer {
  padding-top: 10px;
  border-top: 1px solid #ddd;
  text-align: right;
}

/* Loading Animation */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.loading-spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--secondary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

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

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: var(--primary-color);
  color: var(--light-text);
  text-align: center;
  border-radius: var(--border-radius);
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}