/* ==========================================================================
   Seating Chart Planner — Tool-Specific Styles
   Drag-and-drop seating chart with two-panel layout:
   left = unassigned guests, right = tables
   ========================================================================== */

/* --------------------------------------------------------------------------
   Stats Bar
   -------------------------------------------------------------------------- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.stat strong {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Two-Panel Layout
   -------------------------------------------------------------------------- */
.seating-layout {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 16px;
}

.unassigned-panel {
  /* Left panel — sticky so it follows scroll on tall layouts */
  position: sticky;
  top: 90px;
}

.tables-panel {
  /* Right panel — grows with content */
  min-height: 300px;
}

/* --------------------------------------------------------------------------
   Guest Input
   -------------------------------------------------------------------------- */
.add-guest-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.add-guest-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.add-guest-row input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.add-guest-row input::placeholder {
  color: var(--color-text-muted);
}

.add-guest-row button {
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.add-guest-row button:hover {
  background: var(--color-primary-hover, var(--color-primary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Bulk add section */
.bulk-add-section {
  margin-bottom: 16px;
}

.bulk-add-section textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text);
  background: var(--color-surface);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: 8px;
}

.bulk-add-section textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.bulk-add-section textarea::placeholder {
  color: var(--color-text-muted);
}

.bulk-add-section button {
  padding: 8px 18px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.bulk-add-section button:hover {
  background: var(--color-primary-subtle);
}

/* --------------------------------------------------------------------------
   Guest Chips
   -------------------------------------------------------------------------- */
.guest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 4px 0;
}

.guest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-subtle);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.guest-chip:hover {
  transform: scale(1.04);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.guest-chip:active {
  cursor: grabbing;
}

.guest-chip.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   Tables Section
   -------------------------------------------------------------------------- */
.tables-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tables-header .panel-title {
  margin: 0;
}

.tables-header button {
  padding: 8px 18px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.tables-header button:hover {
  background: var(--color-primary-hover, var(--color-primary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Table cards container */
.tables-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Individual table card */
.table-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* Table header row */
.table-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.table-name-input {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  min-width: 120px;
  max-width: 200px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-name-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Seat count badge */
.seat-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.seat-count.full {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Table actions (capacity input + remove) */
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.capacity-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.capacity-input {
  width: 56px;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
  -moz-appearance: textfield;
}

.capacity-input::-webkit-inner-spin-button,
.capacity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.capacity-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.btn-remove-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid #fecaca;
  color: var(--color-error);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-remove-table:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
}

/* Guest chips within a table */
.table-guests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 2px dashed var(--color-border-light);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.table-guests.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Drop hint placeholder */
.drop-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-style: italic;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   General: Drag-Over & Empty State
   -------------------------------------------------------------------------- */
.drag-over {
  border-color: var(--color-primary) !important;
  background: var(--color-primary-light) !important;
}

.empty-msg {
  font-size: 0.86rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 8px 0;
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--color-text);
  color: var(--color-surface);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Responsive: 900px — Stack to Single Column
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .seating-layout {
    grid-template-columns: 1fr;
  }

  .unassigned-panel {
    position: static;
  }

  .tables-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .table-header {
    flex-wrap: wrap;
  }

  .table-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* --------------------------------------------------------------------------
   Responsive: 768px — Tighter Spacing
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .stats-bar {
    gap: 10px;
    padding: 10px 14px;
  }

  .stat {
    font-size: 0.82rem;
  }

  .panel {
    padding: 14px;
  }

  .table-card {
    padding: 12px;
  }

  .table-name-input {
    max-width: 140px;
    font-size: 0.86rem;
  }

  .guest-chip {
    font-size: 0.8rem;
    padding: 5px 12px;
  }

  .add-guest-row {
    flex-direction: column;
  }

  .add-guest-row button {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  /* Hide interactive controls & site chrome */
  header,
  footer,
  .ad-zone,
  .tool-page-header,
  .seo-content,
  .related-tools,
  .add-guest-row,
  .bulk-add-section,
  .tables-header button,
  .table-actions,
  .btn-remove-table,
  .guest-chip .remove-guest,
  .drop-hint,
  .toast,
  .no-print {
    display: none !important;
  }

  /* Reset layout for print */
  .page-content,
  .container {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .seating-layout {
    display: block;
  }

  .panel {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 24px;
    break-inside: avoid;
  }

  .panel-title {
    font-size: 1.1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-bottom: 12px;
  }

  /* Table cards print cleanly */
  .table-card {
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 12px;
    break-inside: avoid;
    background: #fff;
  }

  .table-name-input {
    border: none;
    padding: 0;
    font-size: 1rem;
    background: transparent;
  }

  .seat-count {
    background: none;
    color: #333;
    border: 1px solid #999;
  }

  /* Guest chips — simple text for print */
  .guest-chip {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #111;
    box-shadow: none;
    cursor: default;
    font-size: 0.82rem;
  }

  .table-guests {
    border: 1px solid #e5e7eb;
    padding: 8px;
  }

  /* Stats bar prints as inline text */
  .stats-bar {
    border: none;
    padding: 0 0 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #ccc;
  }

  /* Unassigned panel — hide if empty, otherwise show at top */
  .unassigned-panel {
    position: static;
  }
}
