/* CSS for RCM Viewer */

/* Main container layout */
.simulator-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #c9d1d9;
  background-color: #0d1117;
  border-radius: 6px;
  overflow: hidden;
}

.simulator-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 10px;
  height: 100%;
  min-height: 600px;
}

/* Controls panel */
.simulator-controls {
  background-color: #161b22;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  height: 100%;
}

.simulator-controls h3 {
  margin-top: 0;
  color: #c9d1d9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-badge {
  font-size: 0.6em;
  background-color: #238636;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
}

/* Tab navigation */
.tab-navigation {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
  border-bottom: 1px solid #30363d;
}

.simulator-tab-btn {
  background: none;
  color: #8b949e;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s;
  border-radius: 6px 6px 0 0;
  margin-right: 2px;
  margin-bottom: -1px;
}

.simulator-tab-btn:hover {
  background-color: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
}

.simulator-tab-btn.active {
  background-color: #0d1117;
  color: #58a6ff;
  border: 1px solid #30363d;
  border-bottom: 1px solid #0d1117;
}

/* Form controls */
.control-group {
  margin-bottom: 15px;
}

.control-row {
  display: flex;
  margin-bottom: 10px;
  gap: 10px;
}

.form-group {
  flex: 1;
  margin-bottom: 8px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #8b949e;
  font-size: 0.85rem;
}

.form-control {
  width: 100%;
  padding: 6px 8px;
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #c9d1d9;
  font-size: 0.9rem;
}

.form-control:focus {
  border-color: #58a6ff;
  outline: none;
}

/* Range sliders */
.form-control-range {
  width: 100%;
  height: 8px;
  padding: 0;
  background: #30363d;
  border-radius: 4px;
  outline: none;
  transition: background 0.2s;
  -webkit-appearance: none;
}

.form-control-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
}

.form-control-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
}

.danger-range::-webkit-slider-thumb {
  background: #f85149;
}

.danger-range::-moz-range-thumb {
  background: #f85149;
}

.success-range::-webkit-slider-thumb {
  background: #3fb950;
}

.success-range::-moz-range-thumb {
  background: #3fb950;
}

.slider-value-container {
  font-size: 0.8rem;
  color: #8b949e;
  text-align: right;
  margin-top: 2px;
}

.danger-value {
  color: #f85149;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
  border: 1px solid;
}

.btn-primary {
  background-color: #238636;
  color: white;
  border-color: #238636;
}

.btn-primary:hover {
  background-color: #2ea043;
}

.btn-secondary {
  background-color: #21262d;
  color: #c9d1d9;
  border-color: #30363d;
}

.btn-secondary:hover {
  background-color: #30363d;
}

/* Divider */
.divider {
  height: 1px;
  background-color: #30363d;
  margin: 15px 0;
}

/* Simulation log */
.simulation-log {
  background-color: #0d1117;
  padding: 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  color: #8b949e;
  min-height: 50px;
  border: 1px solid #30363d;
  overflow-wrap: break-word;
}

/* Results container */
.results-container {
  position: relative;
  background-color: #0d1117;
  border-radius: 6px;
  padding: 15px;
  border: 1px solid #30363d;
  height: 100%;
  overflow-y: auto;
}

/* Loading indicator */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.spinner {
  border: 4px solid #161b22;
  border-top: 4px solid #58a6ff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Results tabs */
.results-tabs {
  display: flex;
  overflow-x: auto;
  margin-bottom: 15px;
  border-bottom: 1px solid #30363d;
}

.results-tab-btn {
  background: none;
  color: #8b949e;
  border: none;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.results-tab-btn:hover {
  color: #58a6ff;
}

.results-tab-btn.active {
  color: #58a6ff;
  border-bottom: 2px solid #58a6ff;
}

/* Results content */
.results-tab-content {
  display: none;
  height: calc(100% - 45px);
}

.results-tab-content.active {
  display: block;
}

.results-plot {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.results-table {
  width: 100%;
  height: 100%;
  overflow: auto;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #30363d;
}

th {
  background-color: #161b22;
}

tr:hover {
  background-color: #161b22;
}

/* Checkboxes and radio buttons */
.checkbox-label {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.toggle-input {
  margin-right: 8px;
}

.toggle-label {
  font-size: 0.9rem;
}

/* Loading message */
#rcm-loading-message {
  background-color: #21262d;
  color: #c9d1d9;
  border-color: #30363d;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .simulator-grid {
    grid-template-columns: 1fr;
  }
  
  .simulator-controls {
    max-height: 500px;
  }
}

@media (max-width: 576px) {
  .control-row {
    flex-direction: column;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
}
