/* ============================================================
   ALTUS Office v2 — Editor Styles
   Toolbar, catalog panel, floor palette, zone selector
   ============================================================ */

/* --- Editor Toolbar (left side) --- */
.editor-toolbar {
  position: fixed;
  top: var(--topbar-height);
  left: var(--sidebar-collapsed);
  bottom: 0;
  width: var(--toolbar-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) 0;
  gap: var(--sp-1);
  transition: left 0.2s ease;
}

body.sidebar-expanded .editor-toolbar {
  left: var(--sidebar-expanded);
}

.tool-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  position: relative;
}

.tool-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tool-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(233, 69, 96, 0.4);
}

.tool-btn[title]::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.tool-btn:hover[title]::after {
  opacity: 1;
}

.toolbar-separator {
  width: 28px;
  height: 1px;
  background: var(--border);
  margin: var(--sp-1) 0;
}

/* --- Editor Catalog (right panel) --- */
.editor-catalog {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: var(--catalog-width);
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.catalog-header {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.catalog-search {
  width: 100%;
  padding: var(--sp-2) var(--sp-2);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  outline: none;
}

.catalog-search:focus {
  border-color: var(--accent);
}

.catalog-search::placeholder {
  color: var(--text-muted);
}

/* Catalog tabs */
.catalog-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}

.catalog-tab {
  flex: 1;
  padding: var(--sp-2) var(--sp-1);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  cursor: pointer;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.catalog-tab:hover {
  color: var(--text-primary);
}

.catalog-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Catalog items list */
.catalog-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  align-content: start;
}

.catalog-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  transition: border-color 0.15s, background 0.15s;
}

.catalog-item:hover {
  border-color: var(--accent);
}

.catalog-item.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.15);
}

.catalog-item-preview {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
}

.catalog-item-name {
  font-size: 8px;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* --- Floor Palette --- */
.floor-palette {
  position: fixed;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  z-index: 85;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.floor-patterns {
  display: flex;
  gap: var(--sp-1);
}

.floor-pattern-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  padding: 0;
  overflow: hidden;
}

.floor-pattern-btn:hover {
  border-color: var(--text-secondary);
}

.floor-pattern-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 4px rgba(233, 69, 96, 0.5);
}

.floor-pattern-btn canvas,
.floor-pattern-btn img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* HSBC Sliders */
.floor-sliders {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.floor-slider-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.floor-slider-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  width: 12px;
  text-align: center;
}

.floor-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-surface);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.floor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.floor-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.floor-slider-value {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  width: 28px;
  text-align: right;
}

/* --- Zone Selector --- */
.zone-selector {
  position: fixed;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  z-index: 85;
  display: flex;
  gap: var(--sp-2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.zone-btn {
  padding: var(--sp-2) var(--sp-3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
  color: #fff;
  font-weight: bold;
}

.zone-btn.active {
  border-color: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.zone-btn-work {
  background: rgba(0, 100, 255, 0.6);
}

.zone-btn-rest {
  background: rgba(0, 200, 0, 0.6);
}

.zone-btn-meeting {
  background: rgba(255, 200, 0, 0.6);
  color: #333;
}

.zone-btn-boss {
  background: rgba(255, 170, 0, 0.6);
  color: #333;
}

/* --- Ghost Preview (editor) --- */
.ghost-preview {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 50;
}

/* --- Wizard Modal (fullscreen variant) --- */
.wizard-modal {
  max-width: 700px;
  width: 90vw;
  max-height: 90vh;
}

.wizard-steps {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.wizard-step {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.wizard-step.done {
  background: var(--success);
}

.wizard-step.current {
  background: var(--accent);
}

.wizard-body {
  min-height: 200px;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

/* Wizard form elements */
.form-group {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
  letter-spacing: 1px;
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
}

/* Validation checklist */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.checklist-item.pass {
  color: var(--success);
}

.checklist-item.fail {
  color: var(--error);
}

.checklist-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

/* Agent linker modal list */
.agent-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 300px;
  overflow-y: auto;
}

.agent-list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}

.agent-list-item:hover {
  border-color: var(--accent);
}

.agent-list-item .agent-preview {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
}

.agent-list-item .agent-info {
  flex: 1;
}

.agent-list-item .agent-name {
  font-size: var(--font-size-sm);
  font-weight: bold;
  color: var(--text-primary);
}

.agent-list-item .agent-role {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.agent-list-item .agent-lead-badge {
  color: gold;
  font-size: var(--font-size-sm);
}

/* Linked agent display */
.linked-agent {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
}

.linked-agent .agent-name {
  font-weight: bold;
  color: var(--accent);
}

.unlink-btn {
  margin-left: auto;
  background: var(--error);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  cursor: pointer;
}

.unlink-btn:hover {
  background: #ff6666;
}
