/**
 * notif_sheet.css — 알림 바텀시트
 * Brand: #681DC7 / #681DC7 · Pretendard
 */

/* ── 벨 버튼 ── */
.wh-nav-right { margin-left: auto; }

.wh-nav-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wh-text-primary, #111827);
  padding: 0;
  position: relative;
  -webkit-appearance: none;
  appearance: none;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid #fff;
  pointer-events: none;
}

/* ── 오버레이 ── */
.notif-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.notif-overlay.is-open { display: flex; }

/* ── 바텀시트 모달 ── */
.notif-modal {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #fff;
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 480px;
  height: 84vh;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  animation: notif-slide-up .3s cubic-bezier(.16, 1, .3, 1);
  will-change: transform, height;
  box-shadow: 0 -2px 24px rgba(106, 13, 173, .07);
}

@keyframes notif-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* 드래그 핸들 */
.notif-drag-handle {
  width: 32px;
  height: 3px;
  background: #e9e9ef;
  border-radius: 999px;
  margin: 12px auto 0;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.notif-drag-handle:active { cursor: grabbing; }

/* ── 모달 헤더 ── */
.notif-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}

.notif-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.5px;
}

/* 닫기 버튼 — 기본 스타일 완전 리셋 후 재정의 */
.notif-modal-close {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

.notif-modal-close:active { background: #ede0f7; }

.notif-modal-close svg {
  width: 13px;
  height: 13px;
  color: #9ca3af;
  display: block;
  transition: color .15s;
}

.notif-modal-close:active svg { color: #681DC7; }

/* ── 탭 바 ── */
.notif-tab-bar {
  display: flex;
  gap: 6px;
  padding: 0 16px 14px;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid #f3eef8;
}

.notif-tab-bar::-webkit-scrollbar { display: none; }

/* 탭 버튼 — 기본 스타일 완전 리셋 */
.notif-tab {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #681DC7;
  background: #f3eef8;
  border: none;
  outline: none;
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

.notif-tab:active { transform: scale(0.95); }

.notif-tab.is-active {
  background: linear-gradient(135deg, #681DC7, #681DC7);
  color: #fff;
}

/* 탭 카운트 뱃지 */
.notif-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  line-height: 1;
  background: #ede0f7;
  color: #681DC7;
  transition: background .18s, color .18s;
}

.notif-tab.is-active .notif-tab-badge {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

/* 읽음 필터 2행 — 카테고리 탭과 동일 .notif-tab 재사용 */
.notif-tab-bar--filter {
  padding-top: 0;
  padding-bottom: 12px;
}

.notif-overlay button.notif-tab,
.notif-modal button.notif-tab {
  width: auto;
  max-width: none;
  min-width: 0;
  flex: 0 0 auto;
}

/* ── 전체 읽음 바 (전역 button 리셋) ── */
.notif-modal .notif-mark-read-bar,
#notif-overlay .notif-mark-read-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 16px 5px;
  flex-shrink: 0;
  border-bottom: 1px solid #f8f4ff;
  width: 100%;
  box-sizing: border-box;
}

.notif-modal button.notif-mark-read-btn,
#notif-overlay button.notif-mark-read-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  max-width: none;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: #681DC7;
  background: transparent;
  background-image: none;
  border: none;
  outline: none;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

.notif-modal button.notif-mark-read-btn:active,
#notif-overlay button.notif-mark-read-btn:active {
  color: #5200a8;
  background: #f3eef8;
}

.notif-modal .notif-mark-read-icon,
#notif-overlay .notif-mark-read-icon {
  width: 13px;
  height: 13px;
  min-width: 13px;
  max-width: 13px;
  min-height: 13px;
  max-height: 13px;
  flex: 0 0 13px;
  display: block;
}

/* ── 바디 ── */
.notif-modal-body {
  overflow-y: auto;
  flex: 1;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior: contain;
}

/* ── 알림 아이템 ── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  position: relative;
  cursor: default;
  background: #fff;
  transition: background .12s, box-shadow .12s, opacity .12s;
}

.notif-item + .notif-item { border-top: 1px solid #f8f4ff; }

.notif-item[data-id] { cursor: pointer; }
.notif-item[data-id]:active { background: #faf6ff; }

.notif-item.is-read {
  background: #fff;
  box-shadow: none;
}

.notif-item.is-read .notif-item-icon:not(.notif-item-icon--avatar) {
  filter: grayscale(.35);
  opacity: .65;
}

.notif-item.is-read .notif-item-icon--avatar {
  opacity: .72;
}

.notif-item.is-read .notif-item-title {
  color: #374151;
  font-weight: 600;
}

.notif-item.is-read .notif-item-msg {
  color: #9ca3af;
}

.notif-item.is-read .notif-item-time {
  color: #c5cad3;
}

.notif-item.is-unread {
  background: #fbf7ff;
  box-shadow: inset 4px 0 0 #681DC7;
}

.notif-item.is-unread[data-id]:active { background: #f4eeff; }

/* ── 아이콘 박스 — 탭별 색상 (flex 0 0 42px: 전역 flex 덮어쓰기) ── */
.notif-modal .notif-item-icon,
#notif-overlay .notif-item-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  background: #f3eef8;
  color: #681DC7;
}

/* 예약 — 브랜드 퍼플 */
.notif-item-icon--book {
  background: #f0e8fc;
  color: #681DC7;
}

/* 메시지 — 스카이 블루 */
.notif-item-icon--message {
  background: #e4f0fd;
  color: #1565c0;
}

/* 결제 — 워밍 앰버 */
.notif-item-icon--pay {
  background: #fff8e1;
  color: #e65100;
}

.notif-item-icon svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* 메시지 — 상대방 프로필 사진 (전역 img 규칙 덮어쓰기) */
.notif-modal .notif-item-icon--avatar,
#notif-overlay .notif-item-icon--avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  min-height: 36px;
  max-height: 36px;
  flex: 0 0 36px;
  background: #e9e9ef;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.notif-modal .notif-item-icon--avatar img,
#notif-overlay .notif-item-icon--avatar img {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  min-height: 36px;
  max-height: 36px;
  object-fit: cover;
  display: block;
  flex: none;
  border-radius: 50%;
}

