/* =====================================================
   RESET / BASE
   ===================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  font-size: 14px;
  color: #222;
  background: #dfe6ec;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

input,
select {
  outline: none;
}

/* =====================================================
   ROOT LAYOUT
   ===================================================== */
#wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* =====================================================
   MAP BACKGROUND
   ===================================================== */
#map-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: #dfe6ec;
}

#map {
  width: 100%;
  height: 100%;
  background: #dfe6ec;
}

/* =====================================================
   SIDEBAR OVERLAY
   ===================================================== */
#sidebar {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: 380px;
  z-index: 600;
}

#sidebar-inner {
  width: 100%;
  height: 100%;
  background: #f4f5f7;
  border: 1px solid #d7dee7;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
}

/* 접힘 상태에서는 헤더만 */
#sidebar.collapsed {
  bottom: auto;
  height: 54px;
}

#sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .22s ease, transform .22s ease;
  background-color: #fff;
}

#sidebar.collapsed #sidebar-body {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

/* =====================================================
   SIDEBAR HEADER
   ===================================================== */
#sb-head {
  height: 54px;
  min-height: 54px;
  padding: 0 18px;
  background: linear-gradient(180deg, #2f86dd 0%, #1f73cb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sb-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.p-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}

#collapse-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
  position: relative;
  right: -5px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}

#collapse-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 2px solid #4b5b6b;
  border-right: 2px solid #4b5b6b;
  position: absolute;
  top: 11px;
  left: 9px;
  transform: rotate(-45deg);
  transition: transform .25s ease, top .25s ease;
}

#sidebar.collapsed #collapse-btn::before {
  top: 8px;
  transform: rotate(135deg);
}

/* =====================================================
   SEARCH SECTION
   ===================================================== */
#search-sec {
  padding: 18px 22px 16px;
  border-bottom: 1px solid #e0e5ea;
  flex-shrink: 0;
}

.search-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #f07a1a;
}

.search-ico {
  font-size: 17px;
  line-height: 1;
}

.dd-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.dd-row select {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #2e81d6;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 14px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #4c5a67 50%),
    linear-gradient(135deg, #4c5a67 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.dd-row select:focus {
  border-color: #1f73cb;
  box-shadow: 0 0 0 3px rgba(31, 115, 203, 0.10);
}

.inp-row {
  position: relative;
}

.inp-row input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 12px;
  border: 1px solid #d6dde5;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  color: #333;
}

.inp-row input::placeholder {
  color: #9aa6b2;
}

.inp-row input:focus {
  border-color: #1f73cb;
  box-shadow: 0 0 0 3px rgba(31, 115, 203, 0.08);
}

.srch-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: absolute;
  right: 4px;
  top: 3px;
  background: transparent;
}

.srch-icon-btn::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 3px solid #1f73cb;
  border-radius: 50%;
  position: absolute;
  left: 8px;
  top: 7px;
}

.srch-icon-btn::after {
  content: "";
  width: 8px;
  height: 3px;
  background: #1f73cb;
  position: absolute;
  right: 7px;
  bottom: 8px;
  transform: rotate(45deg);
  border-radius: 2px;
}

#recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.rtag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf5ff;
  border: 1px solid #cfe0f3;
  color: #1f73cb;
  font-size: 12px;
}

.rtag .rdel {
  color: #7d8b99;
  font-size: 11px;
}

/* =====================================================
   LIST
   ===================================================== */
#lot-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#lot-list-wrap::-webkit-scrollbar {
  width: 8px;
}

#lot-list-wrap::-webkit-scrollbar-thumb {
  background: #c8d1da;
  border-radius: 999px;
}

#list-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  background: #eef1f4;
  border-bottom: 1px solid #dde3ea;
}

#list-count {
  font-size: 13px;
  font-weight: 700;
  color: #5f6b76;
}

#lot-list {
  padding: 10px;
}

#empty-msg {
  padding: 60px 20px;
  text-align: center;
  color: #96a1ad;
  font-size: 14px;
  line-height: 1.8;
}

.lot-item {
  position: relative;
  padding: 16px 16px 16px 18px;
  background: #f3f4f6;
  border: 1px solid #e1e5ea;
  cursor: pointer;
  transition: background .15s ease;
  margin-bottom: 5px;
  border-radius: 4px;
}

