/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

:root{
  --brand-600:#1976d2; /* 파란색 포인트 */
  --brand-700:#1565c0;
  --text-900:#222;
  --border:#e0e0e0;
  --bg-soft:#f7f8fa;
}

/* --- 상단 내비게이션 바 스타일 --- */
header {
    background-color: #ffffff;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1000;
}

/* 사이드바 토글 버튼 */
.sidebar-toggles {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-toggle-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.left-toggle {
    color: var(--brand-600);
}

.right-toggle {
    color: #ffc107;
}

/* 로고와 네비게이션을 중앙으로 이동 */
header .logo {
    margin-left: 100px; /* 토글 버튼 공간 확보 */
}

header nav {
    margin-right: 0;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    text-decoration: none;
}

header nav a {
    text-decoration: none;
    color: #555;
    margin-left: 20px;
    font-size: 1rem;
    font-weight: 500;
}

/* Header actions (right side) - e.g. MyPage button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-mypage {
    padding: 8px 16px;
    font-size: 0.95rem;
    border-radius: 6px;
    background-color: #2c7be5; /* slightly darker blue */
    color: #fff;
    text-decoration: none;
}
.btn-mypage:hover {
    background-color: #1f6fd8;
}

/* Checklist collapse styles used by scanner/search pages */
.checklist.collapsed {
    display: none;
}
.check-toggle {
    cursor: pointer;
    color: #2c7be5;
    user-select: none;
}
.checklist {
    transition: all 0.18s ease-in-out;
    list-style: none;
    padding: 12px 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}
.checklist::-webkit-scrollbar {
    width: 8px;
}
.checklist::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.checklist::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
.checklist::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
.checklist li {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1.5;
    flex-shrink: 0;
}
.checklist li:hover {
    background: #e9ecef;
    transform: translateX(4px);
}
.checklist li.checklist-important {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    font-weight: 600;
    color: #856404;
}
.checklist li.checklist-important:hover {
    background: #ffe69c;
}

/* --- 메인 콘텐츠 영역 스타일 --- */
main {
    padding: 0;
    margin: 0;
}

/* 공통 레이아웃 */
.container { 
    max-width: 640px; 
    margin: 48px auto; 
    padding: 0 16px; 
}

h1, h2, h3 { 
    margin: 0 0 12px; 
}

/* 버튼 스타일 통합 */
.btn {
    display: inline-block;
    background: #1565c0;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.10);
    transition: background 0.2s, transform 0.06s;
}

.btn:hover { 
    background: #1565c0; 
}

