/* ==========================================================================
   호스피스 병원 지도 & 2-in-1 테이블 뷰 전용 스타일시트 (hospital-map.css)
   - 공식 5단계 BI 세이지 그린 (#2D6A4F) 및 목업 규격 100% 준수
   - 300줄 레고 블록 상한제 준수
   ========================================================================== */

/* 컨테이너 및 뷰 토글 헤더 */
#hospital-map-view {
  margin: -20px -16px;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  display: flex;
  flex-direction: column;
}

.hospital-map-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}

.hosp-header-bar {
  padding: 10px 16px 8px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.hosp-header-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hosp-view-toggle {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 20px;
  gap: 2px;
}

.hosp-toggle-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
}

.hosp-toggle-btn.active {
  background: #2d6a4f;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.25);
}

/* 4대 서비스 유형 필터 칩 바 */
.hosp-filter-bar {
  padding: 8px 12px;
  background: #ffffff;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: none;
  scrollbar-width: none;
  flex-shrink: 0;
}

.hosp-filter-bar::-webkit-scrollbar {
  display: none;
}

.hosp-chip {
  padding: 6px 12px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 700;
  border-radius: 18px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hosp-chip.active-green {
  background: #3E6553;
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(62, 101, 83, 0.3);
}

.hosp-chip.active-orange {
  background: #D97757;
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(217, 119, 87, 0.3);
}

.hosp-chip .badge-cnt {
  font-size: 10px;
  opacity: 0.85;
}

/* 법적 가드레일 배너 */
.hosp-legal-banner {
  margin: 8px 12px 0;
  background: #eff6ff;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11px;
  color: #1e3a8a;
  line-height: 1.4;
  flex-shrink: 0;
}

/* 뷰 컨테이너 */
.hosp-view-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* --- [화면 1] 지도 뷰 (hospital-map-view) --- */
.hosp-map-card {
  margin: 10px 12px;
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  position: relative;
  flex-shrink: 0;
}

.hosp-map-canvas {
  position: relative;
  width: 100%;
  max-width: 370px;
  margin: 0 auto;
  aspect-ratio: 346 / 568;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hosp-korea-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 프리미엄 플랫 물방울 맵 핀 (Drop Pin) - 과도한 그림자 제거 및 2번째 레퍼런스 100% 일치 */
.hosp-drop-pin {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -32px);
  /* 핀 꼬리 침 끝이 정확한 좌표를 가리키도록 정렬 */
  cursor: pointer;
  z-index: 5;
  color: #50555a;
  /* 레퍼런스 맵의 단정한 차콜 그레이 */
  transition: transform 0.15s ease, color 0.15s ease;
  user-select: none;
}

.hosp-drop-pin .pin-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  /* 군더더기 없는 미세 1px 그림자 */
}

.hosp-drop-pin .pin-marker-icon svg {
  display: block;
  width: 26px;
  height: 33px;
}

.hosp-drop-pin .pin-label-text {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  margin-top: 2px;
  letter-spacing: -0.5px;
  pointer-events: none;
  text-shadow: 0 0 3px #ffffff;
  /* 가독성을 위한 최소한의 얇은 외곽선만 유지 */
}

.hosp-drop-pin:hover {
  transform: translate(-50%, -33px) scale(1.03);
  z-index: 1000 !important;
}

.hosp-drop-pin.active-pin {
  color: #4e6587;
  /* 레퍼런스 맵 2번째 전남광주와 100% 동일한 부드러운 로열 블루 */
  transform: translate(-50%, -35px) scale(1.1);
  z-index: 25;
}

.hosp-drop-pin.active-pin .pin-marker-icon {
  filter: drop-shadow(0 2px 5px rgba(78, 101, 135, 0.4));
}

.hosp-drop-pin.active-pin .pin-label-text {
  color: #0f172a;
  font-weight: 800;
}

/* 사용자 제공 2번째 레퍼런스 맵 1:1 정밀 실측 좌표 (346x568 기준) */
.pin-gangwon {
  top: 16.0%;
  left: 58.0%;
}

.pin-seoul {
  top: 20.5%;
  left: 24.5%;
}

.pin-incheon {
  top: 22.5%;
  left: 12.5%;
}

.pin-gyeonggi {
  top: 23.5%;
  left: 39.5%;
}

