/* ==========================================================================
   FLOOR PLAN CANVAS, TOOLBARS, TIMELINE SCRUBBER & SIDEBAR QUEUES
   ========================================================================== */

.floorplan-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Top Sub-Toolbar (Allocation Scrubber OR Builder Tools) */
.sub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
  flex-wrap: wrap;
  z-index: 40;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-subtle);
  margin: 0 4px;
}

/* Timeline Scrubber Bar */
.timeline-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.55);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex: 1;
  max-width: 780px;
}

.date-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.date-picker-input {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.scrubber-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}

.time-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #334155;
  outline: none;
  cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
}

.scrubber-time-readout {
  min-width: 58px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

/* Preview Mode Banner */
.preview-mode-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.2));
  border-bottom: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 12.5px;
  font-weight: 600;
  z-index: 35;
}

.preview-mode-banner.active {
  display: flex;
}

/* Active Selection / Multi-Table Mode Banner */
.allocation-mode-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(59, 130, 246, 0.22));
  border-bottom: 1px solid rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
  font-size: 13px;
  font-weight: 600;
  z-index: 36;
}

.allocation-mode-banner.active {
  display: flex;
}

/* Canvas + Right Sidebar Container */
.canvas-and-sidebar {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.canvas-viewport {
  flex: 1;
  position: relative;
  background-color: #f1f5f9;
  overflow: hidden;
  cursor: grab;
}

.canvas-viewport:active {
  cursor: grabbing;
}

.canvas-viewport.mode-wall-draw {
  cursor: crosshair;
}

.canvas-viewport.mode-wall-delete {
  cursor: pointer;
}

#floorplanCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Floating Canvas Zoom & Legend Controls */
.canvas-hud-bottom-left {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 25;
}

.canvas-legend {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.legend-ring {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid;
}

.zoom-controls {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: fit-content;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.zoom-level-text {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}

/* Overdue Floating Alert Pill (Bottom Right of Canvas) */
.overdue-alert-pill {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.55);
  border: 1.5px solid #fca5a5;
  cursor: pointer;
  z-index: 30;
  animation: gentleAlertPulse 2s infinite;
}

.overdue-alert-pill.visible {
  display: flex;
}

@keyframes gentleAlertPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.55); }
  50% { transform: scale(1.03); box-shadow: 0 6px 26px rgba(239, 68, 68, 0.85); }
}

/* ==========================================================================
   RIGHT SIDEBAR: AWAITING ALLOCATION QUEUES
   ========================================================================== */

.allocation-sidebar {
  width: 340px;
  background-color: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 30;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.45);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-count-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-queue-msg {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-style: italic;
}

/* Queue Party Card */
.party-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  transition: all var(--transition-fast);
  position: relative;
}

.party-card.walkin-card {
  border-left-color: var(--accent-emerald);
}

.party-card.overdue-card {
  border-left-color: var(--accent-crimson);
  background: rgba(239, 68, 68, 0.12);
}

.party-card.matching-active {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.party-card:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.party-card:active {
  cursor: grabbing;
}

.party-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.party-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.party-guests-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.party-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.party-notes-indicator {
  margin-top: 6px;
  padding: 3px 7px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  color: #fcd34d;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-action-btn {
  flex: 1;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* Builder Shape Adder Buttons */
.shape-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.shape-btn:hover {
  background: #475569;
  border-color: #64748b;
}

.shape-btn.active-tool {
  background: var(--accent-primary);
  border-color: #60a5fa;
  color: #ffffff;
}

.shape-btn.danger-tool.active-tool {
  background: var(--accent-crimson);
  border-color: #f87171;
}
