/**
 * Reaktionskinetik Simulator Styles
 * WCAG 2.1 AA Compliant - Optimized for accessibility
 */

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

.calculator-panel {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid #e0e0e0;
}

.calculator-panel h2 {
  color: #1a1a1a;
  margin-bottom: 15px;
}

.simulation-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.simulation-canvas {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.simulation-canvas canvas {
  border: 2px solid #8b95a3;
  border-radius: 8px;
  background: #000;
  max-width: 100%;
  height: auto;
}

.simulation-controls {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
}

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

.control-group label {
  font-weight: 600;
  color: #1a1a1a;
  display: block;
  margin-bottom: 8px;
}

.control-group input[type='range'] {
  width: 100%;
  height: 35px;
  background: #f8f9fa;
  border: 2px solid #8b95a3;
  border-radius: 5px;
  cursor: pointer;
}

.control-group input[type='range']:focus {
  outline: 3px solid #ffc107;
  outline-offset: 2px;
}

.control-group input[type='number'] {
  width: 100%;
  padding: 10px;
  border: 2px solid #8b95a3;
  border-radius: 5px;
  font-size: 14px;
  background: white;
  color: #1a1a1a;
}

.control-group input[type='number']:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}

.control-group button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border-radius: 5px;
  border: none;
}

.kinetics-info {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  margin-top: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  font-weight: 600;
  color: #1a1a1a;
}

.info-row .value {
  font-size: 1.3em;
  color: #1565c0;
  font-weight: 700;
}

.info-row .value.highlight {
  color: #e74c3c;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.85em;
  text-transform: uppercase;
}

.badge {
  background: #28a745;
  color: white;
}

.collision-stats {
  margin-top: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.stat-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  text-align: center;
}

.stat-card h5 {
  color: #1565c0;
  margin-bottom: 10px;
  font-size: 14px;
}

.stat-card .value {
  font-size: 2em;
  font-weight: 700;
  color: #1565c0;
  display: block;
}

.stat-card .value.large {
  font-size: 2.5em;
  color: #e74c3c;
}

.formula-box {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  margin: 20px 0;
}

.formula-box p {
  margin: 10px 0;
  color: #1a1a1a;
}

.formula-text {
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  font-weight: bold;
  color: #1565c0;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  display: inline-block;
  border: 2px solid #1565c0;
  margin: 10px 0;
}

.formula-explanation {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #e0e0e0;
}

.formula-explanation p {
  margin: 8px 0;
  color: #1a1a1a;
}

.formula-explanation strong {
  color: #1565c0;
}

.input-section {
  margin: 20px 0;
}

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

.form-group label {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 5px;
  display: block;
}

.form-control {
  padding: 10px;
  border: 2px solid #8b95a3;
  border-radius: 5px;
  font-size: 16px;
  color: #1a1a1a;
  background: white;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}

.temp-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.temp-range-inputs div {
  margin-bottom: 10px;
}

.temp-range-inputs label {
  font-weight: 600;
  color: #1a1a1a;
  display: block;
  margin-bottom: 5px;
}

.btn {
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border-radius: 5px;
  border: none;
}

.btn-primary {
  background: #1565c0;
  color: #ffffff;
}

.btn-primary:hover {
  background: #0d47a1;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:focus-visible {
  outline: 3px solid #ffc107;
  outline-offset: 2px;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 18px;
}

.btn-block {
  width: 100%;
  display: block;
}

.plot-container {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  margin-top: 20px;
}

.plot-container h3 {
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 15px;
}

.plot-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.plot-wrapper canvas {
  border: 2px solid #8b95a3;
  border-radius: 8px;
  background: white;
  max-width: 100%;
}

.plot-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-line {
  width: 30px;
  height: 4px;
  border-radius: 2px;
}

.legend-item span {
  font-weight: 600;
  color: #1a1a1a;
}

.arrhenius-results {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  margin-top: 20px;
}

.result-box {
  text-align: center;
  padding: 20px;
}

.result-box h4 {
  color: #1565c0;
  margin-bottom: 15px;
}

.calculation-summary {
  margin: 20px 0;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
}

.calc-row:last-child {
  margin-bottom: 0;
}

.calc-row .label {
  font-weight: 600;
  color: #1a1a1a;
}

.calc-row span {
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.educational-content {
  margin: 40px 0;
}

.educational-content h2 {
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 30px;
}

.info-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 5px solid #2e7d32;
  border: 2px solid #e0e0e0;
  height: 100%;
}

