/* ════════════════════════════════════════════════════════════
   common.css — 편지24 고객지원 공통 스타일
   addr / charge / draft / inbox / myinfo / mypoint / sent-detail / support / sent-list
   에서 중복되는 규칙을 통합 (6개 이상 파일에서 동일하게 사용됨)

   [목차]
   1. 공통 (PC 기본값 · 모바일에서도 적용)
      1-1. 변수 (:root)
      1-2. 리셋
      1-3. 텍스트 강조 유틸
      1-4. 레이아웃 (body / 컨테이너 / 헤더)
      1-5. 페이지 헤더 (.page-header)
      1-6. 탭바 · 공지 아이템
      1-7. 모바일 헤더 · 햄버거 (기본 숨김)
      1-8. 애니메이션
      1-9. PC 프로필 패널
      1-10. 스크롤바 · 뒤로가기 버튼
      1-11. 모바일 하단 네비게이션 (기본 숨김)
      1-12. 풀화면 팝업 (모바일 기본)
   2. PC / 태블릿 (미디어쿼리)
      - max-width: 1200px
      - min-width: 481px
      - min-width: 841px
   3. 모바일 (max-width: 500px)
      3-1. 레이아웃 · 헤더 · 탭바
      3-2. 하단 네비게이션
      3-3. 리스트 하단 여백
   ════════════════════════════════════════════════════════════ */


/* ════════════════════════════════════════════════════════════
   1. 공통 (PC 기본값 · 모바일에서도 적용)
   ════════════════════════════════════════════════════════════ */

/* ── 1-1. 변수 ── */
:root {
  /* 컬러 */
  --primary: #26C6DA;
  --primary-bg: #E0F7FA;
  --primary-light: #80DEEA;
  --bg: #ffffff;
  --bg-secondary: #FAFBFC;
  --surface: #ffffff;
  --border: #E3E8EF;
  --border-light: #F0F3F7;
  --text: #37474F;
  --text-secondary: #607D8B;
  --text-tertiary: #90A4AE;

  /* 그림자 */
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);

  /* 사이즈 */
  --sidebar-w: 80px;
  --header-h: 58px;

  /* 모바일 하단 네비게이션 (bottomnav.php) */
  --mbn-ink: #2B3440;
  --mbn-pink: #F23C7D;
  --mbn-pink-bg: #FCE6F0;
}

