/**
 * notif_sheet.css — 알림 벨 버튼 + 바텀시트 컴포넌트
 * 스타일 가이드: wehome_style_guide.md 준수
 * Primary: #6a0dad / #671175 · Badge bg: #f3eef8 · Radius: 30px pill
 */

/* ── 벨 버튼 ── */
.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(--txt, #111);
  padding: 0;
  position: relative;
}

/* 벨 위 미읽음 뱃지 */
.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(3px);
  -webkit-backdrop-filter: blur(3px);
}

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

/* ── 바텀시트 모달 ── */
.notif-modal {
  background: #fff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  height: 84vh;        /* JS가 style.height로 제어 */
  max-height: 96vh;    /* 안전 상한선 */
  display: flex;
  flex-direction: column;
  animation: notif-slide-up .28s cubic-bezier(.22, 1, .36, 1);
  will-change: transform, height;
}

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

/* 드래그 핸들 */
.notif-drag-handle {
  width: 36px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  margin: 10px 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: 14px 20px 12px;
  flex-shrink: 0;
}

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

.notif-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3eef8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}

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

.notif-modal-close svg {
  width: 13px;
  height: 13px;
  color: #6a0dad;
}

/* ── 탭 바 (pill 세그먼트 스타일) ── */
.notif-tab-bar {
  display: flex;
  gap: 6px;
  padding: 2px 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;
}

/* 기본(비활성) 탭: wh-badge 패턴 */
.notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #671175;
  background: #f3eef8;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

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

/* 활성 탭: wh-btn-pill 패턴 */
.notif-tab.is-active {
  background: linear-gradient(135deg, #671175, #6a0dad);
  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: #6a0dad;
  transition: background .18s, color .18s;
}

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

/* ── 바디 (스크롤 영역) ── */
.notif-modal-body {
  overflow-y: auto;
  flex: 1;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── 알림 아이템 ── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  position: relative;
  cursor: default;
}

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

.notif-item[data-id] {
  cursor: pointer;
  transition: background .12s;
}

.notif-item[data-id]:active {
  background: #f4eff4;
}

/* 읽지 않음 */
.notif-item.is-unread {
  background: #faf8ff;
}

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

/* 아이콘 박스 — wh-icon-box 패턴 */
.notif-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #f3eef8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-item.is-unread .notif-item-icon {
  background: #ede0f7;
}

.notif-item-icon svg {
  width: 18px;
  height: 18px;
  fill: #6a0dad;
}

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

.notif-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.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: #9ca3af;
  margin-top: 5px;
  font-weight: 500;
}

/* 읽지 않음 도트 */
.notif-item-dot {
  width: 7px;
  height: 7px;
  background: #6a0dad;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── 빈 상태 (전체 / 탭별) ── */
.notif-empty,
.notif-tab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  gap: 10px;
}

/* CSS로 SVG fill 제어 (HTML attribute 보다 CSS property가 우선) */
.notif-empty svg,
.notif-tab-empty svg {
  fill: #6a0dad;
  opacity: .18;
  width: 40px;
  height: 40px;
}

.notif-empty p,
.notif-tab-empty p {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
  font-weight: 500;
}

/* ── 사진 메시지 썸네일 ── */
.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;
  border-radius: 8px;
}
