/**
 * Monte Carlo Simulator Styles
 * 
 * Styles for the Monte Carlo simulation explorable module.
 */

.monte-carlo-simulator {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.monte-carlo-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #1A202C 0%, #2D3748 100%);
  color: #fff;
  border-radius: 0.5rem 0.5rem 0 0;
}

.monte-carlo-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 600;
}

.monte-carlo-description {
  margin: 0;
  color: #A0AEC0;
  line-height: 1.6;
}

.monte-carlo-body {
  padding: 1.5rem;
}

/* Panels */
.monte-carlo-panel {
  margin-bottom: 2rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  background: #fff;
}

.monte-carlo-panel h3 {
  margin: 0;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
  font-size: 1.25rem;
  font-weight: 600;
}

.monte-carlo-panel-content {
  padding: 1.5rem;
}

/* Toggle buttons */
.monte-carlo-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.monte-carlo-toggle:hover {
  opacity: 0.8;
}

.monte-carlo-toggle-icon {
  display: inline-block;
  width: 1rem;
  transition: transform 0.2s ease;
}

/* Status badge (shown in the Simulation Results header) */
.monte-carlo-status-badge {
  margin-left: auto;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.monte-carlo-status-badge--ready {
  background: #f8f9fa;
  border-color: #ced4da;
  color: #495057;
}

.monte-carlo-status-badge--running {
  background: #e7f3ff;
  border-color: #b8daff;
  color: #004085;
}

.monte-carlo-status-badge--complete {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.monte-carlo-status-badge--error {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Variables Panel */
.monte-carlo-variables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.monte-carlo-variable {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.monte-carlo-variable-label {
  font-weight: 600;
  color: #1A202C;
}

.monte-carlo-variable-inputs {
  display: flex;
  gap: 1rem;
}

.monte-carlo-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.monte-carlo-input-group label {
  font-size: 0.875rem;
  color: #6c757d;
}

.monte-carlo-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.15s ease;
}

.monte-carlo-input:focus {
  outline: none;
  border-color: #4A90E2;
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* Actions */
.monte-carlo-actions {
  padding: 1.5rem;
  border-top: 1px solid #e5e5e5;
  display: flex;
  gap: 1rem;
}

.monte-carlo-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.monte-carlo-btn--primary {
  background: #4A90E2;
  color: #fff;
}

.monte-carlo-btn--primary:hover:not(:disabled) {
  background: #357ABD;
}

.monte-carlo-btn--primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.monte-carlo-btn--secondary {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #ced4da;
}

.monte-carlo-btn--secondary:hover {
  background: #e9ecef;
}

/* Status and Results */
.monte-carlo-status {
  padding: 1rem;
  background: #e7f3ff;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

.monte-carlo-status p {
  margin: 0;
  color: #004085;
}

.monte-carlo-status .error {
  color: #721c24;
  background: #f8d7da;
  padding: 0.75rem;
  border-radius: 0.375rem;
}

/* Statistics */
.monte-carlo-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 0.375rem;
}

.monte-carlo-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.monte-carlo-stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.monte-carlo-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1A202C;
}

/* Results Table */
.monte-carlo-table-wrapper {
  overflow-x: auto;
  border-radius: 0.375rem;
  border: 1px solid #e5e5e5;
}

.monte-carlo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.monte-carlo-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #e5e5e5;
}

.monte-carlo-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #1A202C;
}

.monte-carlo-table tbody tr {
  border-bottom: 1px solid #e5e5e5;
}

.monte-carlo-table tbody tr:last-child {
  border-bottom: none;
}

.monte-carlo-table td {
  padding: 0.75rem 1rem;
  color: #495057;
}

.monte-carlo-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

/* Histogram */
.monte-carlo-histogram-container {
  padding: 1.5rem;
  background: #fff;
  border-radius: 0.375rem;
}

.monte-carlo-histogram-placeholder {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
  background: #f8f9fa;
  border-radius: 0.375rem;
  border: 2px dashed #e5e5e5;
}

.monte-carlo-histogram {
  width: 100%;
  height: auto;
}

.monte-carlo-histogram-bar {
  fill: #4A90E2;
  stroke: none;
  transition: fill 0.2s ease;
}

.monte-carlo-histogram-bar:hover {
  fill: #357ABD;
}

.monte-carlo-axis-label {
  font-size: 12px;
  fill: #495057;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .monte-carlo-header {
    padding: 1rem;
  }

  .monte-carlo-header h2 {
    font-size: 1.5rem;
  }

  .monte-carlo-body {
    padding: 1rem;
  }

  .monte-carlo-variables {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .monte-carlo-actions {
    flex-direction: column;
  }

  .monte-carlo-btn {
    width: 100%;
  }

  .monte-carlo-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .monte-carlo-table {
    font-size: 0.75rem;
  }

  .monte-carlo-table th,
  .monte-carlo-table td {
    padding: 0.5rem;
  }
}
