/* ===================================================================
   SR LIBRARY - 43-SEAT PHYSICAL HALL LAYOUT STYLESHEET
   Accurately models the physical room layout from the seating plan:
   - Exactly 43 physical study seats
   - Left Wall: Column of 13 seats (43 down to 31)
   - Central Walkway / Aisle
   - Right Side: 4 distinct blocks:
     - Block 1 (Top): [4, 3, 2, 1] & [5, 6, 7, 8]
     - Block 2 (Mid): [12, 11, 10, 9] & [13, 14, 15, 16] (13, 14, 15 locked)
     - Main Door / Entrance at the right wall adjacent to Block 2
     - Block 3: [19, 18, 17] & [20, 21, 22] (17, 19 locked)
     - Block 4: [26, 25, 24, 23] & [27, 28, 29, 30]
   =================================================================== */

.hall-blueprint-wrapper {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 24px 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hall-blueprint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.hall-blueprint-title {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hall-scroll-hint {
  display: none;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  background: var(--surface-2, #f8fafc);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border, #e2e8f0);
}

@media (max-width: 768px) {
  .hall-scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}

/* Scroll container for mobile view */
.hall-scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

/* Floor Plan architectural container */
.hall-floorplan {
  min-width: 620px;
  max-width: 820px;
  margin: 0 auto;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 24px 20px 24px 24px;
  position: relative;
}

/* Wall labels */
.hall-wall-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  text-align: center;
  user-select: none;
}

.hall-wall-top {
  margin-bottom: 14px;
}

.hall-wall-bottom {
  margin-top: 14px;
}

/* Main Grid: Left Column | Central Aisle | Right Blocks */
.hall-grid-layout {
  display: grid;
  grid-template-columns: 80px 50px 1fr;
  gap: 12px;
  align-items: start;
}

/* Left Wall Column (Seats 43 down to 31) */
.left-wall-column {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.left-wall-header {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  text-align: center;
}

/* Central Aisle / Walkway */
.central-aisle {
  height: 100%;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  border-left: 2px dashed #e2e8f0;
  border-right: 2px dashed #e2e8f0;
  background: rgba(241, 245, 249, 0.6);
  border-radius: 6px;
  user-select: none;
  padding: 8px 0;
}

.aisle-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #94a3b8;
  text-transform: uppercase;
}

/* Right Side: Blocks */
.right-hall-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hall-block-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.hall-block-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hall-row-grid {
  display: grid;
  gap: 10px;
  justify-content: center;
}

.hall-row-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.hall-row-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 78%;
  margin: 0 auto;
}

.hall-row-subgap {
  height: 10px;
  border-bottom: 1px dashed #e2e8f0;
  margin-bottom: 10px;
}

/* Entrance Door Zone */
.hall-door-zone {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 0;
}

.hall-door-badge {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffd600;
  border: 1px solid #334155;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  user-select: none;
}

/* ===================================================================
   Individual Seat Unit (Desk Button)
   =================================================================== */

.seat-unit {
  min-width: 52px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
  font-family: inherit;
}

.seat-unit:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.seat-unit .seat-number-text {
  font-family: var(--font-display, 'Outfit', monospace);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.seat-unit .seat-status-sub {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

/* ─── State: AVAILABLE ────────────────────────────────────────────── */
.seat-unit.available {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.seat-unit.available:hover {
  border-color: #22c55e;
  background: #dcfce7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

/* ─── State: SELECTED ─────────────────────────────────────────────── */
.seat-unit.selected {
  border-color: #1d4ed8 !important;
  background: #2563eb !important;
  color: #ffffff !important;
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35) !important;
}

.seat-unit.selected .seat-number-text,
.seat-unit.selected .seat-status-sub {
  color: #ffffff !important;
}

/* ─── State: OCCUPIED / BOOKED ────────────────────────────────────── */
.seat-unit.occupied {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  cursor: not-allowed;
  opacity: 0.85;
}

.seat-unit.occupied:hover {
  transform: none;
  box-shadow: none;
}

/* ─── State: LOCKED / UNAVAILABLE (Seats 13, 14, 15, 17, 19) ───────── */
.seat-unit.locked,
.seat-unit.maintenance {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
  border-style: dashed;
  cursor: not-allowed;
  opacity: 0.75;
}

.seat-unit.locked:hover,
.seat-unit.maintenance:hover {
  transform: none;
  box-shadow: none;
}

/* ===================================================================
   Legend Styles
   =================================================================== */

.hall-legend-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 20px;
}

.legend-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.legend-color-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid;
  flex-shrink: 0;
}

.legend-color-box.available {
  background: #f0fdf4;
  border-color: #86efac;
}

.legend-color-box.selected {
  background: #2563eb;
  border-color: #1d4ed8;
}

.legend-color-box.occupied {
  background: #fef2f2;
  border-color: #fca5a5;
}

.legend-color-box.locked {
  background: #f1f5f9;
  border-color: #cbd5e1;
  border-style: dashed;
}