/* 위홈 공식 로고 (logo_icon.png) */
.notif-modal .notif-item-icon--brand,
#notif-overlay .notif-item-icon--brand {
  background: #f3eef8;
  border-radius: 50%;
  padding: 5px;
  box-sizing: border-box;
}

.notif-modal .notif-item-icon--brand img,
#notif-overlay .notif-item-icon--brand img {
  object-fit: contain;
  border-radius: 0;
}

/* ── 아이템 텍스트 ── */
.notif-item-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.notif-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.notif-item.is-unread .notif-item-title {
  font-weight: 800;
  color: #111827;
}

/* 읽음 — 미읽음 도트 자리, 작은 체크만 */
.notif-item-read-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #c5cad3;
  opacity: 0.85;
}

.notif-item-read-mark svg {
  width: 14px;
  height: 14px;
  display: block;
}

.notif-item-msg {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  font-size: 11px;
  color: #b8bec8;
  margin-top: 5px;
  font-weight: 500;
}

/* ── 아이템 오른쪽 (dot + 삭제버튼) ── */
.notif-item-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* 읽지 않음 도트 */
.notif-item-dot {
  width: 8px;
  height: 8px;
  background: #681DC7;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(106, 13, 173, .12);
}

/* 개별 삭제 버튼 — 기본 스타일 완전 리셋 */
.notif-delete-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

.notif-delete-btn:active { background: #f0e8fc; }

.notif-delete-btn svg {
  width: 12px;
  height: 12px;
  color: #c8cdd8;
  display: block;
  transition: color .15s;
}

.notif-delete-btn:active svg { color: #681DC7; }

/* ── 썸네일 ── */
.notif-item-thumb {
  margin-top: 6px;
  border-radius: 8px;
  overflow: hidden;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.notif-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── 빈 상태 ── */
.notif-empty,
.notif-tab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
}

.notif-empty svg,
.notif-tab-empty svg {
  width: 40px;
  height: 40px;
  fill: #681DC7;
  opacity: .15;
}

.notif-empty p,
.notif-tab-empty p {
  font-size: 13px;
  color: #b8bec8;
  margin: 0;
  font-weight: 500;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

/* ── PC GNB: 벨 앵커 드롭다운 ── */
@media (min-width: 1024px) {
  html.index-force-desktop-ui .notif-overlay,
  html.mypage-force-desktop-ui .notif-overlay,
  html.sp-force-desktop-ui .notif-overlay,
  html.profile-force-desktop-ui .notif-overlay,
  html.rooms-force-desktop-ui .notif-overlay,
  html.book-force-desktop-ui .notif-overlay {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  html.index-force-desktop-ui .notif-overlay.is-open,
  html.mypage-force-desktop-ui .notif-overlay.is-open,
  html.sp-force-desktop-ui .notif-overlay.is-open,
  html.profile-force-desktop-ui .notif-overlay.is-open,
  html.rooms-force-desktop-ui .notif-overlay.is-open,
  html.book-force-desktop-ui .notif-overlay.is-open {
    display: block;
  }

  html.index-force-desktop-ui .notif-modal,
  html.mypage-force-desktop-ui .notif-modal,
  html.sp-force-desktop-ui .notif-modal,
  html.profile-force-desktop-ui .notif-modal,
  html.rooms-force-desktop-ui .notif-modal,
  html.book-force-desktop-ui .notif-modal {
    position: fixed;
    display: flex;
    flex-direction: column;
    top: 72px;
    right: 24px;
    left: auto;
    bottom: auto;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: auto;
    max-height: min(70vh, 560px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: notif-pc-pop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
  }

  html.index-force-desktop-ui .notif-drag-handle,
  html.mypage-force-desktop-ui .notif-drag-handle,
  html.sp-force-desktop-ui .notif-drag-handle,
  html.profile-force-desktop-ui .notif-drag-handle,
  html.rooms-force-desktop-ui .notif-drag-handle,
  html.book-force-desktop-ui .notif-drag-handle {
    display: none !important;
  }

  html.index-force-desktop-ui .notif-modal-body,
  html.mypage-force-desktop-ui .notif-modal-body,
  html.sp-force-desktop-ui .notif-modal-body,
  html.profile-force-desktop-ui .notif-modal-body,
  html.rooms-force-desktop-ui .notif-modal-body,
  html.book-force-desktop-ui .notif-modal-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
  }
}

@keyframes notif-pc-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  html.index-force-desktop-ui .notif-modal,
  html.mypage-force-desktop-ui .notif-modal,
  html.sp-force-desktop-ui .notif-modal,
  html.profile-force-desktop-ui .notif-modal,
  html.rooms-force-desktop-ui .notif-modal,
  html.book-force-desktop-ui .notif-modal {
    animation: none;
  }
}
