/* ═══════════════════════════════════════════════
   부동산 매물 검색 - 다크 테마
   ═══════════════════════════════════════════════ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css');

:root {
	--bg-primary:   #0d1117;
	--bg-secondary: #0f1420;
	--bg-card:      #111827;
	--bg-input:     #1a1f2e;
	--border:       #1e2533;
	--border-input: #2a3040;
	--text-primary: #f3f4f6;
	--text-body:    #d1d5db;
	--text-muted:   #6b7280;
	--text-dim:     #4b5563;
	--accent-blue:  #2563eb;
	--accent-light: #60a5fa;
	--color-up:     #ef4444;
	--color-down:   #3b82f6;
	--color-same:   #64748b;
}

/* ── 기본 레이아웃 ── */
body.land-dark {
	background: var(--bg-primary);
	color: var(--text-body);
	font-family: 'Pretendard', -apple-system, 'Segoe UI', sans-serif;
	margin: 0;
	overflow-x: hidden;
}

/* ── 헤더 ── */
.land-header {
	padding: 14px 24px;
	border-bottom: 1px solid var(--border);
	background: var(--bg-primary);
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.land-header h1 {
	font-size: 15px;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: -0.02em;
	margin: 0;
}
.land-header .info-text {
	font-size: 11px;
	color: var(--text-dim);
}

/* ── 필터 영역 ── */
.filter-panel {
	padding: 16px 24px;
	border-bottom: 1px solid var(--border);
	background: var(--bg-secondary);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.filter-row {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	flex-wrap: wrap;
}
.filter-item {
	min-width: 130px;
	flex: 1;
	max-width: 180px;
}
.filter-item-wide {
	max-width: 220px;
}
.filter-item label,
.filter-panel label {
	font-size: 13px;
	color: #9ca3af;
	margin-bottom: 4px;
	display: block;
	font-weight: 500;
}
.filter-item input,
.filter-item select {
	background: var(--bg-input);
	border: 1px solid var(--border-input);
	border-radius: 6px;
	color: var(--text-body);
	padding: 7px 10px;
	font-size: 13px;
	outline: none;
	width: 100%;
	font-family: inherit;
}
.filter-item select {
	cursor: pointer;
}
.filter-item input:focus,
.filter-item select:focus {
	border-color: var(--accent-blue);
}
.filter-item input::placeholder {
	color: var(--text-dim);
}

/* 범위 입력 (최소 ~ 최대) */
.range-wrap {
	display: flex;
	gap: 4px;
	align-items: center;
}
.range-wrap input {
	background: var(--bg-input);
	border: 1px solid var(--border-input);
	border-radius: 6px;
	color: var(--text-body);
	padding: 7px 10px;
	font-size: 13px;
	outline: none;
	width: 100%;
	font-family: inherit;
}
.range-wrap input:focus {
	border-color: var(--accent-blue);
}
.range-wrap input::placeholder {
	color: var(--text-dim);
}
.range-wrap .sep {
	color: #4b5563;
	font-size: 12px;
	flex-shrink: 0;
}

/* 체크박스 커스텀 */
.filter-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-bottom: 8px;
	white-space: nowrap;
}
.filter-check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--accent-blue);
	cursor: pointer;
}
.filter-check label {
	font-size: 13px !important;
	color: var(--text-body) !important;
	margin: 0 !important;
	cursor: pointer;
}

/* 버튼 */
.filter-actions {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding-bottom: 1px;
}
.btn-search {
	background: var(--accent-blue);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 22px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
	white-space: nowrap;
}
.btn-search:hover {
	background: #1d4ed8;
}
.btn-reset {
	background: var(--bg-input);
	color: #9ca3af;
	border: 1px solid var(--border-input);
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
	white-space: nowrap;
}
.btn-reset:hover {
	background: #232a3b;
}

/* ── 그리드 영역 ── */
.grid-wrap {
	flex: 1;
	overflow: auto;
}

