/* ============================================================
   부동산플러스 — style.css (Clean Editorial)
   ============================================================ */

:root {
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #111827;
  --sub: #6B7280;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-bg: #EFF6FF;
  --border: #E5E7EB;
  --red: #DC2626;
  --green: #059669;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 14px rgba(0,0,0,0.025);
  --max-w: 1280px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Container ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── NAV ── */
nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.logo:hover { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { font-size: 13px; font-weight: 500; color: var(--sub); padding: 6px 14px; border-radius: 8px; transition: all 0.15s; }
.nav-links a:hover { color: var(--text); background: #F3F4F6; }
.nav-links a.active { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.nav-mobile-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 4px; }
.nav-mobile-btn span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 1px; }

/* ── HERO ── */
.hero { max-width: var(--max-w); margin: 0 auto; padding: 44px 24px 28px; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.3; margin-bottom: 8px; }
.hero p { font-size: 15px; color: var(--sub); margin-bottom: 24px; }

/* ── Search ── */
.search-box { display: flex; gap: 8px; max-width: 600px; }
.search-box input { flex: 1; height: 50px; border: 2px solid var(--border); border-radius: var(--radius); padding: 0 18px; font-size: 15px; font-family: inherit; outline: none; background: #fff; transition: border 0.15s; }
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: #9CA3AF; }
.search-box button { height: 50px; padding: 0 26px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.search-box button:hover { background: var(--accent-hover); }

/* ── Stats Row ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: var(--max-w); margin: 0 auto; padding: 0 24px 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 11px; color: var(--sub); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat-value-sm { font-size: 17px !important; }
.stat-change { font-size: 11px; font-weight: 700; margin-top: 2px; }
.stat-change.up, .up { color: var(--red); }
.stat-change.down, .down { color: var(--green); }
.stat-change.muted { color: var(--sub); }

/* ── Content Layout ── */
.content { max-width: var(--max-w); margin: 0 auto; padding: 0 24px 36px; display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.content-main { display: flex; flex-direction: column; gap: 16px; }

/* ── Card ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.section-more { font-size: 12px; color: var(--accent); font-weight: 600; }
.section-more:hover { text-decoration: underline; }
.card-desc { font-size: 13px; color: var(--sub); line-height: 1.7; margin-bottom: 12px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 8px; color: var(--sub); font-weight: 500; font-size: 11px; border-bottom: 2px solid var(--border); text-transform: uppercase; letter-spacing: 0.3px; }
td { padding: 10px 8px; border-bottom: 1px solid #F3F4F6; }
tr:hover td { background: #FAFBFC; }
.text-right { text-align: right; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.price-delta { font-size: 11px; margin-left: 4px; }
.empty-msg { text-align: center; color: var(--sub); padding: 32px 0; font-size: 13px; }

/* ── Badge ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.2px; }
.badge-apt { background: #DBEAFE; color: #1E40AF; }
.badge-rent { background: #D1FAE5; color: #065F46; }
.badge-land { background: #FEF3C7; color: #92400E; }
.badge-jeonse { background: #DBEAFE; color: #1E40AF; }
.badge-wolse { background: #FEF3C7; color: #92400E; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-count { background: #F3F4F6; color: var(--sub); font-size: 11px; padding: 3px 10px; }

/* ── Region Grid ── */
.region-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.region-btn { padding: 12px 8px; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.region-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); transform: translateY(-1px); }
.region-btn .cnt { display: block; font-size: 10px; color: var(--sub); font-weight: 400; margin-top: 2px; }

/* ── Sidebar ── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.hot-item { display: flex; align-items: center; padding: 9px 0; border-bottom: 1px solid #F3F4F6; gap: 10px; }
.hot-item:last-child { border: none; }
.hot-rank { width: 22px; height: 22px; background: var(--text); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.hot-name { flex: 1; font-size: 13px; font-weight: 500; }
.hot-name:hover { color: var(--accent); }
.hot-price { font-size: 13px; font-weight: 700; }

/* ── Button ── */
.btn-accent { display: inline-block; padding: 8px 16px; background: var(--accent-bg); color: var(--accent); border-radius: 8px; font-size: 13px; font-weight: 600; transition: background 0.15s; }
.btn-accent:hover { background: #DBEAFE; }

/* ── Ad Slot ── */
.ad-slot { background: #F3F4F6; border: 2px dashed #D1D5DB; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; min-height: 90px; overflow: hidden; }
.ad-placeholder { color: var(--sub); font-size: 12px; font-weight: 500; }
.ad-horizontal { min-height: 90px; }
.ad-vertical { min-height: 600px; width: 160px; }
.ad-rect { min-height: 250px; }
.ad-side { position: fixed; top: 50%; transform: translateY(-50%); width: 160px; z-index: 50; }
.ad-side.left { left: 0; }
.ad-side.right { right: 0; }

/* ── Detail Page ── */
.breadcrumb { padding: 16px 0 8px; font-size: 12px; color: var(--sub); }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 0 24px; gap: 24px; flex-wrap: wrap; }
.detail-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.detail-sub { font-size: 14px; color: var(--sub); margin-top: 4px; }
.detail-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dtag { padding: 4px 10px; background: #F3F4F6; border-radius: 6px; font-size: 12px; color: var(--sub); font-weight: 500; }

.detail-price-box { text-align: right; flex-shrink: 0; }
.detail-price-label { font-size: 12px; color: var(--sub); font-weight: 500; }
.detail-price-value { font-size: 36px; font-weight: 800; letter-spacing: -1px; color: var(--accent); }
.detail-price-value .unit { font-size: 18px; font-weight: 600; margin-left: 2px; }
.detail-price-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }

.chart-container { position: relative; height: 320px; }
.chart-container-sm { position: relative; height: 200px; }
.chart-filter { display: flex; gap: 4px; }
.chart-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; color: var(--sub); transition: all 0.15s; }
.chart-btn.active, .chart-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.area-stat-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid #F3F4F6; font-size: 13px; }
.area-stat-item:last-child { border: none; }
.area-label { width: 60px; font-weight: 600; }
.area-value { flex: 1; font-weight: 700; }
.area-count { color: var(--sub); font-size: 11px; }

/* ── Permit Page ── */
.permit-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.permit-filter select { height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff; cursor: pointer; }

.permit-calendar { display: flex; align-items: stretch; gap: 0; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-arrow { width: 36px; background: none; border: none; cursor: pointer; font-size: 16px; color: var(--sub); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.cal-arrow:hover { background: #F3F4F6; }
.cal-days { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; }
.cal-days::-webkit-scrollbar { display: none; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 8px; min-width: 70px; flex: 1; text-decoration: none; color: var(--text); border-right: 1px solid #F3F4F6; transition: background 0.15s; gap: 2px; }
.cal-day:last-child { border-right: none; }
.cal-day:hover { background: #F9FAFB; }
.cal-day.selected { background: var(--accent-bg); }
.cal-day.today { position: relative; }
.cal-day.today::after { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.cal-day.sun { color: var(--red); }
.cal-day.sat { color: var(--accent); }
.cal-day-name { font-size: 11px; color: var(--sub); font-weight: 500; }
.cal-day-num { font-size: 20px; font-weight: 800; }
.cal-permit-cnt { font-size: 10px; color: var(--red); font-weight: 600; }
.cal-cancel-cnt { font-size: 9px; color: var(--sub); }

.permit-summary { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 14px; }
.permit-date-label { font-weight: 700; }
.permit-total { color: var(--sub); }
.permit-total strong { color: var(--accent); }

.permit-list { display: flex; flex-direction: column; gap: 0; }
.permit-item { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow); transition: border-color 0.15s; cursor: pointer; }
.permit-item:hover { border-color: var(--accent); }
.permit-complex-name { font-size: 16px; font-weight: 700; }
.permit-complex-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.permit-item-right { display: flex; align-items: center; gap: 10px; }
.permit-badge { padding: 4px 12px; background: var(--accent-bg); color: var(--accent); border-radius: 8px; font-size: 12px; font-weight: 600; }
.permit-arrow { font-size: 20px; color: #D1D5DB; }
.permit-empty { text-align: center; padding: 48px 0; color: var(--sub); font-size: 14px; }

/* ── Footer ── */
footer { background: #111827; color: #6B7280; padding: 36px 24px; font-size: 12px; margin-top: 40px; line-height: 1.8; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-inner strong { color: #D1D5DB; }

/* ── Trade List Additions ── */
.page-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; flex-wrap: wrap; gap: 12px; }
.page-header-right { display: flex; align-items: center; gap: 8px; }
.tab-pills { display: flex; gap: 4px; }
.tab-pill { padding: 6px 16px; border-radius: 50px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--border); background: var(--card); color: var(--sub); transition: all 0.15s; }
.tab-pill:hover, .tab-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-bar { display: flex; align-items: center; gap: 12px; padding: 0 0 16px; }
.filter-bar select { height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff; cursor: pointer; }
.filter-count { font-size: 13px; color: var(--sub); }
.filter-count strong { color: var(--text); }
.trade-link { color: var(--text); font-weight: 500; }
.trade-link:hover { color: var(--accent); text-decoration: underline; }
.text-sub { color: var(--sub); font-size: 12px; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 20px 0 4px; }
.pagination a { display: flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--sub); transition: all 0.15s; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