.info-card h3 {
  color: #2e7d32;
  margin-bottom: 15px;
}

.info-card h4,
.info-card h5 {
  color: #1565c0;
  margin-top: 0;
  margin-bottom: 10px;
}

.info-card p {
  margin: 10px 0;
  color: #1a1a1a;
  line-height: 1.6;
}

.info-card ul,
.info-card ol {
  margin: 15px 0;
  padding-left: 20px;
  line-height: 1.6;
}

.info-card li {
  margin: 8px 0;
  color: #1a1a1a;
}

.info-card .formula-text {
  font-size: 1em;
  margin: 15px 0;
  background: #e3f2fd;
  border-color: #90caf9;
}

.arrhenius-examples {
  margin: 20px 0;
}

.arrhenius-examples h5 {
  color: #1565c0;
  margin-bottom: 10px;
}

.arrhenius-examples ul {
  margin: 10px 0;
  padding-left: 20px;
  line-height: 1.6;
}

.arrhenius-examples li {
  margin: 8px 0;
}

.example {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  border: 2px solid #e0e0e0;
}

.example h5 {
  color: #1565c0;
  margin-bottom: 10px;
}

.example p {
  margin: 8px 0;
  color: #1a1a1a;
}

.example .text-success {
  color: #28a745;
  font-weight: 600;
}

.rule-of-thumb {
  background: #fff3cd;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 5px solid #ffc107;
  border: 2px solid #ffe082;
}

.rule-of-thumb h4 {
  color: #856404;
  margin-bottom: 10px;
}

.sub {
  vertical-align: sub;
  font-size: 0.7em;
}

.sup {
  vertical-align: super;
  font-size: 0.7em;
}

@media (max-width: 768px) {
  .reaktionskinetik-container {
    padding: 10px;
  }

  .calculator-panel,
  .info-card {
    padding: 15px;
  }

  .simulation-container {
    grid-template-columns: 1fr;
  }

  .plot-wrapper {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .temp-range-inputs {
    grid-template-columns: 1fr;
  }

  .plot-legend {
    flex-direction: column;
  }
}

@media (prefers-color-scheme: dark) {
  .reaktionskinetik-container {
    color: #e0e0e0;
  }

  .calculator-panel,
  .info-card {
    background: #1a1a1a;
    border-color: #404040;
  }

  .calculator-panel h2,
  .educational-content h2 {
    color: #e0e0e0;
  }

  .form-group label {
    color: #e0e0e0;
  }

  .form-control {
    background: #2c2c2c;
    color: #e0e0e0;
    border-color: #555;
  }

  .simulation-canvas,
  .simulation-controls,
  .plot-container,
  .result-box,
  .example {
    background: #1a1a1a;
    border-color: #404040;
  }

  .simulation-canvas canvas {
    border-color: #555;
    background: #000;
  }

  .control-group input[type='range'] {
    background: #2c2c2c;
    border-color: #555;
  }

  .control-group button {
    color: white;
  }

  .info-row .label {
    color: #c0c0c0;
  }

  .info-row .value {
    color: #64b5f6;
  }

  .info-row .value.highlight {
    color: #ff6b6b;
  }

  .stat-card {
    background: #1a1a1a;
    border-color: #404040;
  }

  .stat-card h5 {
    color: #64b5f6;
  }

  .stat-card .value {
    color: #64b5f6;
  }

  .stat-card .value.large {
    color: #ff6b6b;
  }

  .formula-text {
    background: #2c2c2c;
    color: #64b5f6;
    border-color: #0d47a1;
  }

  .calculation-summary .calc-row {
    background: #2c2c2c;
    border-color: #404040;
  }

  .result-box h4 {
    color: #64b5f6;
  }

  .plot-wrapper canvas {
    border-color: #555;
    background: #1a1a1a;
  }

  .badge {
    background: #1a3c5e;
  }

  .arrhenius-results .result-box {
    background: #1a1a1a;
    border-color: #404040;
  }

  .example {
    background: #1a1a1a;
    border-color: #404040;
  }

  .example h5 {
    color: #64b5f6;
  }

  .rule-of-thumb {
    background: #1a3c5e;
    border-color: #0d47a1;
  }

  .rule-of-thumb h4 {
    color: #ffc107;
  }

  .example .text-success {
    color: #90caf9;
  }
}
