/* Основные переменные для светлой и тёмной темы */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --accent: #007bff;
  --highlight: #e6e6e6;
}
body.dark {
  --bg: #121212;
  --fg: #f0f0f0;
  --accent: #3fa1ff;
  --highlight: #222222;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--bg);
  color: var(--fg);
}

.container {
  display: flex;
  height: 100%;
}

/* Левая панель */
.sidebar {
  width: 320px;
  padding: 16px;
  overflow-y: auto;
  background-color: var(--highlight);
  box-shadow: 2px 0 5px rgba(0,0,0,0.15);
}

.title {
  margin-top: 0;
  font-size: 20px;
  text-align: center;
  color: var(--accent);
  line-height: 1.2;
  word-break: break-word;
}

.section {
  margin-bottom: 24px;
}

.section h2 {
  font-size: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.field input,
.field select,
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background-color: var(--bg);
  color: var(--fg);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.buttons {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.buttons button {
  flex: 1;
}

/* Кнопки */
button {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background-color: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}
button:hover {
  background-color: #0056b3;
}
button:disabled {
  background-color: #777;
}

.main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Холст */
#graphCanvas {
  flex: 1;
  width: 100%;
  height: calc(100% - 200px);
  border-bottom: 1px solid var(--accent);
  background-color: var(--bg);
}

/* Панель симуляции */
.simulation-controls {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulation-controls .buttons {
  justify-content: space-between;
}

.batch {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-toggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
}

/* Легенда */
.legend {
  font-size: 13px;
}
.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  margin-right: 6px;
  border: 1px solid #000;
}
.legend-label {
  flex: 1;
}

/* Справка */
.help p {
  margin: 6px 0;
  line-height: 1.3;
}

/* Аналитика */
.analytics ul {
  list-style: none;
  padding-left: 0;
}
.analytics ul li {
  font-size: 12px;
}

/* Прокрутка */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 3px;
}
