/* ═══════════════════════════════════════════
   FLOORPLAN EDITOR STYLES
   ═══════════════════════════════════════════ */

/* Layout */
.fp-layout {
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  gap: 0;
  height: calc(100vh - 140px);
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

/* Left Sidebar */
.fp-sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fp-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.fp-tab {
  flex: 1;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.fp-tab:hover { color: var(--text); }
.fp-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.fp-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.fp-tab-content.active { display: block; }

/* Exhibitor list in sidebar */
.fp-exhibitor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  transition: all .15s;
  user-select: none;
}
.fp-exhibitor-item:hover { background: #f7f0ea; border-color: var(--primary); }
.fp-exhibitor-item.placed { opacity: 0.4; pointer-events: none; }

.fp-exhibitor-type {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fp-exhibitor-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-exhibitor-dims { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.fp-exhibitor-elec { font-size: 12px; }

/* Type color dots */
.fp-type-built    { background: #3b82f6; }
.fp-type-naked    { background: #f59e0b; }
.fp-type-greenlane{ background: #22c55e; }
.fp-type-small    { background: #8b5cf6; }
.fp-type-paardenrassen { background: #ec4899; }

/* Infrastructure toolbar */
.fp-infra-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
}
.fp-infra-btn:hover { background: #f7f0ea; border-color: var(--primary); }
.fp-infra-icon { font-size: 16px; }
.fp-infra-label { font-weight: 600; }

/* Settings panel in sidebar */
.fp-settings-group { margin-bottom: 14px; }
.fp-settings-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.fp-settings-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.fp-settings-input { width: 70px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.fp-settings-unit { font-size: 11px; color: var(--text-muted); }

/* Main Canvas Area */
.fp-canvas-wrap {
  position: relative;
  background: #f8f8f8;
  overflow: auto;
  cursor: grab;
}
.fp-canvas-wrap.dragging { cursor: grabbing; }
.fp-canvas-wrap.placing { cursor: crosshair; }

/* Scrollbar styling */
.fp-canvas-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.fp-canvas-wrap::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.fp-canvas-wrap::-webkit-scrollbar-thumb { background: #b0b0b0; border-radius: 4px; }
.fp-canvas-wrap::-webkit-scrollbar-thumb:hover { background: #888; }
.fp-canvas-wrap::-webkit-scrollbar-corner { background: #f1f1f1; }

#fpSvg {
  display: block;
  min-width: 100%;
  min-height: 100%;
}

/* Zoom controls overlay */
.fp-zoom-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 10;
}
.fp-zoom-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fp-zoom-controls button:hover { background: #f0f0f0; }
#fpZoomLevel { font-size: 11px; font-weight: 600; min-width: 38px; text-align: center; }

/* Save indicator */
.fp-save-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.95);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
  transition: opacity .3s;
}
.fp-save-indicator.dirty { color: #ea580c; }
.fp-save-indicator.saved { color: #16a34a; }
.fp-save-dot { width: 8px; height: 8px; border-radius: 50%; }
.fp-save-indicator.dirty .fp-save-dot { background: #ea580c; animation: fp-pulse 1.5s infinite; }
.fp-save-indicator.saved .fp-save-dot { background: #16a34a; }

@keyframes fp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Right Properties Panel */
.fp-properties {
  background: #fff;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px;
  font-size: 12px;
}

.fp-prop-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--primary);
}

.fp-prop-group { margin-bottom: 12px; }
.fp-prop-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.fp-prop-value { font-size: 12px; font-weight: 600; }

.fp-prop-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

/* Wall toggle grid for built stands */
.fp-wall-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 2px;
  width: 120px;
  margin: 8px auto;
}
.fp-wall-btn {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  transition: all .15s;
}
.fp-wall-btn.wall-present { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.fp-wall-btn.wall-open { background: #f1f5f9; color: #94a3b8; }
.fp-wall-btn:hover { opacity: 0.8; }
.fp-wall-center { background: #3b82f6; color: #fff; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; }

/* Paardenrassen layout toggle */
.fp-paard-layout {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.fp-paard-btn {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  text-align: center;
  transition: all .15s;
}
.fp-paard-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Property action buttons */
.fp-prop-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.fp-prop-actions button {
  flex: 1;
  padding: 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.fp-btn-rotate { background: #f0f9ff; color: #0369a1; }
.fp-btn-rotate:hover { background: #0369a1; color: #fff; }
.fp-btn-delete { background: #fef2f2; color: #dc2626; }
.fp-btn-delete:hover { background: #dc2626; color: #fff; }

/* SVG Stand styling */
.fp-stand { cursor: pointer; }
.fp-stand:hover rect:first-child { opacity: 0.85; }
.fp-stand.selected rect:first-child { stroke: #000; stroke-width: 0.15; stroke-dasharray: 0.3 0.15; }

.fp-wall { stroke-linecap: round; cursor: pointer; pointer-events: stroke; }
.fp-wall-present { stroke-width: 0.15; stroke: #1e293b; }
.fp-wall-open { stroke-width: 0.06; stroke: #cbd5e1; stroke-dasharray: 0.2 0.15; }
.fp-wall:hover { stroke-width: 0.2; stroke: #ea580c; }

.fp-label { font-size: 0.55px; font-weight: 800; fill: #fff; pointer-events: none; }
.fp-name { font-size: 0.4px; font-weight: 600; fill: rgba(255,255,255,0.85); pointer-events: none; }
.fp-electricity-icon { font-size: 0.6px; pointer-events: none; }

/* Infrastructure SVG */
.fp-infra { cursor: pointer; }
.fp-infra:hover rect:first-child { opacity: 0.8; }
.fp-infra.selected rect:first-child { stroke: #000; stroke-width: 0.15; stroke-dasharray: 0.3 0.15; }
.fp-infra-text { font-size: 0.45px; font-weight: 700; fill: #fff; pointer-events: none; }

/* Ghost element (placement preview) */
.fp-ghost { opacity: 0.4; pointer-events: none; }
.fp-ghost rect { stroke: var(--primary); stroke-width: 0.1; stroke-dasharray: 0.3 0.15; }

/* Collision warning */
.fp-collision rect:first-child { fill: #dc2626 !important; opacity: 0.5 !important; }

/* SVG Grid lines */
.fp-grid-line { stroke: #e5e7eb; stroke-width: 0.03; }
.fp-grid-line-major { stroke: #d1d5db; stroke-width: 0.06; }
.fp-grid-label { font-size: 0.5px; fill: #9ca3af; font-weight: 600; }

/* Stable pattern for paardenrassen */
.fp-stable-pattern { fill: url(#stableHatch); }

/* Resize handles */
.fp-resize-handle {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 0.08;
  cursor: nwse-resize;
}

/* Version modal */
.fp-version-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.fp-version-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.fp-version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all .15s;
}
.fp-version-item:hover { border-color: var(--primary); background: #fef7f0; }
.fp-version-item.current { border-color: var(--primary); background: #fef7f0; }
.fp-version-info { flex: 1; }
.fp-version-num { font-weight: 800; font-size: 13px; }
.fp-version-label { font-size: 11px; color: var(--text-muted); }
.fp-version-date { font-size: 10px; color: var(--text-muted); }
.fp-version-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Dropdown for PDF export */
.fp-dropdown {
  position: relative;
  display: inline-block;
}
.fp-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 100;
  padding: 4px;
}
.fp-dropdown.open .fp-dropdown-menu { display: block; }
.fp-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
}
.fp-dropdown-item:hover { background: #f7f0ea; }

/* Empty state */
.fp-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Search in sidebar */
.fp-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
  .fp-layout {
    grid-template-columns: 220px 1fr 200px;
  }
}
@media (max-width: 768px) {
  .fp-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .fp-sidebar, .fp-properties {
    display: none;
  }
  .fp-canvas-wrap {
    height: 60vh;
  }
}

/* ═══ Floorplan Viewer (Public) ═══ */
.fp-viewer-wrap {
  position: relative;
  width: 100%;
  height: 500px;
  background: #f8f8f8;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.fp-viewer-wrap svg {
  width: 100%;
  height: 100%;
}
.fp-viewer-zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}
.fp-viewer-zoom button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

/* Stand tooltip in viewer */
.fp-tooltip {
  position: absolute;
  background: #1e293b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  z-index: 50;
  max-width: 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.fp-tooltip-name { font-weight: 700; margin-bottom: 2px; }
.fp-tooltip-info { font-size: 11px; color: #94a3b8; }

/* Legend */
.fp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  position: absolute;
  top: 10px;
  left: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 10;
  font-size: 11px;
}
.fp-legend-item { display: flex; align-items: center; gap: 4px; }
.fp-legend-dot { width: 10px; height: 10px; border-radius: 3px; }