.lot-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: #45b52b;
}

.lot-item:hover {
  background: #eceff3;
}

.lot-item.selected {
  background: #e9edf3;
}

.lot-item.status-여유::before {
  background: #45b52b;
}

.lot-item.status-혼잡::before {
  background: #f0a000;
}

.lot-item.status-만차::before {
  background: #e64a2f;
}

.lot-item.status-정보없음::before {
  background: #8d98a3;
}

.lot-name {
  font-size: 16px;
  font-weight: 800;
  color: #2a2f35;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: keep-all;
}

.lot-addr {
  font-size: 13px;
  color: #6f7b87;
  line-height: 1.4;
  margin-bottom: 4px;
}

.lot-hours {
  font-size: 14px;
  font-weight: 700;
  color: #2d3136;
  margin-bottom: 10px;
}

.lot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.b-여유 {
  background: #45b52b;
}

.b-혼잡 {
  background: #f0a000;
}

.b-만차 {
  background: #e64a2f;
}

.b-정보없음 {
  background: #8d98a3;
}
/* 리스트 아이콘 + 배지 한 줄 */
.lot-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lot-type-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* 종류별 아이콘 */
.lot-type-icon.general {
  background-image: url("../../images/ico_standard_c.png");
}

.lot-type-icon.electric {
  background-image: url("../../images/ico_electric_c.png");
}

.lot-type-icon.disabled {
  background-image: url("../../images/ico_accessible_c.png");
}


/* 팝업 아이콘 */
.pop-type-icon {
	position: relative;
    width: 20px;
    height: 20px;
}
.pop-type-icon span {
	display: inline-block;
	width: 100%;
	height: 100%;
    background-size: contain;
}
.pop-type-icon .general {
  background-image: url("../../images/ico_standard_w.png");
}

.pop-type-icon .electric {
  background-image: url("../../images/ico_electric_w.png");
}

.pop-type-icon .disabled {
  background-image: url("../../images/ico_accessible_w.png");
}



/* =====================================================
   TOP RIGHT FILTER
   ===================================================== */
#car-filter {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 700;
  display: flex;
  gap: 8px;
}

.cf-btn {
  min-width: 78px;
  height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: background-color .2s ease, opacity .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cf-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

.cf-text {
  line-height: 1;
}

/* 활성 상태 */
.cf-btn[data-type="general"].is-active {
  background: #257ad2;
}

.cf-btn[data-type="electric"].is-active {
  background: #257ad2;
}

.cf-btn[data-type="disabled"].is-active {
  background: #257ad2;
}

/* 비활성 상태 */
.cf-btn:not(.is-active) {
  background: #9aa3ad;
  color: #fff;
  opacity: 0.95;
}
.cf-btn:not(.is-active) .cf-icon {
  opacity: 0.75;
}

/* 아이콘 이미지 */
.cf-btn[data-type="general"] .cf-icon {
  background-image: url("../../images/ico_standard_w.png");
}

.cf-btn[data-type="electric"] .cf-icon {
  background-image: url("../../images/ico_electric_w.png");
}

.cf-btn[data-type="disabled"] .cf-icon {
  background-image: url("../../images/ico_accessible_w.png");
}

/* =====================================================
   LOADING
   ===================================================== */
#loading {
  display: none;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 750;
  padding: 9px 16px;
  background: rgba(255,255,255,0.96);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  color: #3c4957;
  font-size: 13px;
  font-weight: 600;
}

/* =====================================================
   POPUP
   ===================================================== */
#popup {
  display: none;
  position: fixed;
  z-index: 1200;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.20);
  overflow: hidden;
}

