/* Universal box-sizing for consistent layout */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #181818;
  color: #f0e6d2;
}

#app {
  max-width: 960px;
  margin: 10px auto;
  padding: 20px;
  background: #1e1e1e;
  border: 2px solid #5a5a5a;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

header {
  text-align: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  position: relative;
}

header h1 {
  color: #f0e6d2;
  font-size: 1.6rem;
  margin-bottom: 5px;
}

#server-info {
  margin-top: 5px;
  font-size: 0.8rem;
  color: #a0a0a0;
  line-height: 1.2;
}

#home-link {
  position: absolute;
  top: -15px;
  right: 10px;
  color: #f0e6d2;
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  background: rgba(42, 42, 42, 0.8);
  border: 1px solid #4a4a4a;
}

#home-link:hover {
  background: rgba(58, 58, 58, 0.9);
  border-color: #5a5a5a;
  transform: scale(1.05);
}

#home-link svg {
  display: block;
}

#controls {
  margin: 15px 0;
  padding: 15px;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

#filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-weight: 600;
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-btn {
  padding: 4px 8px;
  border: 2px solid #4a4a4a;
  background-color: #2a2a2a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.filter-btn:hover {
  background-color: #3a3a3a;
  border-color: #5a5a5a;
}

.filter-btn.active {
  background-color: #1a4d8c;
  border-color: #b58c00;
  color: #fff;
  box-shadow: inset 0 0 8px rgba(181, 140, 0, 0.5);
}

.filter-btn img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 2px;
}

.filter-btn[data-value=""] {
  min-width: 40px;
  text-align: center;
}

#chart-container {
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 15px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
  position: relative;
  overflow: visible;
}

.population-icons {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.population-icon {
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#chart {
  position: relative;
  height: 350px;
  margin-bottom: 0;
  overflow: visible;
  padding-top: 5px;
}

#y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 30px;
  width: 50px;
  border-right: 1px solid #3a3a3a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 8px;
}

.y-label {
  font-size: 0.6rem;
  color: #a0a0a0;
  text-align: right;
  transform: translateY(50%);
  background: rgba(13, 13, 13, 0.7);
  padding: 1px 2px;
  border-radius: 1px;
}

#bars-container {
  position: absolute;
  left: 60px;
  right: 0;
  top: 5px;
  bottom: 30px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  padding: 0 8px;
  overflow: visible;
}

.bar {
  flex: 1;
  background: #1a4d8c;
  border-radius: 2px 2px 0 0;
  transition: background 0.2s;
  position: relative;
  min-width: 6px;
  cursor: pointer;
}

.bar:hover {
  background: #b58c00;
}

.bar-value {
  font-size: 0.7rem;
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.2s;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.bar:hover .bar-value {
  opacity: 1;
}

#x-axis {
  position: absolute;
  bottom: 0;
  left: 60px;
  right: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.x-label {
  font-size: 0.6rem;
  color: #a0a0a0;
  transform: rotate(-45deg);
  transform-origin: top left;
  white-space: nowrap;
}

#animation-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  padding: 10px;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.control-btn {
  padding: 8px 16px;
  border: 2px solid #4a4a4a;
  background-color: #2a2a2a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
}

.control-btn:hover {
  background-color: #3a3a3a;
  border-color: #5a5a5a;
}

.control-btn:active {
  background-color: #4a4a4a;
  border-color: #6a6a6a;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-control label {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

#speed-slider {
  width: 100px;
  background: #2a2a2a;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
}

#speed-value {
  font-weight: 600;
  color: #fff;
  min-width: 30px;
  font-size: 0.9rem;
}

.date-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-control label {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

#date-slider {
  width: 150px;
  background: #2a2a2a;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  cursor: pointer;
}

#date-slider:disabled {
  background: #1a1a1a;
  border-color: #2a2a2a;
  cursor: not-allowed;
  opacity: 0.6;
}

#date-value {
  font-weight: 600;
  color: #fff;
  min-width: 80px;
  font-size: 0.9rem;
}

#stats {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  padding: 10px;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  min-width: 120px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.stat-label {
  display: block;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat span:last-child {
  font-size: 1.2rem;
  font-weight: bold;
  color: #f0e6d2;
}

footer {
  margin-top: 15px;
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid #333;
  color: #a0a0a0;
  font-size: 0.8rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 40px;
  color: #a0a0a0;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #3a3a3a;
  border-top: 3px solid #1a4d8c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  #app {
    padding: 10px;
    margin: 5px auto;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  #controls {
    margin: 10px 0;
    padding: 10px;
  }
  
  #filters {
    justify-content: center;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  #animation-controls {
    flex-direction: column;
    gap: 10px;
    padding: 8px;
  }
  
  .speed-control,
  .date-control {
    width: 100%;
    justify-content: center;
  }
  
  #speed-slider,
  #date-slider {
    width: 120px;
  }
  
  #chart {
    height: 250px;
    padding-top: 5px;
  }
  
  #bars-container {
    gap: 1px;
  }
  
  .bar {
    min-width: 3px;
  }
  
  #stats {
    flex-direction: column;
    align-items: center;
  }
  
  .stat {
    width: 100%;
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  #filters {
    flex-direction: column;
    align-items: center;
  }
  
  .filter-group {
    width: 100%;
    max-width: 200px;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  #chart {
    height: 200px;
    padding-top: 5px;
  }
  
  #y-axis {
    width: 35px;
  }
  
  #bars-container {
    left: 45px;
    top: 5px;
  }
  
  #x-axis {
    left: 45px;
  }
  
  .population-icons {
    max-width: 80px !important;
  }
  
  .population-icon {
    width: 24px !important;
    height: 24px !important;
  }
  
  .bar-value {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
  
  #date-slider {
    width: 100px;
  }
  
  #date-value {
    min-width: 60px;
    font-size: 0.8rem;
  }
}

/* Ensure links are white in all states */
a, a:visited, a:hover, a:active, a:focus {
  color: #ffffff;
}

/* Notification styles */
/* .notification {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
} */ 