:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #111820;
  --bg-panel: #1a1f2e;
  --text-primary: #e7eef7;
  --text-secondary: #8b95a8;
  --text-muted: #5a6272;
  --text-accent: #00f2ff;
  --border: rgba(255, 255, 255, 0.1);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --accent: #00f2ff;
  --accent-glow: rgba(0, 242, 255, 0.3);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
.site-nav {
  background: rgba(17, 24, 32, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
}

.nav-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  text-transform: uppercase;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Globe Container */
#globe-container {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000;
  z-index: 1;
}

/* Controls Bar */
.controls-bar {
  position: fixed;
  top: 72px;
  right: 340px;
  z-index: 100;
  display: flex;
  gap: 16px;
  background: var(--bg-panel);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.control-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: white;
}

/* Side Panels */
.side-panel {
  position: fixed;
  top: 56px;
  width: 320px;
  height: calc(100vh - 56px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.left-panel {
  left: 0;
  border-left: none;
  border-top: none;
}

.right-panel {
  right: 0;
  border-right: none;
  border-top: none;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.panel-header h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 1.5px;
  margin: 0;
  text-transform: uppercase;
}

/* Search Container */
.search-container {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

#data-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.2s;
  font-family: inherit;
}

#data-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

#data-search::placeholder {
  color: var(--text-muted);
}

/* Folder System */
.folder-system {
  padding: 8px;
}

/* Dataset items styling */
.folder-system > div,
.folder-system button,
.folder-system a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  text-align: left;
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.folder-system > div:hover,
.folder-system button:hover,
.folder-system a:hover {
  background: var(--hover-bg);
  border-color: var(--accent);
  color: var(--text-accent);
  transform: translateX(4px);
}

.folder-system > div.active,
.folder-system button.active,
.folder-system a.active {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--accent);
  color: var(--text-accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Nested folders */
.folder-system .folder-children {
  padding-left: 12px;
  margin-top: 4px;
}

.folder-system .folder-header {
  font-weight: 600;
  color: var(--text-accent);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  padding: 8px 12px;
  margin-top: 12px;
  margin-bottom: 4px;
}

.folder-system .folder-header:first-child {
  margin-top: 0;
}

/* Data Sections */
.data-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.data-section:last-child {
  border-bottom: none;
}

.data-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-accent);
  margin-bottom: 6px;
}

.data-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.data-value.secondary {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.data-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 20px;
}

/* Time Controls */
#time-controls {
  padding: 16px 20px;
}

.time-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.time-header .data-label {
  margin-bottom: 0;
}

#time-play-btn {
  background: var(--accent);
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--bg-primary);
  transition: all 0.2s;
  box-shadow: 0 0 10px var(--accent-glow);
}

#time-play-btn:hover:not(:disabled) {
  background: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--accent-glow);
}

#time-play-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  opacity: 0.4;
  box-shadow: none;
}

#time-year-label {
  margin-bottom: 10px;
}

#time-slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: all 0.2s;
}

#time-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px var(--accent-glow);
}

#time-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: all 0.2s;
}

#time-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px var(--accent-glow);
}

#time-slider:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Scrollbar Styling */
.side-panel::-webkit-scrollbar {
  width: 6px;
}

.side-panel::-webkit-scrollbar-track {
  background: transparent;
}

.side-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.side-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Responsive */
@media (max-width: 1200px) {
  .side-panel {
    width: 280px;
  }
  
  .controls-bar {
    right: 300px;
  }
}

@media (max-width: 768px) {
  .nav-wrap {
    padding: 0 16px;
  }

  .nav-title {
    font-size: 0.875rem;
  }

  .side-panel {
    width: 100%;
    max-width: 300px;
  }

  .controls-bar {
    top: 64px;
    right: 16px;
  }
}