.pop-head {
  padding: 12px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pop-head.여유 { background: #45b52b; }
.pop-head.혼잡 { background: #f0a000; }
.pop-head.만차 { background: #e64a2f; }
.pop-head.정보없음 { background: #8d98a3; }

.pop-status-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 300;
}

.pop-count {
  font-weight: 600;
}

.pop-close {
  font-size: 18px;
  cursor: pointer;
}

.pop-name-sec {
  padding: 16px;
  border-bottom: 1px solid #edf1f5;
}

.pop-name {
  font-size: 18px;
  font-weight: 800;
  color: #222;
  line-height: 1.35;
  margin-bottom: 5px;
}

.pop-addr {
  font-size: 13px;
  color: #6f7b87;
  line-height: 1.45;
}

.pop-info {
  padding: 15px;
  background-color: #f7f8f9;
  margin: 10px;
}

.pop-info-title {
  position: relative;
  padding-left: 25px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
  color: #1f73cb;
}

.pop-info-title::before {
    content: "P";
    width: 14px;
    height: 14px;
    color: #fff;
    border-radius: 4px;
    background: #1f73cb;
    position: absolute;
    left: 0;
    top: -2px;
    padding: 2px 0 4px 5px;
}

.prow {
	position: relative;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 5px 0 5px 20px;
	border-bottom: 1px dashed #e9eef3;
	font-size: 14px;
}
.prow::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 2px;
	background: #1f73cb;
	position: absolute;
	left: 5px;
	top: 10px;
}

.prow:last-child {
  border-bottom: none;
}

.plabel {
  color: #6f7b87;
  flex-shrink: 0;
}

.pval {
  color: #1f2328;
  text-align: right;
  font-weight: 600;
  word-break: keep-all;
}

/* =====================================================
   TOOLTIP
   ===================================================== */
#tooltip {
  display: none;
  position: fixed;
  z-index: 1300;
  width: 250px;
  background: #fff;
  border-radius: 12px;
  pointer-events: none;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

.tt-head {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tt-head.여유 { background: #45b52b; }
.tt-head.혼잡 { background: #f0a000; }
.tt-head.만차 { background: #e64a2f; }
.tt-head.정보없음 { background: #8d98a3; }

.tt-type,
.tt-count {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.tt-body {
  padding: 12px;
}

.tt-name {
  font-size: 14px;
  font-weight: 800;
  color: #222;
  line-height: 1.35;
  margin-bottom: 4px;
}

.tt-addr {
  font-size: 12px;
  color: #6f7b87;
  line-height: 1.45;
}

/* =====================================================
   LEGEND
   ===================================================== */
#legend {
  position: absolute;
  right: 10px;
  bottom: 20px;
  z-index: 700;
  width: 170px;
  background: rgba(255,255,255,0.96);
  border: 1px solid #d7dee7;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  overflow: hidden;
}

#legend-head {
  height: 40px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.leg-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #2b3138;
}

.leg-title-ico {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #3b80db;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

#leg-arr {
  font-size: 11px;
  color: #616d78;
}

#legend-body {
  padding: 10px 12px;
  background: #fff;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #4e5964;
  margin-bottom: 8px;
}

.leg-item:last-child {
  margin-bottom: 0;
}

.leg-dot {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.leg-dot.is-green { background: #45b52b; }
.leg-dot.is-orange { background: #f0a000; }
.leg-dot.is-red { background: #e64a2f; }
.leg-dot.is-gray { background: #8d98a3; }

/* =====================================================
   LEAFLET OVERRIDE
   ===================================================== */
.leaflet-control-container .leaflet-top.leaflet-left,
.leaflet-control-container .leaflet-top.leaflet-right {
  margin-top: 54px;
}

.leaflet-bottom.leaflet-right .leaflet-control-zoom {
  margin-right: 10px;
  margin-bottom: 165px;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 34px !important;
  font-size: 18px !important;
  color: #3f4a56 !important;
}

/* =====================================================
   CUSTOM PARKING MARKER
   ===================================================== */
.parking-marker {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.parking-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit;
  border-radius: 2px;
}

.parking-marker.general {
  background: #30343b;
}

.parking-marker.electric {
  background: #6f39e8;
}

.parking-marker.disabled {
  background: #2f8df3;
}

.parking-marker .marker-icon {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

/* 마커 중앙 아이콘 png */
.parking-marker.general .marker-icon {
  background-image: url("../../images/ico_standard_w.png");
}

.parking-marker.electric .marker-icon {
  background-image: url("../../images/ico_electric_w.png");
}

.parking-marker.disabled .marker-icon {
  background-image: url("../../images/ico_accessible_w.png");
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1280px) {
  #sidebar {
    width: 320px;
  }
}

#map-notice {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}