/* map.css */

/* TỔNG THỂ */
.bd-page-wrapper {
  padding: 32px 0; /* Giữ padding top/bottom, container đã lo padding 2 bên */
  font-family: "Mulish", sans-serif;
  color: #0f172a; /* text-slate-900 */
}

/* BỐ CỤC CHÍNH (Bootstrap Grid) */
.bd-row {
  /* Bootstrap rows have negative margins, let's keep standard gap behavior if needed */
}

/* UTILS */
.text-primary {
  color: #099344;
}
.text-green {
  color: #22c55e;
  font-weight: 700;
}
.text-gray {
  color: #6b7280;
  font-weight: 700;
}
.text-amber {
  color: #d97706;
  font-weight: 700;
}
.w-100 {
  width: 100%;
}

/* COMPONENTS CHUNG */
.bd-card {
  background: #fff;
  border: 1px solid #e2e8f0; /* border-border */
  border-radius: 16px; /* rounded-2xl */
  padding: 16px; /* p-4 */
  margin-bottom: 16px; /* space-y-4 */
}

.bd-sidebar .bd-card:first-child {
  max-height: 400px;
  overflow-y: auto; /* Dùng auto thay vì scroll để khi không cần thì tự ẩn */
  overflow-x: hidden;
  padding-right: 12px;
}
/* Custom Scrollbar cho danh sách khu vực */
.bd-sidebar .bd-card:first-child::-webkit-scrollbar {
  width: 6px;
}
.bd-sidebar .bd-card:first-child::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}
.bd-sidebar .bd-card:first-child::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
.bd-sidebar .bd-card:first-child::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.bd-card.card-transparent {
  background: transparent;
  border: none;
  padding: 0;
}

.bd-card-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
  margin-bottom: 16px;
  font-family: "Mulish";
}

/* SIDEBAR LỌC */
.bd-filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Nút Khu vực */
.bd-khu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 16px;
  background: #e8f5ee;
  outline: none !important;
}
.bd-khu-btn:hover {
  background-color: #e2e8f0 !important;
}
.bd-khu-btn.active,
.selected_filter {
  background-color: #099344 !important; /* Active: bg-primary (xanh) */
  color: #fff;
}
.bd-khu-count {
  font-size: 13px;
  font-weight: 400;
  color: #64748b !important; /* Inactive number: text-muted */
}
.bd-khu-btn.active .bd-khu-count,
.selected_filter .bd-khu-count {
  color: #bbf7d0 !important; /* Active number: light green */
}

a.bg-secondary:hover,
a.bg-secondary:focus,
button.bg-secondary:hover,
button.bg-secondary:focus,
a.bg-primary:hover,
a.bg-primary:focus,
button.bg-primary:hover,
button.bg-primary:focus {
  background-color: #099344 !important; /* Active: bg-primary (xanh) */
  outline: none;
}

.bd-filter-btn {
  display: flex;
  align-items: center;
  gap: 10px; /* gap-2.5 */
  width: 100%;
  padding: 8px 12px; /* py-2 px-3 */
  border-radius: 8px; /* rounded-lg */
  border: none;
  background: transparent;
  color: #64748b; /* text-muted-foreground */
  font-size: 14px; /* text-xs */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  outline: none !important;
}

.bd-filter-btn:hover {
  background: rgba(241, 245, 249, 0.5); /* hover:bg-secondary/50 */
}

.bd-filter-btn.active {
  background: #f1f5f9; /* bg-secondary */
  color: #fff; /* text-foreground */
  font-weight: 600; /* font-semibold */
}

.bd-status-dot {
  width: 12px; /* w-3 */
  height: 12px; /* h-3 */
  border-radius: 2px; /* rounded-sm */
}
.dot-all {
  background: #9ca3af; /* bg-gray-400 */
}
.dot-empty {
  background: #22c55e; /* bg-green-500 */
}
.dot-sold {
  background: #d1d5db; /* bg-gray-300 */
}
.dot-deposit {
  background: #fbbf24; /* bg-amber-400 */
}
.dot-export {
    background: #e595ff; /* bg-amber-400 */
}

.bd-stat-card {
  font-size: 14px; /* text-xs */
}
.bd-stat-card .bd-card-title {
  margin-bottom: 8px; /* mb-2 */
}
.bd-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0; /* py-1.5 */
  border-bottom: 1px solid #e2e8f0; /* border-border */
  font-size: 14px;
}
.bd-stat-row:last-child {
  border-bottom: none;
}
.bd-stat-label {
  color: #64748b; /* text-muted-foreground */
}

.bd-btn-primary {
  background: #099344; /* bg-primary */
  color: #fff;
  border: none;
  padding: 10px; /* py-2.5 */
  border-radius: 12px; /* rounded-xl */
  font-weight: 600; /* font-semibold */
  font-size: 14px; /* text-xs */
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px; /* gap-1.5 */
}
.bd-btn-primary:hover {
  background: #077937;
}

.bd-btn-warning {
  background: #f59e0b;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bd-btn-warning:hover {
  background: #d97706;
}
.bd-btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bd-btn-danger:hover {
  background: #b91c1c;
}

/* CỘT MAP */
.map-card {
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bd-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bd-map-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  font-family: "Mulish";
}

