/**
 * [Purpose] : 홈 화면의 지도 위 컨트롤(버튼, 배지, 범례) 및 하단 필터 섹션(태그, 유형, 날짜)의 세부 스타일을 정의하는 스타일시트
 * [Dependencies] : index.html (템플릿), home_data.js (필터 적용), home_ai.js (AI 검색 UI), Kakao Maps SDK
 * [Data Flow] : N/A (상수 및 스타일 정의)
 * [Side Effects] : 
 *   - UI (DOM) 스타일링: 지도 위 버튼(.map-btn), 모드 전환 배지(.mode-badge), 범례(.legend-box) 및 각종 필터 칩(Tag/Type Chip) 제어
 *   - 상태 피드백: 필터 변경 시 '적용' 버튼에 .dirty 클래스를 추가하여 시각적 강조(.ctrl-apply-btn.dirty)
 * [Constraints / Notes] : 
 *   - 상단 컨트롤: .map-top-left는 absolute 포지셔닝으로 지도 왼쪽 상단에 고정됨
 *   - AI 입력창: .ai-prompt-input은 resize: none 속성으로 사용자의 임의 크기 조절을 차단함
 *   - 필터 칩: .tag-chip 및 .type-chip은 .selected 클래스 여부에 따라 배경색과 폰트 굵기가 변경됨
 */

/* ─── 전체 표시 체크박스 ──────────────────────── */
.ctrl-show-all {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #a0aec0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ctrl-show-all input[type=checkbox] {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #1a73e8;
}

/* ─── 적용 버튼 (dirty 상태일 때만 파란색) ─────── */
.ctrl-apply-btn {
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  background: #2d3748;
  color: #718096;
  border: 1px solid #4a5568;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
}

.ctrl-apply-btn:disabled {
  background: #1e2533;
  color: #4a5568;
  border-color: #2d3748;
  cursor: not-allowed;
  opacity: 0.6;
}

.ctrl-apply-btn.dirty,
.ctrl-apply-btn:not(:disabled):hover {
  background: #1a73e8;
  border-color: #1a73e8;
  color: white;
}

.ctrl-reset-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: transparent;
  color: #718096;
  border: 1px solid #4a5568;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 6px;
  transition: all .15s;
}

.ctrl-reset-btn:hover {
  border-color: #a0aec0;
  color: #a0aec0;
}

/* ctrl-body / ctrl-view 제거됨 — ctrl-col-body 사용 */

.tag-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  background: #2d3748;
  border: 1px solid #4a5568;
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 11px;
  outline: none;
  margin: 5px 0 6px;
  transition: border-color .15s;
}

.tag-search-input:focus {
  border-color: #1a73e8;
}

.tag-search-input::placeholder {
  color: #4a5568;
}

/* ─── AI 뷰 ───────────────────────────────────── */
.ai-view-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.ai-input-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-prompt-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px solid #4a5568;
  background: #2d3748;
  color: #e2e8f0;
  border-radius: 5px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: border-color .15s;
}

.ai-prompt-input:focus {
  border-color: #1a73e8;
}

.ai-prompt-input::placeholder {
  color: #4a5568;
}

.ai-search-btn {
  width: 100%;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ai-search-btn:hover {
  background: #1558b0;
}

.ai-search-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ai-status {
  font-size: 11px;
  color: #718096;
  line-height: 1.5;
}

/* ─── 레이어 뷰 ───────────────────────────────── */
.layer-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  color: #4a5568;
  gap: 4px;
}

.ctrl-section {
  min-width: 160px;
  padding: 8px 14px;
  border-right: 1px solid #2d3748;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-section:last-child {
  border-right: none;
  flex: 1;
}

.ctrl-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #718096;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* ─── 태그 칩 ─────────────────────────────────── */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  border: 1px solid #4a5568;
  color: #a0aec0;
  background: transparent;
  transition: all .12s;
  white-space: nowrap;
}

.tag-chip:hover {
  border-color: #718096;
  color: #cbd5e0;
}

.tag-chip.selected {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #ffffff;
  font-weight: 600;
}

/* ─── 유형 체크박스 ──────────────────────────── */
.type-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 3px;
}

.type-chip {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  border: 1px solid #4a5568;
  color: #a0aec0;
  background: transparent;
  transition: all .12s;
  white-space: nowrap;
}

.type-chip.selected {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #ffffff;
  font-weight: 600;
}

/* ─── 날짜 입력 ───────────────────────────────── */
.ctrl-date-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.ctrl-date-row label {
  color: #718096;
  white-space: nowrap;
}

.ctrl-date-row input[type=date] {
  background: #2d3748;
  border: 1px solid #4a5568;
  color: #e2e8f0;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  width: 126px;
}

.ctrl-date-row input[type=date]:focus {
  outline: none;
  border-color: #1a73e8;
}

/* ─── 색상/농도 ───────────────────────────────── */
.ctrl-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.ctrl-color-row label {
  color: #718096;
  white-space: nowrap;
  min-width: 40px;
}

.ctrl-toggle {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #4a5568;
}

.ctrl-toggle button {
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #718096;
  transition: all .12s;
}

.ctrl-toggle button.active {
  background: #1a73e8;
  color: white;
}

input[type=color].ctrl-color-picker {
  width: 28px;
  height: 22px;
  border: none;
  padding: 0;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
}

.ctrl-slider {
  width: 100%;
  accent-color: #1a73e8;
}

.ctrl-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.ctrl-slider-row label {
  color: #718096;
  white-space: nowrap;
  min-width: 40px;
}

.ctrl-slider-row span {
  color: #e2e8f0;
  min-width: 28px;
  text-align: right;
}

/* ─── 지도 위 컨트롤들 ───────────────────────── */
.map-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-btn {
  background: white;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
  white-space: nowrap;
}

.map-btn:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-btn.active {
  background: #1a73e8;
  color: white;
}

.map-btn i {
  font-size: 13px;
}

#measure-result {
  position: absolute;
  bottom: 54px;
  left: 12px;
  z-index: 20;
  background: white;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #222;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  display: none;
  align-items: center;
  gap: 10px;
}

#measure-result span {
  color: #1a73e8;
  font-weight: 700;
}

#measure-result button {
  background: none;
  border: none;
  color: #888;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}

/* ─── 모드 전환 배지 ──────────────────────────── */
.mode-badge {
  background: white;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}

.mode-badge:hover {
  transform: scale(1.04);
}

.badge-to-public {
  background: #27ae60;
  color: white;
}

.badge-to-admin {
  background: #e74c3c;
  color: white;
}

/* ─── 범례 ────────────────────────────────────── */
.legend-box {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 20;
  background: white;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 12px;
  line-height: 2.1;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

