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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a2e1a 0%, #1b2e4a 50%, #2d1b4e 100%);
  min-height: 100vh;
  color: #333;
  display: flex;
  flex-direction: column;
}

.app-container {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
}

/* Predictions bar */
.predictions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 800px) {
  .predictions-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.prediction-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.prediction-card.primary {
  background: rgba(39, 174, 96, 0.2);
  border-color: rgba(39, 174, 96, 0.4);
}

.pred-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pred-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.prediction-card.primary .pred-value {
  color: #6bff9e;
}

.pred-unit {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.15rem;
}

.main-content {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
}

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

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.params-section,
.molecules-section,
.equations-section,
.chart-section,
.explainer-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h3 .hint {
  font-size: 0.8rem;
  font-weight: normal;
  color: #888;
}

/* Parameters */
.param-group {
  margin-bottom: 1rem;
}

.param-group label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.param-name { color: #555; font-weight: 500; }

.param-value {
  font-weight: 600;
  color: #1a2e1a;
  min-width: 3rem;
  text-align: right;
}

.param-group input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
}

.param-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #27ae60;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #1a6b3f 0%, #27ae60 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
  background: #e9ecef;
  color: #495057;
}

.btn-secondary:hover {
  background: #dee2e6;
}

/* Molecule displays */
.mol-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mol-box {
  --fill-pct: 100%;
  text-align: center;
  padding: 0.75rem;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.mol-box::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--fill-pct);
  transition: height 0.1s linear;
  z-index: -1;
  border-radius: 10px;
}

.mol-box.substrate { background: rgba(214,234,248,0.3); }
.mol-box.substrate::before { background: linear-gradient(135deg, #d6eaf8 0%, #aed6f1 100%); }

.mol-box.enzyme { background: rgba(213,245,227,0.3); }
.mol-box.enzyme::before { background: linear-gradient(135deg, #d5f5e3 0%, #abebc6 100%); }

.mol-box.complex { background: rgba(254,245,231,0.3); }
.mol-box.complex::before { background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%); }

.mol-box.product { background: rgba(250,219,216,0.3); }
.mol-box.product::before { background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%); }

.mol-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
}

.mol-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  position: relative;
}

/* Equations */
.eq-display {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.9rem;
}

.equation {
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.eq-arrow {
  color: #27ae60;
  font-weight: bold;
  margin: 0 0.25rem;
}

.mm-params {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.mm-params strong {
  color: #e67e22;
}

/* Charts */
.chart-section {
  min-height: 350px;
}

.chart-container {
  height: 280px;
  position: relative;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* Explainer */
.explainer-content {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #555;
}

.explainer-content p { margin-bottom: 0.75rem; }
.explainer-content ul { margin: 0.75rem 0; padding-left: 1.5rem; }
.explainer-content li { margin-bottom: 0.5rem; }
.explainer-content strong { color: #333; }