.bd-map-hint {
  font-size: 14px;
  color: #6b7280;
}

.bd-map-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.bd-row {
  margin: 0;
  position: relative;
}

#viewDiv {
  padding: 0;
  margin: 0;
  height: 80vh;
  width: 100%;
}

/* Compass */
#compass {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 100px;
  height: 100px;
  z-index: 10;
  pointer-events: none;
}
.compass-ring {
  width: 100%;
  height: 100%;
  border: 2px solid #333;
  border-radius: 50%;
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}
.needle {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 4px;
  height: 80px;
  transform: translateX(-50%);
}
.north {
  width: 100%;
  height: 50%;
  background: #ef4444;
  border-radius: 2px 2px 0 0;
}
.south {
  width: 100%;
  height: 50%;
  background: #3b82f6;
  border-radius: 0 0 2px 2px;
}
.label-n {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: #ef4444;
  font-weight: bold;
  font-size: 14px;
}
.label-s {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: #3b82f6;
  font-weight: bold;
  font-size: 14px;
}

/* CỘT DETAIL */
.detail-card {
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.sticky-panel {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.bd-detail-banner {
  position: relative;
  height: 144px;
  background: #f3f4f6;
}
.bd-detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bd-banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}
.bd-btn-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bd-btn-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

.bd-banner-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  color: #fff;
}
.bd-banner-label {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 2px;
}
.bd-banner-code {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 700;
}
.bd-badge-status {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  color: #fff;
}
.status-empty {
  background: #099344;
  color: #fff;
}
.status-sold {
  background: #e2e8f0;
  color: #475569;
}
.status-deposit {
  background: #f59e0b;
  color: #fff;
}

.bd-detail-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}
.bd-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}
.bd-tab:hover {
  color: #1e2939;
}
.bd-tab.active {
  color: #099344;
  border-bottom-color: #099344;
}

/* NỘI DUNG TABS */
.bd-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

/* TAB ĐẶT DỊCH VỤ */
.bd-service-desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
  padding: 0 16px;
  margin-top: 16px;
}
.bd-service-ma {
  font-weight: 700;
  color: #0f172a;
}
.bd-service-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 0 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bd-service-list::-webkit-scrollbar {
  width: 4px;
}
.bd-service-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.bd-service-list::-webkit-scrollbar-track {
  background: transparent;
}

.bd-service-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.bd-service-btn svg {
  flex-shrink: 0;
}
.bd-service-btn:hover {
  border-color: rgba(9, 147, 68, 0.4);
}
.bd-service-btn.active {
  border-color: #099344;
  background: #e8f5ee;
  color: #099344;
  font-weight: 600;
}

.bd-service-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px 16px;
}
.bd-btn-cancel {
  flex: 1;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}
.bd-btn-cancel:hover {
  background: #f1f5f9;
}

.bd-btn-confirm {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.bd-btn-confirm:hover {
  background: #077936;
}

/* TAB ĐẶT TRƯỚC */
.bd-reserve-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 450px;
  overflow: auto;
}
.bd-form-group.special-row {
  flex-direction: row !important;
  gap: 0;
  margin: 0 -4px;
}
.bd-form-group.special-row *[class*="col-"] {
  padding: 0 4px;
}
.bd-reserve-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}
.bd-reserve-desc span {
  font-weight: 700;
  color: #0f172a;
}
.bd-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bd-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}
.bd-form-control {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #0f172a;
  transition: all 0.2s;
  font-family: inherit;
}
.bd-form-control::placeholder {
  color: #94a3b8;
}
.bd-form-control:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4);
}
textarea.bd-form-control {
  resize: none;
}
.bd-alert-amber {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: #b45309;
}
.bd-alert-amber strong {
  font-weight: 700;
}
.bd-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.bd-btn-amber {
  flex: 1;
  background: #f59e0b;
  color: #fff;
  padding: 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.bd-btn-amber:hover {
  background: #d97706;
}

.bd-detail-body {
  padding: 16px;
}

.bd-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.bd-stat-box {
  background: rgba(243, 244, 246, 0.6);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.bd-stat-box-value {
  font-size: 18px;
  font-weight: 700;
  color: #1e2939;
}
.bd-stat-box-label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 2px;
}

.bd-info-rows {
  margin-bottom: 16px;
}
.bd-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.bd-info-row:last-child {
  border-bottom: none;
}
.bd-info-label {
  color: #6b7280;
}
.bd-info-value {
  font-weight: 600;
  text-align: right;
  max-width: 55%;
  color: #1e2939;
}

.bd-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.bd-thumb-grid img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f4f6;
}

.bd-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Absolute positioned Detail Panel */
.bd-detail-panel {
  position: absolute;
  bottom: 21px;
  right: 21px;
  height: auto; /* Padding/margin off edges */
  z-index: 100;
  max-width: 380px;
  pointer-events: none; /* Let clicks pass through empty space */
}

.bd-detail-panel > .detail-card {
  pointer-events: auto; /* Re-enable clicks on the card itself */
  height: 100%;
}

/* RESPONSIVE */
@media (max-width: 1199.98px) {
  .bd-detail-panel {
    position: relative;
    top: auto;
    right: auto;
    height: auto;
    margin-top: 24px;
    max-width: 100%;
  }
}
