/* style.css – DICOM Viewer с правой панелью инструментов */
:root {
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --text: #e0e0e0;
  --text-secondary: #aaaaaa;
  --accent: #c49a6c;
  --accent-light: #e0b070;
  --danger: #b8453a;
  --radius: 8px;
  --font: 'Segoe UI', Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: #000; color: var(--text); height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
#viewer-container { display: flex; flex-direction: column; height: 100vh; width: 100vw; background: #000; }
#toolbar { display: flex; align-items: center; gap: 8px; padding: 4px 12px; background: var(--surface); flex-shrink: 0; flex-wrap: nowrap; }
.toolbar-logo { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.badge-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; }
.badge-text { font-size: 0.65rem; font-weight: 700; line-height: 1.2; color: #ccc; text-transform: uppercase; letter-spacing: 0.03em; }
#toolbar button { background: #3a3a3a; border: 1px solid #555; color: #eee; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 0.8rem; white-space: nowrap; transition: background 0.2s; }
#toolbar button:hover { background: #555; }
#seriesInfo { margin-left: auto; color: var(--text-secondary); font-size: 0.75rem; white-space: nowrap; }

/* Основная область: изображение + правая панель */
#mainArea { display: flex; flex: 1; overflow: hidden; }
#imageViewport { flex: 1; position: relative; overflow: hidden; background: #000; touch-action: none; }
#dicomCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#measureCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: auto; z-index: 10; }
#infoOverlay { position: absolute; top: 10px; right: 220px; background: rgba(0,0,0,0.85); color: #0f0; padding: 8px; font-family: monospace; font-size: 0.7rem; max-width: 280px; border-radius: 4px; white-space: pre-wrap; z-index: 20; pointer-events: auto; }
.hidden { display: none; }

/* Правая боковая панель */
/* Правая боковая панель */
#rightPanel {
  width: 180px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  overflow-y: auto;
  flex-shrink: 0;
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  width: 100%;
}
/* Группы с несколькими кнопками – распределяем равномерно */
.tool-group-multi button {
  width: auto;
  flex: 1;
  margin: 2px 4px;
}
/* Одиночные кнопки */
.tool-group:not(.tool-group-multi) button {
  width: auto;
  flex: 1;
  margin: 2px 4px;
}
.slider-group {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: center;
}
.slider-group label {
  color: var(--text-secondary);
  font-size: 1.5rem;
  width: 20px;
  text-align: center;
}
.slider-group input[type="range"] {
  width: 80%;
}
#rightPanel button {
  background: #3a3a3a;
  border: 1px solid #555;
  color: #eee;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: background 0.2s;
}
#rightPanel button:hover { background: #555; }
#rightPanel button.active-tool { background: var(--accent); color: #000; border-color: var(--accent-light); }
#sliceCounter { color: var(--accent-light); font-weight: 600; font-size: 0.8rem; min-width: 50px; text-align: center; }
#infoOverlay { position: absolute; top: 10px; right: 220px; background: rgba(0,0,0,0.85); color: #0f0; padding: 8px; font-family: monospace; font-size: 0.7rem; max-width: 280px; border-radius: 4px; white-space: pre-wrap; z-index: 20; pointer-events: auto; }
#infoOverlay div { margin: 2px 0; line-height: 1.3; font-size: 0.7rem; }
.hidden { display: none; }
/* Мобильная адаптация (правая панель скрывается, инструменты внизу) */
@media (max-width: 600px) {
  #toolbar { padding: 4px 8px; gap: 4px; }
  #toolbar button { padding: 6px 8px; font-size: 0.7rem; }
  .badge-logo { width: 24px; height: 24px; }
  #mainArea { flex-direction: column; }
  #rightPanel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 4px;
    gap: 4px;
    justify-content: center;
  }
  .tool-group { margin: 0; }
  #rightPanel button { padding: 6px 8px; font-size: 0.7rem; min-width: 40px; min-height: 40px; }
  .slider-group { width: auto; }
}