/* =========================================================
   korea-map.com Widgets
   공지 팝업 · 쿠키 동의 배너 · 카카오 플로팅 버튼
   ========================================================= */

/* CSS 변수 (메인 사이트와 동일) */
:root {
  --w-ink: #0a0e1a;
  --w-ink-soft: #1a2238;
  --w-ink-muted: #3d4a63;
  --w-paper: #f5f0e6;
  --w-paper-warm: #ebe3d0;
  --w-pin: #e54b3c;
  --w-pin-deep: #b8362a;
  --w-gold: #b08842;
  --w-kakao: #fee500;
  --w-kakao-text: #181600;
  --w-grid-strong: rgba(10, 14, 26, 0.14);
}

/* =========================================================
   1. 카카오 플로팅 버튼
   ========================================================= */
.km-kakao-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--w-kakao);
  color: var(--w-kakao-text);
  padding: 16px 22px 16px 20px;
  border-radius: 100px;
  font-family: 'Wanted Sans Variable', 'Pretendard', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 0 12px 28px -4px rgba(254, 229, 0, 0.5), 0 0 0 4px rgba(254, 229, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  animation: km-kakao-pop-in 0.5s 1s backwards cubic-bezier(0.34, 1.56, 0.64, 1);
}
.km-kakao-float:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 18px 36px -6px rgba(254, 229, 0, 0.65), 0 0 0 6px rgba(254, 229, 0, 0.2);
}
.km-kakao-float:active { transform: translateY(0) scale(0.98); }
.km-kakao-float svg { width: 22px; height: 22px; flex-shrink: 0; }
.km-kakao-float .km-kakao-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 100px;
  background: var(--w-kakao);
  transform: translate(-50%, -50%);
  z-index: -1;
  animation: km-kakao-pulse 2.5s ease-out infinite;
}

@keyframes km-kakao-pop-in {
  0% { opacity: 0; transform: translateY(40px) scale(0.5); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes km-kakao-pulse {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

/* 모바일: 텍스트 없이 아이콘만 */
@media (max-width: 480px) {
  .km-kakao-float {
    padding: 16px;
    bottom: 16px;
    right: 16px;
  }
  .km-kakao-float .km-kakao-text {
    display: none;
  }
  .km-kakao-float svg { width: 26px; height: 26px; }
}

/* =========================================================
   2. 쿠키 동의 배너
   ========================================================= */
.km-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8000;
  background: var(--w-ink);
  color: var(--w-paper);
  padding: 20px 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 -10px 30px -10px rgba(10, 14, 26, 0.3);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Pretendard', sans-serif;
}
.km-cookie-banner.km-show {
  transform: translateY(0);
}
.km-cookie-inner {
  max-width: 1200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.km-cookie-content {
  flex: 1;
}
.km-cookie-title {
  font-family: 'Wanted Sans Variable', 'Pretendard', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.km-cookie-title::before {
  content: '🍪';
  font-size: 18px;
}
.km-cookie-text {
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(245, 240, 230, 0.78);
  line-height: 1.5;
  letter-spacing: -0.015em;
}
.km-cookie-text a {
  color: var(--w-paper);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.km-cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.km-cookie-btn {
  padding: 11px 22px;
  border-radius: 100px;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.015em;
}
.km-cookie-btn.km-accept {
  background: var(--w-gold);
  color: var(--w-ink);
}
.km-cookie-btn.km-accept:hover {
  background: var(--w-paper);
  transform: translateY(-1px);
}
.km-cookie-btn.km-decline {
  background: transparent;
  color: rgba(245, 240, 230, 0.7);
  border: 1px solid rgba(245, 240, 230, 0.25);
}
.km-cookie-btn.km-decline:hover {
  border-color: var(--w-paper);
  color: var(--w-paper);
}

@media (max-width: 768px) {
  .km-cookie-banner { padding: 16px 18px; }
  .km-cookie-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .km-cookie-actions {
    width: 100%;
  }
  .km-cookie-btn {
    flex: 1;
    padding: 12px 16px;
  }
}

/* =========================================================
   3. 공지/이벤트 팝업 (Modal)
   ========================================================= */
.km-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-family: 'Pretendard', sans-serif;
}
.km-notice-overlay.km-show {
  display: flex;
  opacity: 1;
}

.km-notice-modal {
  background: var(--w-paper);
  border-radius: 24px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 40px 80px -20px rgba(10, 14, 26, 0.5);
  transform: scale(0.85) translateY(40px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}
.km-notice-overlay.km-show .km-notice-modal {
  transform: scale(1) translateY(0);
}

/* 헤더 (이미지 또는 그라데이션) */
.km-notice-header {
  background: linear-gradient(135deg, var(--w-pin) 0%, var(--w-pin-deep) 100%);
  color: var(--w-paper);
  padding: 36px 32px 28px;
  position: relative;
  overflow: hidden;
}
.km-notice-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.km-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  margin-bottom: 16px;
  position: relative;
}
.km-notice-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--w-paper);
  border-radius: 50%;
  animation: km-blink 1.5s ease-in-out infinite;
}
@keyframes km-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.km-notice-title {
  font-family: 'Wanted Sans Variable', 'Pretendard', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
  position: relative;
}
.km-notice-title .km-em {
  color: var(--w-kakao);
}

/* 본문 */
.km-notice-body {
  padding: 28px 32px 24px;
  overflow-y: auto;
}
.km-notice-body p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--w-ink-soft);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.km-notice-body p:last-child { margin-bottom: 0; }
.km-notice-body p strong {
  color: var(--w-ink);
  font-weight: 800;
}

.km-notice-highlight {
  background: var(--w-paper-warm);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 18px 0;
  border-left: 4px solid var(--w-pin);
}
.km-notice-highlight p { margin-bottom: 0; font-weight: 600; }

/* 액션 영역 */
.km-notice-actions {
  padding: 20px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.km-notice-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--w-ink);
  color: var(--w-paper);
  padding: 16px 24px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
}
.km-notice-cta:hover {
  background: var(--w-pin);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -4px rgba(229, 75, 60, 0.4);
}
.km-notice-cta.km-kakao-style {
  background: var(--w-kakao);
  color: var(--w-kakao-text);
}
.km-notice-cta.km-kakao-style:hover {
  background: var(--w-kakao);
  box-shadow: 0 10px 20px -4px rgba(254, 229, 0, 0.5);
}

/* 푸터: 오늘 하루 보지 않기 + 닫기 */
.km-notice-footer {
  padding: 16px 32px 20px;
  border-top: 1px solid var(--w-grid-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(235, 227, 208, 0.4);
}
.km-notice-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--w-ink-muted);
  cursor: pointer;
  letter-spacing: -0.015em;
  user-select: none;
}
.km-notice-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--w-pin);
}
.km-notice-close-text {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--w-ink-muted);
  cursor: pointer;
  padding: 6px 10px;
  letter-spacing: -0.015em;
  transition: color 0.2s;
}
.km-notice-close-text:hover {
  color: var(--w-ink);
}

/* X 닫기 버튼 (우측 상단) */
.km-notice-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--w-paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.km-notice-close-x:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

@media (max-width: 480px) {
  .km-notice-modal { max-width: 100%; border-radius: 20px; }
  .km-notice-header { padding: 28px 24px 22px; }
  .km-notice-title { font-size: 22px; }
  .km-notice-body { padding: 22px 24px 18px; }
  .km-notice-actions { padding: 16px 24px 22px; }
  .km-notice-footer { padding: 14px 24px 16px; flex-direction: column; gap: 10px; align-items: stretch; }
  .km-notice-checkbox { justify-content: center; }
}
