
* {
 box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Pretendard", "Malgun Gothic", sans-serif;
  background: #f5f7fb;
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  background: #e9eef5;
}

/* 상단 브랜드 */
.top-brand {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 240px;
}

.top-brand .title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.top-brand .desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

/* 로딩 */
#loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  backdrop-filter: blur(2px);
}

.hidden {
  display: none !important;
}

.hover-label {
  position: absolute;
  transform: translate(-50%, -100%);
  
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;

  background: rgba(0,0,0,0.85);
  color: #fff;

  border-radius: 8px;
  white-space: nowrap;

  box-shadow: 0 4px 12px rgba(0,0,0,0.25);

  pointer-events: none;

  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -80%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%);
  }
}
/* 드래그 핸들 — 데스크톱에서 숨김 */
.sheet-handle {
  display: none;
}

/* 우측 패널 */

#sidePanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 460px;
  min-width: 460px;
  max-width: 460px;
  height: 100%;

  background: linear-gradient(180deg, #ffffff, #f8fafc);

  z-index: 30;
  box-shadow: -12px 0 40px rgba(0,0,0,0.18);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* 🔥 애니메이션 */
  transform: translateX(100%);
  opacity: 0;
  transition: 
  transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
  opacity 0.25s ease;
  will-change: transform, opacity;
}

#sidePanel.open {
  transform: translateX(0);
  opacity: 1;
  animation: panelPop 0.35s ease;
}


.panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 18px 20px 16px 20px;
}

.panel-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

 .panel-title-wrap {
  min-width: 0;
 }

 .panel-title {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 6px 0;
  line-height: 1.25;
 }

 .panel-subtitle {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
  word-break: keep-all;
 }

 .close-btn {
  border: none;
  background: #f3f4f6;
  color: #111827;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
 }

 .close-btn:hover {
  background: #e5e7eb;
 }

 .panel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
 }

 .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
 }

 .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px 18px;
  background: #f9fafb;
 }
.panel-body::-webkit-scrollbar {
  width: 6px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 10px;
}

.fade-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s ease forwards;
}


/* 섹션 고급화 */
.section {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.section:hover {
  transform: translateY(-2px);
}

/* 제목 고급화 */
.section-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title small {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-item {
  background: #f9fafb;
  border: 1px solid #edf0f3;
  border-radius: 12px;
  padding: 12px;
  min-height: 70px;
}

.info-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 7px;
}

.info-value {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
  word-break: keep-all;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap.tall {
}

.highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.highlight-item {
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.highlight-item:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

.highlight-card {
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
}

.highlight-label {
  font-size: 11px;
  color: #64748b;
}

.highlight-value {
  font-size: 20px;
  font-weight: 900;
  margin-top: 6px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.insight-box {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 14px;
}

.media-image-wrap,
  .view-image-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #eef2f7;
  border: 1px solid #e5e7eb;
}

.media-image-wrap img,
  .view-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.empty-image {
  padding: 32px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 10px;
}

.legend-chip {
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.bottom-note {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.55;
  margin-top: 8px;
}
.map-dim {
  filter: brightness(0.85);
  transition: 0.3s;
}
 /* 좌측 작은 안내 */
.map-guide {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  background: rgba(255,255,255,0.96);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-width: 260px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.55;
}

.recommend-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.recommend-panel .title {
  font-weight: bold;
  margin-bottom: 10px;
}


.recommend-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}


.recommend-item:hover {
  background: #f8f8f8;
}



.recommend-item .desc {
  font-size: 12px;
  color: #555;
  margin-top: 5px;
  line-height: 1.4;
}

.recommend-item .score {
  font-size: 11px;
  color: #999;
}


.control-panel {
  position: absolute;
  top: 120px;   /* 🔥 더 내림 */
  left: 20px;
  z-index: 900;
}




.rank {
  font-size: 11px;
  color: #ff5722;
  font-weight: bold;
}

.name {
  font-size: 14px;
  font-weight: bold;
}

.score {
  font-size: 11px;
  color: #888;
}

.desc {
  font-size: 12px;
  color: #444;
  margin-top: 5px;
  line-height: 1.4;
}

.insight-box {
  white-space: pre-line;
}

.planner-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 260px;
  background: white;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 999;
}

.scroll-bar {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 6px 0;
}

.scroll-bar span {
  flex: 0 0 auto;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
}

.scroll-bar span.active {
  background: #2563eb;
  color: #fff;
}


.ai-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* AI 인사이트 맵 팝업 */
.ai-popup-overlay {
  position: absolute;
  width: 340px;
  max-height: 320px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: aiPopupIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  backdrop-filter: blur(8px);
}

@keyframes aiPopupIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
}

.ai-popup-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.ai-popup-close {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ai-popup-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ai-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #1f2937;
  white-space: pre-line;
  max-height: 220px;
}

.ai-popup-body::-webkit-scrollbar {
  width: 4px;
}

.ai-popup-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.ai-popup-btn {
  margin: 0 14px 12px;
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s;
}

.ai-popup-btn:hover {
  background: #1d4ed8;
}



.ad-card {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.ad-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 이름 라벨 */
.ad-name {
  position: absolute;
  bottom: 0;
  width: 100%;

  background: linear-gradient(
    transparent,
    rgba(0,0,0,0.6)
  );

  color: #fff;
  font-size: 11px;
  padding: 6px;
  text-align: center;

  opacity: 0;
  transition: 0.2s;
}

.ad-inner {
  transform: perspective(400px) rotateX(25deg);
  transform-origin: bottom;
  animation: float 3s ease-in-out infinite;
}

/* 광고판 이미지 */
.ad-inner img {
  width: 100%;
  height: 100%;
  border-radius: 10px;

  /* 🔥 핵심 */
  object-fit: cover;
}



/* 바닥 그림자 */
.ad-inner::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 10%;
  width: 80%;
  height: 12px;
  background: rgba(0,0,0,0.3);
  filter: blur(6px);
  border-radius: 50%;
}

.billboard-overlay {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  transform: translateZ(0);
}

.billboard-overlay-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border: none;
  box-shadow: none;
}