/* ── 1-2. 리셋 ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }


/* ── 1-3. 텍스트 강조 유틸 ── */
.t-red{color:#eb1a1a !important}
.t-org{color:#f77800 !important}
.t-blue{color:#1577fd !important}
.t-pink{color:#e52076 !important}
.t-green{color:#009b49 !important}
.t-gray{color:#282828 !important}
.bold{font-weight:bold !important}
.underline{text-decoration:underline !important}


/* ── 1-4. 레이아웃 ── */
body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-secondary);
  color: var(--text);
  height: 100vh;
  position: fixed;
  width: 100%;
  overflow: hidden;
}
.app-container { display: flex; flex-direction: column; height: 100vh; }

/* 상단 헤더 */
.header {
  height: var(--header-h);
  background: linear-gradient(90deg, #26C6DA 0%, #7E57C2 100%);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  z-index: 100; flex-shrink: 0;
}
.header-left  { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo { font-size: 24px; font-weight: 600; color: #ffffff; letter-spacing: -0.5px; margin:0 16px; }
.header-icon-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px; color: #ffffff; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.25); }
.header-icon-btn svg { stroke: #ffffff; }

/* 메인 영역 / 페이지 뷰 */
.main-content { display: flex; flex: 1; overflow: hidden; }
.page-view {
  display: none; flex: 1; overflow-y: auto;
  background: #FAFBFC; padding: 0;
}
.page-view.active { display: flex; flex-direction: column; }


/* ── 1-5. 페이지 헤더 ── */
.page-header {
  background: #ffffff; border-bottom: 1px solid #E8ECEF;
  padding: 0 36px; height: 56px;
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.page-header-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.page-header-title {
  font-family: "Pretendard", sans-serif; font-size: 16px; font-weight: 700; color: #37474F;
}
.page-header-sub {
  font-family: "Pretendard", sans-serif; font-size: 12px; color: #90A4AE; margin-left: auto;
}

/* 페이지 헤더 v17 스타일 (body.content-style-v17) */
body.content-style-v17 .page-header {
  height: 72px; padding: 0 28px; background: #ffffff;
  border-bottom: 1px solid #E8E4F0; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.content-style-v17 .page-header-icon {
  width: 42px; height: 42px; border-radius: 12px;
}
body.content-style-v17 .page-header-icon svg {
  fill: none !important; width: 20px; height: 20px; display: block;
}
body.content-style-v17 .page-header-title {
  font-family: "Pretendard", sans-serif;
  font-size: 17px; font-weight: 700; letter-spacing: -0.4px;
  background: linear-gradient(90deg, #26C6DA, #7E57C2);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
body.content-style-v17 .page-header-sub { font-size: 11px; font-weight: 500; color: #90A4AE; }


/* ── 1-6. 탭바 · 공지 아이템 ── */
.notice-tab-bar {
  display:flex;
  justify-content: center;
  align-items: center;  gap: 0;
  background: #ffffff; border-bottom: 1px solid #E8ECEF;
  padding: 0 16px; flex-shrink: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.notice-tab-bar::-webkit-scrollbar { display: none; }
.ntb-back {
  display: flex; align-items: center; gap: 7px;
  padding: 0 14px 0 4px; height: 46px;
  border: none; background: transparent; cursor: pointer;
  font-family: "Pretendard", sans-serif; font-size: 12px; font-weight: 600; color: #7E57C2;
  border-right: 1px solid #E8ECEF; margin-right: 4px; flex-shrink: 0; white-space: nowrap;
}
.ntb-back svg { stroke: #7E57C2; flex-shrink: 0; }
.ntb-back:hover { background: #F5F0FF; border-radius: 8px 0 0 8px; }
.ntb-item {
  display: flex; align-items: center; gap: 7px;
  padding: 0 15px; height: 48px;
  border: none; background: transparent; cursor: pointer;
  font-family: "Pretendard", sans-serif; font-size: 14px; font-weight: 600; color: #78909C;
  white-space: nowrap; flex-shrink: 0;
  border-bottom: 2.5px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.ntb-item:hover { color: #37474F; }
.ntb-item.active { color: #7E57C2; font-weight: 700; border-bottom-color: #7E57C2; }
.ntb-divider { width: 1px; height: 16px; background: #E8ECEF; margin: 0 4px; flex-shrink: 0; }

/* 공지 아이템 */
.notice-item {
  background: #ffffff; border-radius: 12px; border: 1px solid #E8ECEF;
  padding: 18px 22px; cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s;
  display: flex; align-items: flex-start; gap: 14px;
}
.notice-item:hover { box-shadow: 0 2px 8px rgba(126,87,194,0.13); border-color: rgba(126,87,194,0.2); }


/* ── 1-7. 모바일 헤더 · 햄버거 (기본 숨김 / 모바일 미디어쿼리에서 노출) ── */
.mobile-header { display: none; }
.mobile-hamburger {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.mobile-hamburger:active { background: #F2F1F6; }
.mobile-hamburger span {
  display: block; width: 18px; height: 2px;
  background: #2E3A42; border-radius: 2px;
}


/* ── 1-8. 애니메이션 ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modalPop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
@keyframes chargePulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.06); opacity: 0.85; }
}


/* ── 1-9. PC 프로필 패널 ── */
#pcProfileOverlay {
  display: none; position: fixed; inset: 0; z-index: 1500;
}
#pcProfileOverlay.open { display: block; }
#pcProfilePanel {
  position: fixed; top: 52px; right: 12px;
  width: 260px; background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13), 0 0 0 1px rgba(0,0,0,0.06);
  z-index: 1600; overflow: hidden;
  transform-origin: top right;
  transform: scale(0.88); opacity: 0; pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.34,1.52,0.64,1), opacity 0.15s ease;
}
#pcProfilePanel.open { transform: scale(1); opacity: 1; pointer-events: all; }

/* 프로필 상단 (아바타 · 이름 · 설정) */
.pcp-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 14px; border-bottom: 1px solid #F3F5F7;
}
.pcp-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #B2EBF2 0%, #E1BEE7 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.pcp-avatar svg { stroke: #7E57C2; width: 22px; height: 22px; }
.pcp-online { position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22C55E; border: 2px solid #ffffff; }
.pcp-info { flex: 1; min-width: 0; }
.pcp-name {
  font-family: "Pretendard", sans-serif; font-size: 15px; font-weight: 700;
  color: #1E2930; letter-spacing: -0.3px;
}
.pcp-name span { font-weight: 400; color: #78909C; font-size: 13px; }
.pcp-sub {
  display: flex; align-items: center; gap: 5px; margin-top: 3px;
}
.pcp-naver {
  width: 14px; height: 14px; border-radius: 3px;
  background: #03C75A; display: flex; align-items: center; justify-content: center;
  font-family: "Pretendard", sans-serif; font-size: 9px; font-weight: 900; color: #ffffff;
  flex-shrink: 0;
}
.pcp-sub-text {
  font-family: "Pretendard", sans-serif; font-size: 11px; color: #90A4AE;
}
.pcp-gear {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: #F5F7FA; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.pcp-gear:hover { background: #EEF2F7; }
.pcp-gear svg { stroke: #90A4AE; width: 14px; height: 14px; }

/* 프로필 메뉴 */
.pcp-section { padding: 6px 8px; }
.pcp-section + .pcp-section { border-top: 1px solid #F3F5F7; padding-top: 6px; }
.pcp-section-label {
  font-family: "Pretendard", sans-serif; font-size: 10px; font-weight: 600;
  color: #B0BEC5; letter-spacing: 0.06em;
  padding: 6px 8px 4px;
}
.pcp-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 8px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer; width: 100%;
  font-family: "Pretendard", sans-serif; font-size: 14px;
  font-weight: 500; color: #2E3A42; letter-spacing: -0.2px;
  transition: background 0.12s;
}
.pcp-item:hover { background: #F5F7FA; }
.pcp-item:hover .pcp-icon { background: #ffffff; }
.pcp-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #F5F7FA; transition: background 0.12s;
}
.pcp-icon svg { width: 15px; height: 15px; stroke: #546E7A; }
.pcp-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; flex: 1; }
.pcp-item-sub { font-size: 12px; font-weight: 500; color: #6B7785; letter-spacing: -0.1px; }
.pcp-titledot { display: flex; align-items: center; }

/* 새 알림 점 */
.pcp-dot { display: none; margin-left: auto; margin-right: 5px; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #F23C5E; }
.pcp-item.pcp-has-new .pcp-dot { display: block; }

/* 로그아웃 */
.pcp-logout {
  padding: 6px 8px 12px; border-top: 1px solid #F3F5F7;
}
.pcp-logout .pcp-item:hover { background: #FEF2F2; }
.pcp-logout .pcp-icon { background: #FEE2E2; }
.pcp-logout .pcp-icon svg { stroke: #EF4444; }
.pcp-logout .pcp-item { color: #EF4444; font-weight: 600; }


/* ── 1-10. 스크롤바 · 뒤로가기 버튼 ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.back-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  color: #57534e; background: none; border: none; cursor: pointer; border-radius: 10px;
  transition: background 0.15s, transform 0.1s;
}
.back-btn:hover { background: #f5f5f4; }
.back-btn:active { transform: scale(0.9); }


/* ── 1-11. 모바일 하단 네비게이션 (bottomnav.php 공용 컴포넌트) ──
   원래 support.css 에만 있던 것을 모든 페이지에서 쓸 수 있도록 이동
   기본은 숨김 → 모바일(max-width: 500px)에서만 노출 */
.mobile-bottomnav { display: none; }


/* ── 1-12. 풀화면 팝업 (안내 모달) ──
   기본값 = 모바일 (PC 보정은 2번 섹션 min-width: 481px 참고) */
.full-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.31);
  -webkit-box-shadow: 0px 0px 16px 1px rgba(0, 0, 0, 0.20);
}
.full-popup-overlay.open {
  display: flex;
  flex-direction: column;
}
.full-popup-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 16px 0;
}
.full-popup-close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  color: #33363F;
  transition: background 0.15s, transform 0.1s;
}
.full-popup-close-btn:hover {
  background: #f5f5f4;
}
.full-popup-close-btn:active {
  transform: scale(0.9);
}
.full-popup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.full-popup-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 24px;
}
.full-popup-title {
  font-size: 22px;
  font-weight: 700;
  color: #222222;
  line-height: 1.4;
  margin-bottom: 24px;
}
.full-popup-desc {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: #8A8A8E;
}
.full-popup-footer {
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
}
.full-popup-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 17px 0;
  background: #1B7CFB;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}


/* ════════════════════════════════════════════════════════════
   2. PC / 태블릿 (미디어쿼리)
   ════════════════════════════════════════════════════════════ */

/* ── 좁은 PC · 태블릿 (500px 이하) : content-v2-mode 에서 탭바 노출 ── */
@media (max-width: 500px) {
  body.content-v2-mode .page-view.active .notice-tab-bar { justify-content: start;}
}

/* ── PC (481px 이상) : 풀화면 팝업을 화면 중앙 카드형으로 ── */
@media (min-width: 481px) {
  .full-popup-overlay {
    inset: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-height: 400px;
  }
}

/* ── PC (841px 이상) : 뒤로가기 버튼 확대 ── */
@media (min-width: 841px) {
  .back-btn { width: 48px; height: 48px; }
  .back-btn svg { width: 28px; height: 28px; }
}


/* ════════════════════════════════════════════════════════════
   3. 모바일 (max-width: 500px)
   ════════════════════════════════════════════════════════════ */

/* ── 3-1. 레이아웃 · 헤더 · 탭바 ── */
@media (max-width: 500px) {
  body { overflow: hidden; }

  /* 활성 페이지는 전체화면으로 */
  .page-view.active {
    position: fixed !important; inset: 0 !important;
    width: 100% !important; height: 100% !important;
    display: flex !important; flex-direction: column !important;
    background: #ffffff !important; z-index: 1000; overflow: hidden;
  }

  /* 모바일 헤더 */
  .mobile-header {
    display: flex !important; align-items: center; height: 52px; padding: 0 16px;
    background: #ffffff; border-bottom: 1px solid #F0F0F5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); flex-shrink: 0; gap: 12px;
  }
  .mobile-header-back {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    margin-left: 4px; border-radius: 8px; background: transparent; border: none; cursor: pointer; flex-shrink: 0;
  }
  .mobile-header-back:active { background: #F2F1F6; }
  .mobile-header-back svg { stroke: #2E3A42; width: 20px; height: 20px; stroke-width: 2.5; }
  .mobile-header-title { font-family: "Pretendard", sans-serif; font-size: 16px; font-weight: 700; color: #2E3A42; flex: 1; text-align: center; }

  /* 탭바 (PC용 뒤로가기는 숨김) */
  .ntb-back { display: none !important; }
  .page-view .notice-tab-bar {
    display: flex !important; overflow-x: auto !important;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 0 12px; border-bottom: none;
    background: #ffffff; flex-shrink: 0;
    position: relative; z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .page-view .notice-tab-bar::-webkit-scrollbar { display: none; }
  .ntb-item { height: 46px; padding: 0 14px; font-size: 14px; scroll-snap-align: start; }

  /* PC용 뒤로가기 버튼은 숨김 (모바일은 .mobile-header-back 사용) */
  .back-btn { display: none; }
}

/* ── 3-2. 하단 네비게이션 ── */
@media (max-width: 500px) {
  .mobile-bottomnav {
    display: flex; align-items: stretch;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(90px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #ffffff;
    border-top: 1px solid #ECEAF2;
    box-shadow: none;
    z-index: 1000;
  }

  /* 메뉴 아이템 */
  .mbn-item {
    flex: 1; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    gap: 3px; padding: 0 0 12px;
    background: none; border: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mbn-icon-wrap {
    width: 58px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px;
    position: relative; z-index: 1;
  }
  .mbn-icon-img { height: 30px; width: auto; display: block; }

  /* 새 알림 점 */
  .mbn-notice-dot {
    position: absolute; left: 48px; top:2px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #F93E7D; transform: translate(-50%, -50%);
    z-index: 2; display: none; pointer-events: none;
  }
  .mbn-has-new .mbn-notice-dot { display: block; }

  /* 라벨 */
  .mbn-label {
    font-family: "Pretendard", sans-serif; font-size: 12.5px; font-weight: 600;
    color: var(--mbn-ink); letter-spacing: -0.2px; transition: color .1s ease;
    position: relative; z-index: 1; top: -1px;
  }

  /* 터치(active) 시 핑크 배경 */
  .mbn-item::before {
    content: ""; position: absolute; z-index: 0;
    left: 14px; right: 14px; top: 8px; bottom: 6px;
    border-radius: 16px; background: transparent;
    transition: background .1s ease; pointer-events: none;
  }
  .mbn-item:not(.mbn-write):active::before     { background: var(--mbn-pink-bg); }
  .mbn-item:not(.mbn-write):active .mbn-label  { color: var(--mbn-pink); }

  /* 가운데 '쓰기' 버튼 */
  .mbn-write::before { display: none; }
  .mbn-write-wrap { width: auto; height: auto; }
  .mbn-write-img {
    height: 55px; width: auto; display: block;
    margin-top: -14px; margin-bottom: 0;
    position: relative; top: 2px;
    transition: transform .12s ease;
  }
  .mbn-write:active .mbn-write-img { transform: scale(0.86); }
  .mbn-write .mbn-label { color: var(--mbn-pink); font-weight: 700; }
}

/* ── 3-3. 리스트 하단 여백 (하단 네비게이션에 가리지 않도록) ── */
@media (max-width: 500px) {
  #sentList .notice-body, #inboxList .notice-body, #draftList .notice-body,  #addrList .notice-body, #pointList .notice-body, #myinfo .notice-body  {
    padding: 12px 12px 120px !important;
    gap: 8px !important;
  }
}