/* ============================================================
   simulator.css -- Shared styles for all SimulatorEngine simulators
   Dark theme, glass panels, gradient accents, glowing effects
   ============================================================ */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e1b4b;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
}

* {
  font-family: 'Outfit', sans-serif;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Glass panel effect */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Custom range slider */
.control-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
  outline: none;
  cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #a855f7);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(129, 140, 248, 0.5);
  transition: transform 0.2s;
}

.control-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.control-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #a855f7);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(129, 140, 248, 0.5);
}

.slider-group {
  margin-bottom: 1rem;
}

/* Primary and secondary buttons */
.btn-primary,
.btn-secondary {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  color: white;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gradient);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #818cf8, #a855f7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
  border-color: rgba(129, 140, 248, 0.5);
}

/* Preset buttons */
.preset-btn {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset-btn:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.3));
  transform: translateY(-1px);
}

/* Language buttons */
.lang-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lang-btn.active {
  background: var(--accent-gradient);
  color: white;
}

/* Data value display */
.data-value {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

/* Graph containers */
.graph-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Canvas container glow animation */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.5); }
}

.canvas-container {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Panel scroll limits */
.controls-panel,
.data-panel {
  max-height: 700px;
}

/* Checkbox accent color */
.accent-indigo-500 {
  accent-color: #6366f1;
}

/* Responsive adjustments */
@media (max-width: 1023px) {
  .controls-panel,
  .data-panel {
    max-height: none;
  }
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

/* ============================================================
   LIGHT MODE — Overrides for .theme-light on <html>
   ============================================================ */
.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #e2e8f0;
  --accent-primary: #4f46e5;
  --accent-secondary: #7c3aed;
  --accent-gradient: linear-gradient(135deg, #4f46e5, #7c3aed);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
}

.theme-light body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%) !important;
}

.theme-light .glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.theme-light .control-slider {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.2), rgba(124, 58, 237, 0.2));
}

.theme-light .btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.theme-light .btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

.theme-light .btn-secondary.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(124, 58, 237, 0.15));
  border-color: rgba(79, 70, 229, 0.3);
}

.theme-light .preset-btn {
  color: var(--text-primary);
  border-color: rgba(34, 197, 94, 0.4);
}

.theme-light .lang-btn {
  color: var(--text-secondary);
}

.theme-light .lang-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.theme-light .data-value {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-light .graph-container {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-light ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
}

.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.3);
}

.theme-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 70, 229, 0.5);
}

.theme-light .mono {
  color: var(--text-primary) !important;
}

.theme-light #simSubtitle {
  color: var(--text-secondary) !important;
}

.theme-light .text-white\/60 {
  color: var(--text-secondary) !important;
}

.theme-light .text-white\/80 {
  color: var(--text-primary) !important;
}

.theme-light .text-white\/50 {
  color: var(--text-muted) !important;
}

.theme-light .canvas-container {
  animation: none;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}
