/* ── 기본 ── */
body {
  font-family: "Malgun Gothic", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
}

/* ── 컨테이너 ── */
.container {
  max-width: 650px;
  margin: 30px auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

/* ── 헤더 ── */
.header-area {
  background: #e2e8f0;
  padding: 25px;
  margin: 15px;
  border-radius: 15px;
  text-align: left;
}

.title-box {
  background: #4a5568;
  color: #fff;
  padding: 12px 0 12px 10px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.sub-text {
  color: #334155;
  font-size: 14px;
  font-weight: bold;
  display: block;
  padding-left: 5px;
}

/* ── 필터 ── */
.filter-section {
  padding: 15px;
  margin: 0 15px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 15px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 60px;
  gap: 6px;
}

.label-box {
  border: 1px solid #cbd5e1;
  padding: 6px 2px;
  border-radius: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  background: #fff;
  color: #4a5568;
  margin-bottom: 5px;
}

select {
  width: 100%;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  text-align-last: center;
}

option {
  text-align: left;
}

.btn-search {
  background: #4a5568;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
}

/* ── 지도 ── */
#map {
  width: calc(100% - 30px);
  height: 450px;
  margin: 0 15px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

/* ── 상세 박스 래퍼 ── */
.detail-wrapper {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  box-sizing: border-box;
  position: relative;
}

/* ── 상세 박스 ── */
.detail-box {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 15px 15px 40px 15px;
  border-radius: 10px;
  font-size: 13px;
  min-height: 150px;
  overflow: hidden;
  transition:
    flex 0.3s ease,
    background-color 0.3s ease,
    border 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.detail-box.expanded {
  flex: 4;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.detail-box.shrunk {
  flex: 1;
  opacity: 0.7;
}

/* ── 스크롤 텍스트 ── */
.scroll-field {
  white-space: nowrap;
  margin-bottom: 5px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expanded .scroll-field {
  width: max-content;
  overflow: visible;
  text-overflow: clip;
}

/* ── 스크롤바 ── */
.detail-box::-webkit-scrollbar {
  display: block;
  height: 6px;
}

.detail-box::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* ── 확대 버튼 ── */
.expand-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  color: #475569;
  z-index: 20;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.expanded .expand-btn {
  position: sticky;
  left: 100%;
  margin-left: auto;
  margin-top: auto;
  transform: none;
}

.expand-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: scale(1.1);
}

.expand-btn:active {
  transform: scale(0.9);
}

/* ── 페이지네이션 ── */
#pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 15px 0 20px;
  background: #f8fafc;
}
