/* Ultra-Modern White Theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  overflow: hidden;
  height: 100vh;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px 0;
}

.header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  font-size: 1rem;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.viewer-section, .controls-section {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.viewer-section {
  padding: 0;
  position: relative;
}

.controls-section {
  padding: 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.controls-section::-webkit-scrollbar {
  width: 6px;
}

.controls-section::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.controls-section::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.controls-section::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1f2937;
  letter-spacing: 0.3px;
}

#viewer {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  position: relative;
  border: 1px solid #e2e8f0;
}

.joint-control {
  margin-bottom: 20px;
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.joint-control:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.joint-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
  letter-spacing: 0.2px;
}

.joint-value {
  color: #3b82f6;
  font-weight: 700;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider:hover {
  background: #d1d5db;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-weight: 500;
}

.info-panel {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.info-panel h4 {
  margin: 0 0 12px;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.info-panel p {
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.preset-btn {
  padding: 8px 14px;
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  color: #374151;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #6b7280;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

/* Responsive */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: 55vh 1fr;
    gap: 16px;
  }
  
  .controls-section {
    overflow-y: auto;
  }
  
  .header {
    margin-bottom: 16px;
    padding: 12px 0;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  
  .main-content {
    gap: 12px;
    grid-template-rows: 50vh 1fr;
  }
  
  .header {
    margin-bottom: 12px;
    padding: 8px 0;
  }
  
  .back-btn {
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .joint-control {
    margin-bottom: 16px;
    padding: 12px;
  }
  
  .controls-section {
    padding: 16px;
  }
}
