/* 2D Bar Grid and Map Styles */

.bar-layout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  padding: 2rem;
  height: calc(100vh - 74px); /* Subtract header height */
  overflow: hidden;
}

.bar-map-section {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.section-title h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-indicator-live {
  font-size: 0.75rem;
  font-weight: 700;
  color: #00ff66;
  background: rgba(0, 255, 102, 0.1);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.2);
}

/* 2D Grid Map */
.bar-floor-map {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 240px);
  gap: 2.5rem;
  padding: 1rem;
}

.table-wrapper {
  position: relative;
  background: rgba(26, 22, 19, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.table-wrapper:hover {
  background: rgba(26, 22, 19, 0.6);
  border-color: rgba(255, 170, 0, 0.2);
}

.table-title {
  position: absolute;
  top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* Central Surface */
.table-surface {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, #5b4b3e 0%, #2f231a 100%);
  border: 4px solid var(--border-wood);
  box-shadow: 
    inset 0 2px 10px rgba(0, 0, 0, 0.8),
    0 10px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 2;
  transition: all var(--transition-normal);
}

.table-wrapper:hover .table-surface {
  border-color: var(--border-neon-amber);
  box-shadow: 
    inset 0 2px 10px rgba(0, 0, 0, 0.8),
    0 0 15px rgba(255, 170, 0, 0.25);
  color: var(--text-main);
}

/* Seats surrounding the table */
.seat {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  z-index: 3;
  transition: all var(--transition-fast);
}

/* Empty Seat invites sitting */
.seat.empty {
  background: rgba(36, 30, 26, 0.8);
  border: 2px dashed var(--border-wood);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.seat.empty:hover {
  border-color: var(--border-neon-blue);
  background: rgba(0, 210, 255, 0.1);
  color: var(--border-neon-blue);
  box-shadow: var(--shadow-neon-blue);
  transform: scale(1.15) !important;
}

/* Occupied Seat shows User Initials */
.seat.occupied {
  background: linear-gradient(135deg, #2b9348 0%, #155d27 100%);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: default;
}

.seat.occupied.me {
  background: linear-gradient(135deg, var(--border-neon-pink) 0%, #b00054 100%);
  box-shadow: var(--shadow-neon-pink);
  animation: pulseMe 2s infinite alternate;
}

@keyframes pulseMe {
  from { box-shadow: 0 0 5px rgba(255, 42, 133, 0.5); }
  to { box-shadow: 0 0 15px rgba(255, 42, 133, 0.9); }
}

/* Floating Drink Emoji next to the seat */
.seat-drink {
  position: absolute;
  font-size: 1.15rem;
  pointer-events: none;
  z-index: 4;
  animation: floatDrink 3s infinite ease-in-out alternate;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

@keyframes floatDrink {
  from { transform: translateY(0) scale(0.9); }
  to { transform: translateY(-4px) scale(1.05); }
}

/* Tooltip on hovering occupied seat */
.seat-tooltip {
  visibility: hidden;
  background: #151210;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 4px 8px;
  position: absolute;
  z-index: 10;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid var(--border-wood);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.seat:hover .seat-tooltip {
  visibility: visible;
  opacity: 1;
}

/* 4-seat distribution percentages (Top, Right, Bottom, Left) */
.table-wrapper[data-capacity="4"] .seat-0 { top: 38px; left: calc(50% - 18px); }
.table-wrapper[data-capacity="4"] .seat-1 { top: calc(50% - 18px); right: 38px; }
.table-wrapper[data-capacity="4"] .seat-2 { bottom: 38px; left: calc(50% - 18px); }
.table-wrapper[data-capacity="4"] .seat-3 { top: calc(50% - 18px); left: 38px; }

/* 4-seat drink layout position */
.table-wrapper[data-capacity="4"] .drink-0 { top: 82px; left: calc(50% - 10px); }
.table-wrapper[data-capacity="4"] .drink-1 { top: calc(50% - 10px); right: 82px; }
.table-wrapper[data-capacity="4"] .drink-2 { bottom: 82px; left: calc(50% - 10px); }
.table-wrapper[data-capacity="4"] .drink-3 { top: calc(50% - 10px); left: 82px; }

/* 6-seat distribution percentages */
.table-wrapper[data-capacity="6"] .seat-0 { top: 38px; left: calc(32% - 18px); }
.table-wrapper[data-capacity="6"] .seat-1 { top: 38px; left: calc(68% - 18px); }
.table-wrapper[data-capacity="6"] .seat-2 { top: calc(50% - 18px); right: 34px; }
.table-wrapper[data-capacity="6"] .seat-3 { bottom: 38px; left: calc(68% - 18px); }
.table-wrapper[data-capacity="6"] .seat-4 { bottom: 38px; left: calc(32% - 18px); }
.table-wrapper[data-capacity="6"] .seat-5 { top: calc(50% - 18px); left: 34px; }

/* 6-seat drink positions */
.table-wrapper[data-capacity="6"] .drink-0 { top: 82px; left: calc(35% - 10px); }
.table-wrapper[data-capacity="6"] .drink-1 { top: 82px; left: calc(65% - 10px); }
.table-wrapper[data-capacity="6"] .drink-2 { top: calc(50% - 10px); right: 74px; }
.table-wrapper[data-capacity="6"] .drink-3 { bottom: 82px; left: calc(65% - 10px); }
.table-wrapper[data-capacity="6"] .drink-4 { bottom: 82px; left: calc(35% - 10px); }
.table-wrapper[data-capacity="6"] .drink-5 { top: calc(50% - 10px); left: 74px; }

/* Dynamic layout row and columns */
.grid-row-1 { grid-row: 1; }
.grid-row-2 { grid-row: 2; }
.grid-row-3 { grid-row: 3; }
.grid-row-4 { grid-row: 4; }

.grid-col-1 { grid-column: 1; }
.grid-col-2 { grid-column: 2; }
.grid-col-3 { grid-column: 3; }

/* Sidebar Layout */
.bar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.sidebar-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.state-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
}

.state-placeholder .sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.current-table-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.current-table-info .table-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--border-neon-amber);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.drink-ordering-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.drink-ordering-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.drink-ordering-section .btn {
  width: 100%;
}

/* Responsive design for Mobile screens */
@media (max-width: 850px) {
  .bar-layout-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .bar-floor-map {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 1.5rem;
    padding: 0;
  }

  .table-wrapper {
    height: 200px;
  }

  .bar-sidebar {
    height: auto;
    overflow-y: visible;
  }
  
  header {
    padding: 1rem;
  }
  
  .user-profile-summary {
    display: none; /* Hide profile summary on very small headers to avoid clutter */
  }
}

