/* Modern Seating Plan Editor – EventLive */

:root {
  --se-bg: #f8fafc;
  --se-panel: #ffffff;
  --se-border: #e2e8f0;
  --se-accent: #3b82f6;
  --se-accent-hover: #2563eb;
  --se-success: #10b981;
  --se-warning: #f59e0b;
  --se-danger: #ef4444;
  --se-text: #0f172a;
  --se-muted: #64748b;
  --se-seat: #f59e0b;
  --se-seat-selected: #3b82f6;
  --se-seat-sold: #64748b;
  --se-seat-disabled: #475569;
}

#modern-seating-editor-app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  background: var(--se-bg);
  color: var(--se-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Toolbar */
.se-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--se-panel);
  color: var(--se-text);
  border-bottom: 1px solid var(--se-border);
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
}
.se-toolbar-left,
.se-toolbar-center,
.se-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.se-toolbar .btn {
  border-radius: 8px;
  font-weight: 500;
}
.se-toolbar .btn-outline-primary.active {
  background: var(--se-accent);
  color: #fff;
  border-color: var(--se-accent);
}

/* Workspace */
.se-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.se-sidebar {
  width: 280px;
  background: var(--se-panel);
  color: var(--se-text);
  border-right: 1px solid var(--se-border);
  overflow-y: auto;
  flex-shrink: 0;
}
.se-sidebar-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--se-muted);
  border-bottom: 1px solid var(--se-border);
  background: #f8fafc;
}
.se-sidebar-body {
  padding: 12px 14px;
}
.se-sidebar .form-label {
  color: var(--se-muted);
  margin-bottom: 2px;
}
.se-sidebar .form-control,
.se-sidebar .form-select {
  background: #ffffff;
  border-color: var(--se-border);
  color: var(--se-text);
  border-radius: 6px;
}
.se-sidebar .form-control:focus,
.se-sidebar .form-select:focus {
  border-color: var(--se-accent);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}

/* Canvas area */
.se-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: auto;
  background: #e9eef5;
  padding: 16px;
  overscroll-behavior: contain;
}
#se-canvas {
  width: 1200px;
  height: 800px;
  position: relative;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15,23,42,.12);
  margin: 0 auto;
}
#se-canvas .canvas-container { box-shadow: none !important; }
#se-canvas canvas { display: block; touch-action: pan-x pan-y; }

/* Properties form extras */
.se-prop-group {
  margin-bottom: 12px;
}
.se-prop-group label {
  display: block;
  font-size: 12px;
  color: var(--se-muted);
  margin-bottom: 3px;
}
.se-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--se-border);
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

/* Preview */
.se-preview-map {
  min-height: 400px;
  background: #f8fafc;
  border-radius: 12px;
  position: relative;
  overflow: auto;
}

/* Seat status legend (buyer + editor preview) */
.se-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 0;
  font-size: 13px;
  color: #475467;
}
.se-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.se-legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.se-legend .available { background: #f59e0b; }
.se-legend .selected  { background: #3b82f6; }
.se-legend .sold      { background: #64748b; }
.se-legend .held      { background: #a78bfa; }
.se-legend .disabled  { background: #94a3b8; }

/* Buyer seat map specific */
.buyer-seat-map {
  position: relative;
  user-select: none;
}
.buyer-seat {
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.buyer-seat:hover:not(.sold):not(.disabled):not(.held) {
  transform: scale(1.25);
  filter: brightness(1.15);
  z-index: 5;
}
.buyer-seat.selected {
  filter: drop-shadow(0 0 4px #3b82f6);
}
.buyer-seat.sold,
.buyer-seat.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Selected seats cart tray */
.seat-selection-tray {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 20;
}
.seat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 13px;
  margin: 2px;
}
.seat-chip button {
  border: none;
  background: transparent;
  color: #ef4444;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .se-sidebar { width: 220px; }
  .se-toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 900px) {
  #modern-seating-editor-app { height: auto; min-height: calc(100vh - 60px); }
  .se-workspace { min-height: 70vh; overflow: auto; }
  .se-sidebar { width: 240px; }
  .se-canvas-wrap { min-width: 700px; min-height: 650px; }
  .se-toolbar-center { flex-wrap: wrap; }
}
