html, body, #cesiumContainer {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #000;
}

/* Header */
#header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(10, 20, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 20;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.site-logo {
  height: 36px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-main {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.brand-sub {
  color: #ccc;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1px;
  margin: 0;
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 6px 0;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #007FFF;
  transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.highlight-btn {
  background: linear-gradient(135deg, #FF7F00, #FF3300);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(255, 127, 0, 0.3);
}

.highlight-btn::after {
  display: none;
}

.highlight-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 127, 0, 0.5);
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: rgba(10, 20, 35, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: #e0e0e0;
}

/* Segmented Control for Tabs */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 500;
  color: #aaa;
  border-radius: 6px;
}

.tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tab.active {
  background: linear-gradient(135deg, #007FFF, #0055FF);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 127, 255, 0.4);
}

/* Top View Tabs Container (Full Width Bar aligned right) */
.top-tabs-container {
  position: absolute;
  top: 60px; /* Right below the 60px header */
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  height: 44px;
  background: transparent; /* Completely transparent in map view */
  backdrop-filter: none; /* Removed blur for true transparency */
  -webkit-backdrop-filter: none;
  border-bottom: none; /* Removed bottom border */
  display: flex;
  justify-content: flex-end; /* Align tabs to the right */
  align-items: center;
  transition: background 0.3s ease;
  padding-right: 40px; /* Padding from the right edge */
  box-sizing: border-box;
}

/* White background when chart view is active */
.top-tabs-container.theme-white {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.top-tabs {
  display: flex;
  height: 100%;
  gap: 10px; /* Small gap between tabs */
}

.top-tabs .tab {
  color: #ccc; /* Lighter text color for dark background */
  font-weight: 500;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  transition: all 0.3s ease;
  position: relative;
  background: transparent;
}

/* Tab text color change on hover/active based on theme */
.top-tabs-container:not(.theme-white) .tab:hover {
  color: #fff;
}

.top-tabs-container.theme-white .tab {
  color: #666;
}

.top-tabs-container.theme-white .tab:hover {
  color: #333;
}

.top-tabs .tab.active {
  color: #fff;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
}

.top-tabs-container.theme-white .tab.active {
  color: #007FFF;
}

/* Removed bottom line indicator for a cleaner look */

/* Left Sidebar Settings */
#sidebar {
  position: absolute;
  top: 150px;
  left: 20px;
  width: 300px;
  padding: 20px;
  z-index: 10;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  transform-origin: left center;
}

#sidebar.hidden {
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

#settingsToggle {
  position: absolute;
  top: 110px;
  left: 20px;
  padding: 10px 16px;
  z-index: 11;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

#settingsToggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Controls Styling */
.control-group {
  margin-bottom: 16px;
}

.control-group label {
  display: block;
  font-size: 12px;
  color: #aaa;
  margin-bottom: 6px;
}

select {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.3s;
}

select:hover, select:focus {
  border-color: #007FFF;
}

select option {
  background: #111;
  color: #fff;
}

#chartView select {
  color: #2c3e50;
  background: #fff;
}

#chartView select option {
  color: #2c3e50;
  background: #fff;
}

#cityRankView select,
#cityRankView input {
  color: #2c3e50;
  background: #fff;
}

#cityRankView select option {
  color: #2c3e50;
  background: #fff;
}

/* Custom Range Input */
.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  background: transparent;
  height: 4px;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #007FFF;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(0, 127, 255, 0.5);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-value {
  font-size: 13px;
  color: #007FFF;
  font-weight: bold;
  width: 36px;
  text-align: right;
}

/* Switch styling */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-label {
  font-size: 14px;
  color: #e0e0e0;
}

/* Legend */
#legend {
  position: absolute;
  bottom: 30px;
  right: 30px;
  padding: 20px;
  width: 200px;
  pointer-events: none;
  z-index: 10;
}

.legend-title {
  font-weight: 500;
  margin-bottom: 12px;
  text-align: left;
  font-size: 14px;
  color: #fff;
}

.legend-gradient {
  height: 8px;
  width: 100%;
  background: linear-gradient(to right, #000083, #003caa, #05ffff, #ffff00, #fa0000, #800000);
  border-radius: 4px;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #aaa;
}

/* Tooltip */
#tooltip {
  display: none;
  position: absolute;
  background: rgba(10, 20, 35, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 1000;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transform: translate(15px, 15px); /* Offset from cursor */
}

/* Override Cesium Default Styles */
.cesium-viewer-bottom {
  display: none !important; /* Hide logo/credits */
}
.cesium-button {
  background-color: rgba(10, 20, 35, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
.cesium-button:hover {
  background-color: rgba(0, 127, 255, 0.8) !important;
  border-color: rgba(0, 127, 255, 1) !important;
}
