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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  overflow: hidden;
  background: #000;
  color: #fff;
}

#container {
  display: flex;
  height: 100vh;
}

#stats-panel {
  width: 320px;
  min-width: 320px;
  background: rgba(20, 20, 30, 0.95);
  padding: 30px;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
  z-index: 10;
  flex-shrink: 0; /* Prevent shrinking */
}

#stats-panel h1 {
  font-size: 24px;
  margin-bottom: 30px;
  color: #fff;
}

#stats-panel h3 {
  font-size: 16px;
  margin-top: 25px;
  margin-bottom: 15px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-item {
  margin-bottom: 25px;
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: bold;
  color: #0078ff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #999;
}

#continent-stats {
  margin-bottom: 20px;
}

.continent-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 14px;
}

.continent-item span:last-child {
  font-weight: bold;
  color: #0078ff;
}

.legend {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#admin-link {
  display: block;
  margin-top: 30px;
  padding: 10px;
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
}

#admin-link:hover {
  background: rgba(255, 215, 0, 0.3);
}

#globe-container {
  flex: 1;
  position: relative;
  background: #000;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#globeViz {
  height: 100%;
}

#globeViz canvas {
  display: block;
  margin: 0 auto;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #fff;
}

/* Custom Scrollbar for Stats Panel */
#stats-panel::-webkit-scrollbar {
  width: 8px;
}

#stats-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

#stats-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 120, 255, 0.6);
  border-radius: 4px;
}

#stats-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 120, 255, 0.8);
}

/* Firefox scrollbar */
#stats-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 120, 255, 0.6) rgba(0, 0, 0, 0.3);
}


/* Responsive */
@media (max-width: 768px) {
  #container {
    flex-direction: column;
  }

  #stats-panel {
    width: 100%;
    height: auto;
    max-height: 40vh;
  }

  #globe-container {
    height: 60vh;
  }
}
