/* ==============================================================================
   SHOW CA NHẠC NINH GIANG - SEATMAP STYLES (LIGHT ARCHITECTURAL SEATING)
   ============================================================================== */

.seatmap-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

/* Toolbar trên sơ đồ (đặt dưới sơ đồ ghế) */
.seatmap-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  border-bottom: none;
  flex-wrap: wrap;
  gap: 12px;
}

.map-status-legend {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.legend-dot.available {
  background-color: var(--primary);
}

.legend-dot.selected {
  background-color: var(--selected-color);
}

.legend-dot.sold {
  background-color: var(--sold-color);
}

/* Bộ công cụ điều khiển bản đồ trực quan */
.map-controls-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}

.btn-map-tool {
  background: none;
  border: none;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-map-tool:hover {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-map-tool svg {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.btn-map-tool:hover svg {
  color: var(--primary);
}

/* Viewport Bản đồ (Tăng chiều cao hiển thị thoáng rộng, nền sáng sạch sẽ) */
.seatmap-viewport {
  position: relative;
  width: 100%;
  height: 670px;
  overflow: hidden;
  background-color: #f8fafc;
  background-image: 
    linear-gradient(to right, rgba(0, 32, 83, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 32, 83, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.seatmap-viewport:active {
  cursor: grabbing;
}

/* Lớp phủ Loading chuyên nghiệp khi tải sơ đồ */
.seatmap-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.seatmap-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.seatmap-loading-box {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0, 32, 83, 0.12), 0 8px 10px -6px rgba(0, 32, 83, 0.05);
  border-radius: 12px;
  padding: 22px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  max-width: 90%;
  animation: modalIn 0.25s ease-out forwards;
}

.seatmap-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(0, 32, 83, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: seatmap-spin 0.8s linear infinite;
  margin-bottom: 4px;
}

@keyframes seatmap-spin {
  to { transform: rotate(360deg); }
}

.seatmap-loading-text {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
}

.seatmap-loading-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

/* Khung chứa các ghế */
.seatmap-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 1950px;
  padding: 30px 40px 60px;
  transform-origin: 0 0;
  will-change: transform;
}

/* Sân khấu (Stage thiết kế phẳng sang trọng màu Navy #002053) */
.stage-container {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.stage-curved {
  width: 680px;
  height: 52px;
  background-color: var(--primary);
  color: #ffffff;
  border-radius: 8px 8px 30px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 32, 83, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stage-label {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* Chỉ báo 2 khối ghế */
.block-indicator-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1780px;
  margin: 0 auto 14px;
  padding: 0 45px;
}

.block-label {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 16px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.block-aisle-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Grid 20 hàng ghế */
.seating-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.seat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
}

/* Nhãn hàng ghế tròn hai bên (mang màu của hàng ghế) */
.row-label {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.row-label-left {
  margin-right: 14px;
}

.row-label-right {
  margin-left: 14px;
}

/* Khối ghế con 40 ghế */
.seat-sub-block {
  display: flex;
  gap: 3.5px;
}

/* Lối đi trung tâm */
.center-aisle {
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.center-aisle span {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Từng ghế ngồi */
.seat-item {
  width: 17px;
  height: 21px;
  background-color: var(--seat-color);
  border-radius: 3px 3px 2px 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}

/* Viền nắp lưng ghế */
.seat-item::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px 2px 0 0;
}

.seat-num {
  font-size: 8px;
  font-weight: 800;
  color: #ffffff;
  pointer-events: none;
  margin-top: 2px;
}

/* Hover ghế */
.seat-item.seat-available:hover {
  transform: translateY(-3px) scale(1.35);
  z-index: 20;
  box-shadow: 0 4px 10px rgba(0, 32, 83, 0.25);
  filter: brightness(1.15);
}

/* Ghế đang chọn */
.seat-item.seat-selected {
  background-color: var(--selected-color) !important;
  transform: translateY(-3px) scale(1.3);
  box-shadow: 0 0 0 2px #ffffff, 0 4px 10px rgba(22, 163, 74, 0.4);
  z-index: 15;
}

.seat-item.seat-selected .seat-num {
  color: #ffffff;
  font-weight: 900;
}

/* Ghế đã bán (chỉ xuất hiện khi thực sự đã bán) */
.seat-item.seat-sold {
  background-color: var(--sold-color) !important;
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.seat-item.seat-sold::after {
  display: none;
}

.seat-item.seat-sold .seat-num {
  color: #475569;
}

/* Bàn kỹ thuật FOH */
.foh-container {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.foh-box {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  padding: 6px 20px;
  border-radius: 4px;
  color: var(--text-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Cổng Check-in dọc bên cánh trái */
.checkin-gate {
  position: absolute;
  left: 18px;
  top: 310px; /* Ngang hàng G, H, I (vùng GOLD) */
  z-index: 10;
}

.gate-arch {
  background-color: #dc2626;
  color: #ffffff;
  padding: 16px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gate-sign {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
}

.gate-arrow {
  color: #ffffff;
}

/* Tooltip thông tin ghế (Nền trắng sang trọng) */
.seat-tooltip {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%) scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 1000;
  min-width: 160px;
}

.seat-tooltip.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) scale(1);
}

.seat-tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #ffffff transparent;
}

.tt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 4px;
  font-weight: 800;
}

.tt-seat-id {
  font-size: 13px;
  color: var(--primary);
}

.tt-tier {
  font-size: 11px;
}

.tt-body .tt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.tt-body .tt-row strong {
  color: var(--text-main);
}

/* ================= RESPONSIVE MOBILE SEATMAP ================= */
@media (max-width: 768px) {
  .seatmap-toolbar {
    padding: 8px 10px;
    gap: 8px;
  }
  .map-status-legend {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .legend-badge {
    font-size: 11px;
    gap: 4px;
  }
  .legend-dot {
    width: 12px;
    height: 12px;
  }
  .map-controls-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 3px;
    background: var(--bg-muted);
  }
  .btn-map-tool {
    padding: 6px 2px;
    font-size: 11px;
    white-space: nowrap;
    justify-content: center;
    gap: 4px;
    border-radius: 4px;
    min-width: 0;
  }
  .btn-map-tool svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }
  .btn-map-tool span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .seatmap-viewport {
    height: 540px;
  }
}
