/* Enhanced simulator styling with more fun elements */
.simulator-container {
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: auto;
}

/* New grid layout for better organization */
.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  width: 100%;
  height: 100%;
  padding: 10px;
}

/* Mobile layout stacks grid vertically */
@media (max-width: 991px) {
  .simulator-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* Control panel styling */
.simulator-controls {
  padding: 15px;
  background: linear-gradient(to bottom, #1a1f29, #161b22);
  border-radius: 8px;
  border: 1px solid #30363d;
  height: 100%;
  overflow-y: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.simulator-controls h3 {
  color: #58a6ff;
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #30363d;
  padding-bottom: 10px;
}

.simulator-controls h4 {
  color: #58a6ff;
  font-size: 1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.simulator-controls h4 i {
  font-size: 0.9rem;
}

.beta-badge {
  background-color: #f0883e;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 5px;
}

.new-badge {
  background-color: #2ea043;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 5px;
}

/* Results container styling */
.results-container {
  padding: 15px;
  background: linear-gradient(to bottom, #1a1f29, #161b22);
  border-radius: 8px;
  border: 1px solid #30363d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: auto;
}

.control-group {
  margin-bottom: 20px;
  border-bottom: 1px solid #30363d;
  padding-bottom: 10px;
  position: relative;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 768px) {
  .control-row {
    grid-template-columns: 1fr;
  }
}

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

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

.form-control {
  width: 100%;
  padding: 8px 12px;
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #c9d1d9;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
  outline: none;
}

/* Enhanced range slider styling */
.form-control-range {
  width: 100%;
  background-color: transparent;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.form-control-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: #21262d;
}

.form-control-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  margin-top: -4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.form-control-range:focus {
  outline: none;
}

/* Colored sliders */
.success-range::-webkit-slider-thumb {
  background: #2ea043;
}

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

/* Enhanced button styling */
.btn-primary {
  background: linear-gradient(to bottom, #238636, #1c6c2c);
  border: 1px solid rgba(240,246,252,0.1);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary:disabled {
  background-color: #606060;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.running {
  animation: pulse 1s infinite;
}

.retry-btn {
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

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

/* Result content styling */
.result-plot {
  max-width: 100%;
  height: auto;
  border: 1px solid #30363d;
  border-radius: 6px;
  transition: opacity 0.5s;
}

.results-tabs {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #30363d;
  width: 100%;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #8b949e;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: #c9d1d9;
  background-color: rgba(88, 166, 255, 0.1);
}

.tab-btn.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.tab-content {
  width: 100%;
  height: 100%;
}

/* Spinner animation */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(88, 166, 255, 0.2);
  border-radius: 50%;
  border-top-color: #58a6ff;
  animation: spin 1s linear infinite;
}

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

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.pulse-animation {
  animation: pulse 1s infinite;
}

.fade-out {
  animation: fadeOut 0.5s forwards;
}

.fade-in {
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* State summary styling */
.state-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 10px;
}

.state-card {
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
  width: 120px;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.state-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.state-value {
  font-size: 24px;
  font-weight: bold;
  margin: 5px 0;
}

.state-label {
  color: #c9d1d9;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}

.state-desc {
  color: #8b949e;
  font-size: 10px;
}

/* Score display styling */
.score-container {
  margin-bottom: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.score-card {
  background: linear-gradient(to bottom, #1a1f29, #161b22);
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 15px 25px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s;
}

.score-card:hover {
  transform: scale(1.05);
}

.score-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { left: -50%; }
  100% { left: 150%; }
}

.score-value {
  font-size: 48px;
  font-weight: bold;
  margin: 5px 0;
}

.great-score .score-value {
  color: #2ea043;
}

.ok-score .score-value {
  color: #f0883e;
}

.poor-score .score-value {
  color: #e74c3c;
}

.score-label {
  font-size: 12px;
  color: #8b949e;
  letter-spacing: 2px;
}

.score-message {
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
}

/* Message display styling */
.empty-results-message {
  color: #8b949e;
  font-style: italic;
  text-align: center;
  padding: 20px;
  background-color: rgba(13, 17, 23, 0.5);
  border-radius: 8px;
  border: 1px dashed #30363d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-results-message p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-results-message i {
  font-size: 1.2em;
}

.error-message {
  color: #ff7b72;
  font-style: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hide empty results message when showing results */
#results:not([style*="display: none"]) + .empty-results-message {
  display: none;
}

/* Tooltip styling */
.tooltip-icon {
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.tooltip-icon:hover {
  opacity: 1;
}

/* Simulation Card Specific Styling */
.player-simulator-interface {
  padding: 0 !important;
  height: 100% !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.sim-container {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  overflow-y: auto !important;
  gap: 15px !important;
  padding: 15px !important;
  height: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sim-actions-section,
.sim-allocation-section {
  flex-shrink: 0 !important;
}

.sim-render-box {
  flex: 1 0 auto !important;
  min-height: 150px !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.render-container {
  flex: 1 !important;
  width: 100% !important;
  min-height: 150px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.sim-actions-footer {
  flex-shrink: 0 !important;
  margin-top: 5px !important;
  margin-bottom: 5px !important;
}

#player-sim-container,
#admin-sim-container {
  width: 100% !important;
  height: calc(100% - 60px) !important; /* Account for header */
  overflow: auto !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative !important;
}

#admin-sim-container .infodemiology-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  overflow: auto !important;
  padding: 15px !important;
  box-sizing: border-box !important;
}

.sim-actions-section h3,
.sim-allocation-section h3,
.sim-render-box h3 {
  color: #58a6ff;
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.sim-actions-section h3 i,
.sim-allocation-section h3 i,
.sim-render-box h3 i {
  margin-right: 8px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-action {
  background: #1f6feb;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
  margin-bottom: 8px;
  margin-right: 8px;
}

.btn-action:hover {
  background: #388bfd;
}

.btn-action i {
  margin-right: 8px;
  font-size: 1.1em;
}

/* Sliders Section */
.sim-allocation-section {
  margin-bottom: 15px;
}

.slider-container {
  margin-bottom: 15px;
}

.slider-container label {
  display: block;
  margin-bottom: 8px;
  color: #c9d1d9;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.slider-container label i {
  margin-right: 8px;
  font-size: 1.1em;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.styled-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: #21262d;
}

.healthcare-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f85149;
  cursor: pointer;
  border: 2px solid white;
}

.information-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3fb950;
  cursor: pointer;
  border: 2px solid white;
}

.research-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  border: 2px solid white;
}

.slider-value {
  min-width: 40px;
  text-align: right;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

/* Simulation Render Box */
.sim-render-box {
  flex: 1;
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.render-container {
  flex: 1;
  width: 100%;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #21262d;
  border-radius: 4px;
  color: #8b949e;
  font-size: 0.9rem;
}

/* Action Footer */
.sim-actions-footer {
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.apply-strategy-btn {
  background: #238636;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.apply-strategy-btn:hover {
  background: #2ea043;
}

.apply-strategy-btn i {
  margin-right: 8px;
}

/* Fixed simulator containers to prevent overflow */
#player-sim-container,
#admin-sim-container {
  width: 100% !important;
  height: calc(100% - 60px) !important; /* Account for header */
  overflow: auto !important;
  box-sizing: border-box !important;
  padding: 10px !important;
  position: relative !important;
}

/* Fixed container styling for admin interface */
#admin-sim-container .infodemiology-container {
  width: 100% !important;
  height: auto !important; 
  min-height: 100% !important;
  overflow: visible !important;
}

#admin-sim-container .info-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

#admin-sim-container .info-panel {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
  box-sizing: border-box;
}

#admin-sim-container .graph-container {
  height: 250px !important;
  max-height: 250px !important;
  overflow: hidden !important;
  margin-bottom: 15px !important;
}

.player-simulator-interface {
  padding: 0;
  height: auto;
  overflow: visible;
}

.sim-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-action {
    width: 100%;
  }
}

/* Firefox slider support */
.styled-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

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

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

.research-slider::-moz-range-thumb {
  background: #58a6ff;
}

/* Progress bar track colors */
.healthcare-slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #f85149 0%, #f85149 35%, #21262d 35%, #21262d 100%);
  height: 8px;
  border-radius: 4px;
}

.information-slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #3fb950 0%, #3fb950 25%, #21262d 25%, #21262d 100%);
  height: 8px;
  border-radius: 4px;
}

.research-slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #58a6ff 0%, #58a6ff 40%, #21262d 40%, #21262d 100%);
  height: 8px;
  border-radius: 4px;
}
