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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

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

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, #00d4ff, #ff00ff, #00ff88);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header p {
  font-size: 1.1rem;
  color: #a0a0a0;
  margin-top: 10px;
}

.main-content {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 30px;
  height: calc(100vh - 200px);
}

.controls-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

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

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

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

.control-section {
  margin-bottom: 30px;
}

.control-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #00d4ff;
}

.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #e0e0e0;
}

.select-input {
  appearance: base-select;
  width: 100%;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.select-input::picker-icon {
  color: #999;
  rotate: 0deg;
  transition: 0.4s rotate;
}

.select-input:open::picker-icon {
  rotate: 240deg;
}

.select-input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

option {
  display: flex;
  justify-content: flex-start;
  gap: 2px;
  border: 2px solid #ddd;
  background: #eee;
  padding: 10px;
  transition: 0.4s;
}

.slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  transition: all 0.3s ease;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(45deg, #00d4ff, #ff00ff);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
  transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.5);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(45deg, #00d4ff, #ff00ff);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #a0a0a0;
  margin-top: 5px;
}

.color-scheme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.color-btn {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.color-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.color-btn.active {
  background: linear-gradient(45deg, #00d4ff, #ff00ff);
  border-color: transparent;
}

.checkbox-group {
  margin-bottom: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  margin-right: 10px;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(45deg, #00d4ff, #ff00ff);
  border-color: transparent;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-btn {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  transform: translateY(-2px);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn.primary {
  background: linear-gradient(45deg, #00d4ff, #ff00ff);
  color: #ffffff;
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Mathematical Details Styling */
.math-details {
  font-size: 0.85rem;
  line-height: 1.4;
}

.math-section {
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid #00d4ff;
}

.math-section h4 {
  color: #00ff88;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.math-section p {
  color: #d0d0d0;
  margin-bottom: 4px;
}

.math-section strong {
  color: #ffffff;
}

.metrics-explanation {
  font-size: 0.85rem;
}

.metric-item {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.metric-item h4 {
  color: #ff00ff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-item p {
  color: #d0d0d0;
  line-height: 1.3;
}

.plot-container {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  overflow: hidden;
  min-height: 600px;
}

.plot {
  width: 100%;
  height: 100%;
  background: transparent;
  min-height: 600px;
}

.plot-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.stats-panel {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 15px;
  min-width: 200px;
}

.stats-panel h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #00d4ff;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.stat-item span:first-child {
  color: #a0a0a0;
}

.stat-item span:last-child {
  color: #ffffff;
  font-weight: 500;
}

.footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
  font-size: 0.9rem;
  color: #a0a0a0;
}

@media (max-width: 1400px) {
  .main-content {
    grid-template-columns: 380px 1fr;
  }
}

@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .controls-panel {
    max-height: 500px;
  }
  
  .plot-container {
    height: 700px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .controls-panel {
    padding: 20px;
  }
  
  .color-scheme-grid,
  .preset-buttons {
    grid-template-columns: 1fr;
  }

  .plot-overlay {
    position: static;
    margin-top: 20px;
  }
  
  .stats-panel {
    width: 100%;
  }
  
  .main-content {
    grid-template-columns: 1fr;
  }
}