/* Blueprint viewer and editor styles */

.blueprint-section {
  margin: 1rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.blueprint-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.blueprint-section-header h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.blueprint-toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.blueprint-toolbar .btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

.blueprint-container {
  position: relative;
  min-height: 400px;
  max-height: 80vh;
  overflow: hidden;
  background: var(--bg-surface);
  cursor: grab;
}

.blueprint-container.dragging {
  cursor: grabbing;
}

.blueprint-container svg.blueprint {
  width: 100%;
  height: 100%;
  display: block;
}

/* Blueprint image section */
.blueprint-image {
  position: relative;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.blueprint-image img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.blueprint-image-actions {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.3rem;
}

/* Floor tabs */
.blueprint-floor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  overflow-x: auto;
}

.blueprint-floor-tab {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

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

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

/* Edit mode indicators */
.blueprint-container.edit-mode {
  cursor: crosshair;
}

.blueprint-container.edit-mode .room {
  cursor: move;
}

.blueprint-container.edit-mode .room:hover rect {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 4 2;
}

/* Room selection */
.room-selected rect {
  fill: var(--accent) !important;
  fill-opacity: 0.15 !important;
  stroke: var(--accent) !important;
  stroke-width: 2 !important;
}

/* Resize handles (edit mode) */
.resize-handle {
  fill: var(--accent);
  stroke: var(--bg-surface);
  stroke-width: 1;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.15s;
}

.room:hover .resize-handle,
.room-selected .resize-handle {
  opacity: 1;
}

/* Empty state */
.blueprint-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
}

.blueprint-empty p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.blueprint-empty .blueprint-type-select {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.blueprint-type-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.blueprint-type-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.blueprint-type-btn.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Side panel overlay for room details */
.blueprint-room-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  padding: 0.75rem;
  font-size: 0.85rem;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  z-index: 10;
}

.blueprint-room-panel h5 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.blueprint-room-panel .room-field {
  margin-bottom: 0.5rem;
}

.blueprint-room-panel .room-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.blueprint-room-panel .room-field-value {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.4;
}

.blueprint-room-panel-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

/* Thumbnail mode (for plot scenes and book maps) */
.blueprint-thumbnail {
  width: 200px;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.15s;
}

.blueprint-thumbnail:hover {
  border-color: var(--accent);
}

.blueprint-thumbnail svg {
  width: 100%;
  height: 100%;
}