.pin-chungbuk {
  top: 35.0%;
  left: 45.0%;
}

.pin-sejong {
  top: 39.0%;
  left: 30.5%;
}

.pin-chungnam {
  top: 48.0%;
  left: 22.5%;
}

.pin-daejeon {
  top: 46.5%;
  left: 37.5%;
}

.pin-gyeongbuk {
  top: 41.0%;
  left: 73.0%;
}

.pin-daegu {
  top: 55.5%;
  left: 68.0%;
}

.pin-jeonbuk {
  top: 59.0%;
  left: 32.0%;
}

.pin-ulsan {
  top: 60.0%;
  left: 86.0%;
}

.pin-gyeongnam {
  top: 68.5%;
  left: 59.0%;
}

.pin-busan {
  top: 69.5%;
  left: 80.0%;
}

.pin-gwangju-jeonnam {
  top: 71.0%;
  left: 21.0%;
}

.pin-jeju {
  top: 92.5%;
  left: 34.0%;
}

/* 지도 하단 선택 지역 병원 목록 리스트 */
.hosp-region-summary {
  padding: 0 12px 20px;
}

.hosp-region-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin: 10px 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hosp-card-item {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hosp-card-item:hover,
.hosp-card-item.selected {
  border: none;
  box-shadow: 0 4px 14px rgba(62, 101, 83, 0.16);
  background: #fafffc;
}

.hosp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.hosp-card-name {
  font-size: var(--font-size-base, 14px);
  font-weight: 800;
  color: #0f172a;
}

.hosp-card-type {
  font-size: var(--font-size-xs, 10.5px);
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
}

.hosp-service-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pill-sm {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.pill-admission {
  background: #fee2e2;
  color: #b91c1c;
}

.pill-home {
  background: #dcfce7;
  color: #15803d;
}

.pill-counsel {
  background: #e0f2fe;
  color: #0369a1;
}

.pill-child {
  background: #fef3c7;
  color: #b45309;
}

.pill-caregiver {
  background: #ecfdf5;
  color: #1b4332;
  border: 1px solid #6ee7b7;
  font-weight: 800;
}

/* --- [화면 2] 테이블 뷰 (hospital-table-view) --- */
.hosp-table-section {
  padding: 10px 12px 24px;
  flex: 1;
}

.hosp-table-wrapper {
  background: #ffffff;
  border-radius: 12px;
  border: none;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 420px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.hosp-data-table {
  width: 100%;
  min-width: 580px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  text-align: center;
}

.hosp-data-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  padding: 9px 4px;
  border-bottom: 2px solid #94a3b8;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.hosp-data-table td {
  padding: 8px 4px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  color: #1e293b;
}

.hosp-data-table tr {
  cursor: pointer;
  transition: background 0.12s;
}

.hosp-data-table tr:hover {
  background: #f0fdf4;
}

.hosp-data-table tr.selected-row {
  background: #ecfdf5 !important;
  outline: 2px solid #2d6a4f;
}

.dot-on {
  color: #ea580c;
  font-weight: 900;
  font-size: 12px;
}

.dot-off {
  color: #cbd5e1;
  font-size: 10px;
}

/* --- 상세 인스펙터 카드 (테이블 하단) --- */
.hosp-inspector-card {
  margin: 10px 12px 16px;
  padding: 14px;
  background: #ffffff;
  border-radius: 14px;
  border: 1.5px solid #2d6a4f;
  box-shadow: 0 4px 15px rgba(45, 106, 79, 0.12);
  animation: hospFadeIn 0.2s ease;
}

@keyframes hospFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.insp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.insp-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.insp-call-btn {
  background: #2d6a4f;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.25);
}

.insp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
}

.insp-meta-item strong {
  color: #475569;
}

.insp-intro-box {
  background: #f1f5f9;
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
  color: #334155;
  line-height: 1.45;
  margin-top: 8px;
}

/* ==========================================================================
   Step 9.9 확대·축소 도로 지도 및 펄스 마커 스타일
   ========================================================================== */
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0.2; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.user-pulse-marker {
  background: transparent !important;
  border: none !important;
}

.hosp-drop-pin {
  background: transparent !important;
  border: none !important;
}

.road-map-floating-controls button:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

@keyframes hospFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hospSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}