/* ============================================
   Table Mode Styles
   ============================================ */

.table-mode {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.table-mode__body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ---- Floor Map Panel ---- */

.table-mode__map-panel {
  flex: 7;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
  position: relative;
}

.floor-map {
  flex: 1;
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--color-bg);
}

.floor-map__container {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

/* ---- Table Nodes ---- */

.table-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  text-align: center;
  gap: 2px;
  padding: var(--space-1);
}

.table-node:active {
  opacity: 0.8;
}

.table-node--circle {
  border-radius: var(--radius-full);
}

.table-node__label {
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
}

.table-node__spend {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  opacity: 0.8;
}

/* Status colors */
.table-node--open {
  background-color: rgba(66, 66, 66, 0.4);
  border-color: var(--color-muted);
  color: var(--color-text-dim);
}

.table-node--occupied {
  background-color: rgba(0, 229, 255, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.table-node--reserved {
  background-color: rgba(255, 214, 0, 0.15);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.table-node--blocked {
  background-color: rgba(255, 23, 68, 0.1);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.table-node--below-min {
  background-color: rgba(255, 23, 68, 0.15);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.table-node--selected {
  border-width: 3px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

/* ---- Table Detail Panel ---- */

.table-mode__detail-panel {
  flex: 3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-detail__header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.table-detail__name {
  font-size: var(--text-md);
  font-weight: 700;
}

.table-detail__meta {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

.table-detail__min-spend {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.table-detail__min-spend-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  margin-bottom: var(--space-2);
}

.table-detail__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  font-size: var(--text-sm);
  padding: var(--space-8);
  text-align: center;
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
  .table-mode__body {
    flex-direction: column;
  }

  .table-mode__map-panel {
    flex: 1;
    border-right: none;
  }

  .table-mode__detail-panel {
    position: fixed;
    inset: 0;
    z-index: var(--z-sidebar);
    background-color: var(--color-bg);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
  }

  .table-mode__detail-panel--open {
    transform: translateY(0);
  }
}