.billboard-overlay-label {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 8px;

  background: rgba(255,255,255,0.96);
  border: 1px solid #9d174d;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  white-space: nowrap;

  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.billboard-overlay:hover .billboard-overlay-label {
  opacity: 1;
}

.media-hit-marker {
  width: 12px;
  height: 12px;
  background: transparent;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.ad-label {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;

  opacity: 0;
  transition: 0.2s;
}

/* glow */
.glow {
  display: none; /* 🔥 과감하게 제거 */
}


@keyframes bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.4) translateY(-20px); }
  100% { transform: scale(1.3) translateY(-15px); }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes panelPop {
  0% {
    transform: translateX(100%);
  }
  70% {
    transform: translateX(-8px);
  }
  100% {
    transform: translateX(0);
  }
}

/* ===== 모바일 카드 스트립 (데스크톱 숨김) ===== */
.mobile-card-strip {
  display: none;
}

/* ===== 모바일 반응형 ===== */
@media (max-width: 768px) {

  /* 상단 브랜드 — iframe 안이므로 모바일에서 숨김 (테마 헤더 사용) */
  .top-brand {
    display: none;
  }

  /* 좌측 컨트롤 패널 숨김 */
  .control-panel {
    display: none;
  }

  /* 로딩 */
  #loading {
    font-size: 14px;
  }

  /* 사이드 패널 — 모바일에서 완전 숨김 */
  #sidePanel {
    display: none !important;
  }

  /* 맵 딤 처리 약화 */
  .map-dim {
    filter: brightness(0.92);
  }

  /* AI 팝업 — 모바일에서 하단 고정 */
  .ai-popup-overlay {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    width: auto;
    max-height: 45vh;
    border-radius: 16px;
    z-index: 50;
  }

  /* ===== 모바일 하단 카드 스트립 ===== */
  .mobile-card-strip {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    padding: 0 0 12px;
    pointer-events: none;
  }

  .mobile-card-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
  }

  .mobile-card-scroll::-webkit-scrollbar {
    display: none;
  }

  /* 개별 카드 */
  .m-card {
    flex: 0 0 130px;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .m-card:active {
    transform: scale(0.96);
  }

  .m-card.active {
    box-shadow: 0 0 0 2px #2563eb, 0 4px 16px rgba(37,99,235,0.3);
  }

  .m-card-img {
    width: 100%;
    height: 90px;
    overflow: hidden;
    background: #eef2f7;
  }

  .m-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .m-card-body {
    padding: 8px 8px 10px;
  }

  .m-card-name {
    font-size: 12px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
  }

  .m-card-addr {
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
  }

  .m-card-price {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
  }
}