/* 네비게이션(공통) */
.site-header{
  position:sticky; top:0; z-index:1000;
  display:flex; align-items:center; gap:18px;
  padding:12px 16px; background:#fff; border-bottom:1px solid #eaeaea;
}
.site-header .logo{ font-weight:700; color:var(--brand-600); text-decoration:none; }
.nav{ display:flex; flex-wrap:wrap; gap:12px; }
.nav a{
  color:var(--text-900); text-decoration:none;
  padding:8px 10px; border-radius:6px;
  transition:color .15s, background .15s;
}
.nav a:hover{ background:#f3f7ff; color:var(--brand-700); }
.nav a.active{ color:#fff; background:var(--brand-600); }
@media (max-width:640px){
  .site-header{ flex-direction:column; align-items:flex-start; }
  .nav{ gap:8px; }
}

/* 히어로는 03_pages_index.css에서 처리 */

/* 폼 공통 */
.form-group{ margin-bottom:18px; }
label{ display:block; margin-bottom:7px; font-weight:500; color:#444; }
input[type="text"],
input[type="email"],
input[type="password"],
textarea{
  width:100%; padding:12px 14px;
  border:1.5px solid var(--border);
  border-radius:8px; font-size:1rem;
  background:#fafbfc; transition:border-color .2s, background .2s;
}
input:focus, textarea:focus{ border-color:var(--brand-600); outline:none; background:#fff; }
textarea{ resize:vertical; min-height:100px; font-family:inherit; }

/* 플래시/알림 */
.flash-messages{ margin-top:18px; text-align:center; }
.alert{
  background:#e3f2fd; color:#0d47a1;
  border-radius:8px; padding:12px 14px; font-size:1rem;
  box-shadow:0 2px 8px rgba(25,118,210,0.06); display:inline-block; margin-top:8px;
}

/* 문의하기 카드(about.html) */
.contact-card{
  background:#fff; border-radius:18px;
  box-shadow:0 4px 18px rgba(0,0,0,0.09);
  padding:32px 28px 24px 28px; margin-top:24px;
}
.contact-card h2{
  text-align:center; font-size:2rem; margin-bottom:12px;
  color:var(--brand-600); font-weight:700; letter-spacing:-1px;
}

/* --- SearchScan: 검색 바/버튼 스타일 --- */
#search-bar{
  width: min(720px, 100% - 32px);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.search-input-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1 1 360px;
  max-width: 520px;
}
#region-input{
  width: 100%;
  height: 40px;
  padding: 0 40px 0 14px; /* 우측 X 버튼 공간 */
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  transition: border-color .2s, background .2s;
  font-size: 15px;
}
#region-input:focus{
  outline: none;
  background: #fff;
  border-color: var(--brand-600);
}
.clear-btn-in{
  position: absolute;
  right: 6px;
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: #9aa0a6; border-radius: 50%;
  cursor: pointer;
}
.clear-btn-in:hover{ background:#f0f2f5; color:#5f6368; }
#search-btn.btn-search{
  height: 40px;
  padding: 0 16px;
}

/* 모바일 */
@media (max-width: 520px){
  #search-btn.btn-search{ width: 100%; }
}

@media (max-width:600px){
  .container{ padding:0 8px; margin:32px auto; }
  .contact-card{ padding:18px 12px 16px; }
}

/* 레이아웃 확장 */
.container-wide{ max-width: 1080px; margin: 32px auto; padding: 0 16px; }

/* 히어로 배너 */
.hero-banner{
  background: #1565c0; /* 그라데이션 → 단색 */
  color:#fff;
}
.hero-inner{ max-width:1080px; margin:0 auto; padding:40px 16px; }
.hero-inner h1{ margin:0 0 8px; font-size:2rem; }
.hero-inner p{ margin:0 0 16px; opacity:.95; }
.hero-actions .btn{ margin-right:8px; }
.btn.btn-outline{
  background:#fff; color:var(--brand-600);
  border:1px solid #e3f2fd;
}
.btn.btn-outline:hover{ background:#f3f7ff; }

/* 페이지 본문 + TOC */
.page-wrap{ display:grid; grid-template-columns: 240px 1fr; gap: 24px; }
.toc{ position: sticky; top: 84px; align-self: start; }
.toc-title{ font-weight:700; margin-bottom:8px; }
.toc-link{
  display:block; padding:8px 10px; border-radius:6px; color:#333; text-decoration:none;
}
.toc-link:hover{ background:#f3f7ff; color:var(--brand-700); }
.toc-link.active{ background:var(--brand-600); color:#fff; }

/* 카드 그리드 */
.card-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
@media (max-width: 960px){ .page-wrap{ grid-template-columns: 1fr; } .card-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 600px){ .card-grid{ grid-template-columns: 1fr; } }

.card{
  background:#fff; border-radius:12px; box-shadow:0 2px 10px rgba(0,0,0,.06);
  padding:16px;
}
.card-header{ display:flex; gap:12px; align-items:center; margin-bottom:6px; }
.card-header .icon{ font-size:28px; }
.card-body{ color:#444; margin:6px 0 10px; }
.meta{ display:flex; gap:6px; align-items:center; }

/* 배지 색상 확장 */
.badge{
  display:inline-block; padding:2px 8px; border-radius:999px;
  font-size:.78rem; line-height:1.8; background:#eef2f7; color:#3b4450;
}
.badge.danger{ background:#ffebee; color:#c62828; }
.badge.warn{ background:#fff3e0; color:#ef6c00; }
.badge.info{ background:#e3f2fd; color:#1565c0; }
.badge.success{ background:#e8f5e9; color:#2e7d32; }
.badge.outline{ background:#fff; border:1px solid #e3e7ee; color:#607d8b; }

/* 체크리스트 */
.checklist{ margin:8px 0 12px 18px; }
.checklist li{ margin:4px 0; }

/* 아코디언 */
.accordion-toggle{ margin-top:2px; }
.accordion-content{
  max-height:0; overflow:hidden; transition:max-height .25s ease, padding .25s ease;
  padding:0 2px;
}
.accordion-content.open{ max-height:220px; padding:8px 2px; border-top:1px solid #eee; }

/* 콜아웃 */
.callout{
  background:#fff; border-left:4px solid var(--brand-600);
  padding:12px 14px; border-radius:8px; box-shadow:0 1px 6px rgba(0,0,0,.05);
  margin:12px 0;
}
.callout h4{ margin:0 0 6px; }

/* 팁/CTA */
.tips{ margin:8px 0 16px 18px; }
.cta-row{ display:flex; gap:10px; flex-wrap:wrap; }

/* 앵커 이동 시 부드럽게 */
html { scroll-behavior: smooth; }

/* 고정 헤더에 가려지지 않도록 섹션 앵커 보정 */
section[id] { scroll-margin-top: 96px; }

/* TOC 고정 위치(Header 아래에 고정) */
.toc { position: sticky; top: 84px; align-self: start; }

/* 활성 링크 강조(이미 있으면 유지) */
.toc-link.active{ background: var(--brand-600); color: #fff; }

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ctrl {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
}
.link-btn {
  background: transparent;
  border: none;
  color: #2563eb;
  cursor: pointer;
  padding: 6px 8px;
}
.link-btn:hover { text-decoration: underline; }

.property-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.property-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.property-item h3 {
  margin: 0;
  font-size: 18px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-neutral { background: #eef2ff; color: #4f46e5; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warn { background: #fff7ed; color: #c2410c; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

.warnings {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  padding: 10px 12px;
  margin: 12px 0;
  border-radius: 6px;
}

/* 특이사항이 없는 경우 배경색 제거 */
.warnings.no-warnings {
  background: transparent;
  border-left: none;
  padding: 10px 12px;
  margin: 12px 0;
}

.warn-list { margin: 0; padding-left: 18px; }

.check-toggle {
  cursor: pointer;
  color: #2563eb;
  margin-top: 6px;
  user-select: none;
}
.checklist {
  margin-top: 8px;
  padding-left: 18px;
  transition: max-height .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px;
}
.checklist::-webkit-scrollbar {
  width: 8px;
}
.checklist::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.checklist::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}
.checklist::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
.checklist.collapsed {
  max-height: 0;
  overflow: hidden;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  padding: 24px 8px;
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  color: #6b7280;
  padding: 32px 12px;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
}
.empty-emoji { font-size: 28px; margin-bottom: 8px; }
