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

:root {
  --bg-color: #0a0a0a;
  --panel-bg: rgba(20, 20, 30, 0.95);
  --text-color: #cfe1f5;
  --accent-color: #b4b6b7ad;
  --secondary-color: #bae0e3;
  --border-color: rgba(255, 255, 255, 0.15);
  --hover-color: rgba(255, 107, 53, 0);
  --solar-gradient: linear-gradient(135deg, #ff6b35, #ffa500, #ffdd00);
}

[data-theme="light"] {
  --bg-color: #ffffffa2;
  --panel-bg: rgba(255, 255, 255, 0.627);
  --text-color: #83c9ef;
  --accent-color: #9ed5de;
  --secondary-color: #92c3d1f2;
  --border-color: rgb(0, 0, 0);
  --hover-color: rgba(230, 81, 0, 0.1);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  transition: all 0.3s ease;
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.loading-content {
  text-align: center;
  color: white;
}

.solar-loader {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#solar-system-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.header {
  position: absolute;
  top: 20px;
  left: 28px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.header h1 {
  font-size: 2rem;
  font-weight: 300;
  background: var(--solar-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-controls {
  display: flex;
  gap: 10px;
}

.control-panel {
  position: absolute;
  top: 100px;
  left: 16px;
  width: 240px;
  max-height: 68vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 20px;
  backdrop-filter: blur(15px);
  pointer-events: auto;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgb(0, 0, 0);
}

.control-panel h3 {
  margin-bottom: 15px;
  color: var(--accent-color);
  font-weight: 500;
  font-size: 1.1rem;
}

.planet-control {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.planet-control:hover {
  background: var(--hover-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.planet-control label {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.planet-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.speed-info {
  margin-bottom: 6px;
}

.real-speed {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 500;
}

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

.speed-slider {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px var(--accent-color);
}

.speed-value {
  min-width: 35px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 600;
}

.info-panel {
  position: absolute;
  top: 100px;
  right: 20px;
  width: 280px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(15px);
  pointer-events: auto;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.info-panel h3 {
  margin-bottom: 15px;
  color: var(--accent-color);
  font-weight: 500;
  font-size: 1.1rem;
}

.info-panel h4 {
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.camera-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 15px;
  backdrop-filter: blur(15px);
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.camera-controls h4 {
  margin-bottom: 10px;
  color: var(--accent-color);
  font-size: 0.9rem;
}

.control-btn {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  backdrop-filter: blur(15px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
  background: var(--hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: var(--accent-color);
}

.control-btn.small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.tooltip {
  position: absolute;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 15px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  backdrop-filter: blur(15px);
  z-index: 200;
  max-width: 200px;
  font-size: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.5rem;
  }
  
  .control-panel,
  .info-panel {
    width: calc(100vw - 40px);
    max-width: 280px;
  }
  
  .control-panel {
    max-height: 45vh;
  }
  
  .header-controls {
    gap: 5px;
  }
  
  .control-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .control-panel {
    top: 140px;
    left: 10px;
    right: 10px;
    width: auto;
  }
  
  .info-panel {
    top: 140px;
    right: 10px;
    left: 10px;
    width: auto;
    margin-top: 20px;
  }
}

/* Custom scrollbar */
.control-panel::-webkit-scrollbar {
  width: 4px;
}

.control-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.control-panel::-webkit-scrollbar-thumb {
  border-radius: 2px;
}


.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Solar system specific enhancements */
.planet-control {
  border-left: 3px solid transparent;
}

.planet-control:hover {
  border-left-color: var(--accent-color);
}

/* Animation for UI elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.control-panel,
.info-panel,
.camera-controls {
  animation: fadeInUp 0.6s ease-out;
}