/* Toast UI Grid 다크테마 오버라이드 */
.grid-wrap .tui-grid-container {
	background: var(--bg-primary) !important;
	border: none !important;
}
.grid-wrap .tui-grid-header-area {
	background: var(--bg-card) !important;
	border-bottom: 1px solid var(--border) !important;
}
.grid-wrap .tui-grid-cell-header {
	background: var(--bg-card) !important;
	border-right: 1px solid var(--border) !important;
	border-bottom: 1px solid var(--border) !important;
	color: #9ca3af !important;
	font-size: 11px !important;
	font-weight: 600 !important;
}
.grid-wrap .tui-grid-cell {
	background: var(--bg-primary) !important;
	border-right: 1px solid var(--border) !important;
	border-bottom: 1px solid var(--border) !important;
	color: var(--text-body) !important;
	font-size: 12px !important;
}
.grid-wrap .tui-grid-cell.tui-grid-cell-current-row {
	background: #1e2a3a !important;
}
.grid-wrap .tui-grid-cell:hover {
	background: #131a27 !important;
}
.grid-wrap .tui-grid-body-area {
	background: var(--bg-primary) !important;
}
.grid-wrap .tui-grid-border-line-top,
.grid-wrap .tui-grid-border-line-bottom,
.grid-wrap .tui-grid-border-line-left,
.grid-wrap .tui-grid-border-line-right {
	background: var(--border) !important;
}
.grid-wrap .tui-grid-scrollbar-y-inner-border,
.grid-wrap .tui-grid-scrollbar-x-inner-border,
.grid-wrap .tui-grid-scrollbar-right-top,
.grid-wrap .tui-grid-scrollbar-left-bottom,
.grid-wrap .tui-grid-scrollbar-right-bottom {
	background: var(--bg-primary) !important;
	border-color: var(--border) !important;
}
.grid-wrap .tui-grid-layer-focus-border {
	background: var(--accent-blue) !important;
}
.grid-wrap .tui-grid-pagination-btn {
	color: var(--text-body) !important;
}
.grid-wrap .tui-grid-content-before {
	color: var(--text-dim) !important;
}
.grid-wrap .tui-grid-layer-selection {
	background: rgba(37, 99, 235, 0.15) !important;
}

/* ── 거래유형 뱃지 ── */
.trade-badge {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
}
.trade-sell  { background: #1e3a5f; color: #60a5fa; }
.trade-lease { background: #2d1b4e; color: #a78bfa; }
.trade-rent  { background: #3b2410; color: #fb923c; }

/* 가격변동 */
.price-up   { color: var(--color-up);   font-weight: 600; }
.price-down { color: var(--color-down); font-weight: 600; }
.price-same { color: var(--color-same); font-weight: 600; }

/* 그리드 내 버튼 */
.btn-grid-map {
	background: #1a3a1a;
	color: #4ade80;
	border: 1px solid #22543d;
	border-radius: 4px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
	text-decoration: none;
	display: inline-block;
}
.btn-grid-map:hover {
	background: #22543d;
	color: #4ade80;
	text-decoration: none;
}

/* ── 상세 패널 (그리드 하단) ── */
.detail-panel {
	border-top: 1px solid var(--border);
	background: var(--bg-card);
	display: none;
	animation: slideUp 0.2s ease;
}
.detail-panel.active {
	display: block;
}
@keyframes slideUp {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* 패널 헤더 */
.detail-header {
	padding: 10px 20px;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.detail-header .complex-name {
	font-size: 14px;
	font-weight: 700;
	color: var(--text-primary);
}
.detail-header .complex-sub {
	font-size: 11px;
	color: var(--text-muted);
	margin-top: 2px;
}
.detail-header .btn-close-panel {
	background: none;
	border: none;
	color: var(--text-muted);
	font-size: 18px;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
}
.detail-header .btn-close-panel:hover {
	color: var(--text-body);
}

/* 지도/로드뷰 토글 */
.map-toggle {
	display: flex;
	gap: 2px;
	padding: 8px 20px;
	background: var(--bg-secondary);
}
.map-toggle button {
	flex: 1;
	padding: 6px;
	border-radius: 5px;
	border: none;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
	background: var(--bg-input);
	color: #9ca3af;
	transition: all 0.15s;
}
.map-toggle button.active {
	background: var(--accent-blue);
	color: #fff;
}

/* 지도 영역 */
.map-area {
	height: 350px;
	position: relative;
	background: var(--bg-input);
}
.map-area #detailMap {
	width: 100%;
	height: 100%;
}

/* 요약 정보 */
.detail-info {
	padding: 12px 20px;
	border-top: 1px solid var(--border);
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 12px;
}
.detail-info .info-item .label {
	font-size: 10px;
	color: var(--text-muted);
}
.detail-info .info-item .value {
	font-size: 13px;
	color: var(--text-body);
	margin-top: 2px;
}
.detail-info .info-item .value.bold {
	font-weight: 700;
	color: var(--text-primary);
}

/* 외부 링크 버튼 */
.detail-links {
	padding: 8px 20px 14px;
	display: flex;
	gap: 8px;
}
.detail-links a {
	flex: 1;
	padding: 8px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: opacity 0.15s;
}
.detail-links a:hover {
	opacity: 0.85;
	text-decoration: none;
}
.link-naver-map {
	background: #1a3a1a;
	color: #4ade80 !important;
	border: 1px solid #22543d;
}
.link-naver-land {
	background: #1e293b;
	color: #60a5fa !important;
	border: 1px solid #1e3a5f;
}

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
