:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --border-color: #475569;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Layout */
.container {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }
  .control-pane {
    display: none !important;
  }
}

/* Main Pane */
.main-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
}

/* Header */
.header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.title {
  font-size: 1.75rem;
  font-weight: bold;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-badges {
  display: flex;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions .btn {
  padding: 0.8rem 1.2rem;
}
  font-size: 0.75rem;
  font-weight: bold;
  border: 1px solid;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.temperature-badge {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.temperature-badge.hot {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.temperature-badge.warm {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.power-badge {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Content Area */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background-color: var(--bg-primary);
}

.view {
  display: none;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panel */
.panel {
  background-color: rgba(51, 65, 85, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  backdrop-filter: blur(10px);
  max-width: 80rem;
  margin: 0 auto;
}

.view-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: var(--accent-blue);
}

/* Reactor Visualization */
.component {
  position: relative;
  display: inline-block;
}

.component-label {
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.reactor-group,
.exchanger-group,
.turbine-group,
.generator-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2rem;
}

/* Reactor Design */
.reactor {
  width: 12rem;
  height: 16rem;
  border: 0.5rem solid var(--bg-tertiary);
  border-radius: 1.5rem 1.5rem 0.75rem 0.75rem;
  background-color: var(--bg-primary);
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reactor-interior {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1rem 0.5rem;
  transition: background-color 0.8s ease;
}

.fuel-rods {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  align-items: flex-end;
  padding: 0 0.5rem;
}

.rod-group {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.fuel-rod {
  width: 100%;
  height: 75%;
  background-color: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--accent-blue);
  border-radius: 0.125rem;
}

.control-rod {
  width: 0.375rem;
  height: 80%;
  background-color: var(--text-secondary);
  border-radius: 0.05rem;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.4);
  position: absolute;
  transition: transform 0.3s ease;
  z-index: 10;
}

/* Heat Exchanger */
.pipe {
  width: 100%;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: linear-gradient(to right, var(--bg-tertiary), var(--bg-secondary));
  position: relative;
  overflow: hidden;
  flex-grow: 1;
  min-width: 15rem;
}

.steam-particles {
  width: 100%;
  height: 100%;
  position: relative;
}

.steam-particle {
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--accent-rose);
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
  top: 50%;
  transform: translateY(-50%);
}

/* Turbine */
.turbine {
  width: 6rem;
  height: 6rem;
  border: 2px solid var(--accent-emerald);
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.turbine-blade {
  position: absolute;
  width: 0.5rem;
  height: 2rem;
  background-color: var(--accent-emerald);
  border-radius: 9999px;
  transform-origin: center 3rem;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.turbine.spinning {
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.turbine-speed {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--accent-emerald);
  font-weight: bold;
}

/* Generator */
.generator {
  width: 6rem;
  height: 4rem;
  border: 2px solid var(--accent-amber);
  border-radius: 0.5rem;
  background-color: rgba(245, 158, 11, 0.1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.generator::before {
  content: '⚙️';
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* Fission Diagram */
.fission-diagram {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 3rem 0;
}

.fission-particle {
  position: relative;
  width: 6rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nucleus {
  width: 3rem;
  height: 3rem;
  background-color: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.neutron {
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--accent-blue);
}

.neutron.n1 {
  top: 0;
  right: 0;
}

.neutron.n2 {
  bottom: 0;
  left: 0;
}

.arrow {
  font-size: 2rem;
  color: var(--accent-emerald);
}

.fission-text {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* Energy Flow */
.energy-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.energy-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.energy-box {
  width: 7rem;
  height: 4rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-emerald));
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.875rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.energy-arrow {
  font-size: 1.5rem;
  color: var(--accent-emerald);
}

.efficiency-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: rgba(51, 65, 85, 0.5);
  border-left: 3px solid var(--accent-amber);
  border-radius: 0.375rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.stat-value {
  font-weight: bold;
  color: var(--accent-amber);
  font-size: 1.25rem;
}

/* Control Pane */
.control-pane {
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.control-section,
.status-section,
.info-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.info-section {
  border-bottom: none;
}

.procedure-section,
.notebook-section {
  background-color: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
}

.procedure-box {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(71, 85, 105, 0.35);
  border-radius: 0.85rem;
  padding: 1rem;
  max-height: 260px;
  overflow-y: auto;
}

.procedure-steps {
  margin: 0;
  padding-left: 18px;
  list-style-position: inside;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.notebook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.notebook-content {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.85rem;
  padding: 1rem;
  max-height: 280px;
  overflow-y: auto;
}

.notebook-placeholder {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

.notebook-entry {
  display: block;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid rgba(59, 130, 246, 0.6);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.notebook-entry.success {
  border-left-color: var(--accent-emerald);
}

.notebook-entry.warning {
  border-left-color: var(--accent-amber);
}

.notebook-entry.danger {
  border-left-color: var(--accent-red);
}

.notebook-entry.info {
  border-left-color: var(--accent-blue);
}

.timestamp {
  display: inline-block;
  margin-right: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.control-title {
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
}

.control-item {
  margin-bottom: 1.5rem;
}

.control-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background-color: var(--accent-red);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background-color: var(--accent-amber);
  color: white;
  margin-top: 0.5rem;
}

.btn-warning:hover:not(:disabled) {
  background-color: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Slider */
.slider {
  width: 100%;
  height: 0.5rem;
  border-radius: 0.25rem;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-emerald));
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 1rem 0;
}

.slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--accent-blue);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Status Display */
.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-value {
  font-weight: bold;
  color: var(--accent-emerald);
}

.alert-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--accent-red);
  color: var(--accent-red);
}

/* Info Text */
.info-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Steam Flow Animation */
@keyframes steamFlow {
  from {
    left: -10px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  to {
    left: 100%;
    opacity: 0;
  }
}

/* Print Styles */
@media print {
  .control-pane,
  .tabs,
  .header {
    display: none;
  }
}
