/* ════════════════════════════════════════════════════════════════
   Floating Dock Chrome — 코너 플로팅 독 (리브랜딩 v3 "The Open Canvas")
   헤더(topnav)/푸터(footer)/하단탭(bottom-tab)을 제거하고
   4코너 + 하단중앙 플로팅 독으로 chrome 재배치.

   디자인 토큰은 tailwind.config.js / app.css 와 동일 값(하드코딩):
     dock #1A1B20 · line/ghost #EEF0F3 · brand #22463A · brand-point #52A46D
     brand-crown(다크 위 accent) #6CC08A · brand-muted #8A9A95 · surface #FFF
   shadow-dock/shadow-card 는 tailwind 와 동일.

   ⚠ z-index: 코드베이스 chrome 관례(topnav/bottom-tab = z-50)에 맞춤.
     #dock-layer z-50 / #dock-pop z-51 → 모바일 의견 시트(z-60)·모달이 위를 덮음.
   ════════════════════════════════════════════════════════════════ */

:root {
  --sh-dock: 0 14px 30px -8px rgba(20, 20, 40, .50); /* tailwind: shadow-dock */
  --sh-card: 0 1px 3px rgba(20, 20, 40, .05), 0 6px 20px -10px rgba(20, 20, 40, .10); /* shadow-card */
}

/* 인라인 SVG 아이콘(로고 막대) helper */
.dock .ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }
/* Material Symbols 글리프는 color 상속 → 부모(.nav-item/.acc-btn 등)의 색을 따른다 */
.dock .material-symbols-outlined { line-height: 1; }

/* ════════ 도크 레이어 ════════ */
/* 풀스크린 오버레이. pointer-events:none → 본문 클릭 통과, 각 독만 auto */
#dock-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.dock { position: fixed; pointer-events: auto; display: flex; align-items: center;
  transition: transform .42s cubic-bezier(.22,1,.36,1), opacity .42s cubic-bezier(.22,1,.36,1); }

/* ── 터치 롱프레스 아티팩트 차단(휴대폰·커서없는 태블릿) ──
   텍스트 선택·복사, 링크 콜아웃(미리보기/새창 이동), 탭 하이라이트, 더블탭 줌 방지.
   독·팝오버는 네비게이션 chrome 이라 선택/드래그/컨텍스트 메뉴가 불필요. */
#dock-layer, #dock-pop {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.dock, .pop-card { touch-action: manipulation; }
#dock-layer a, #dock-pop a, .dock svg, .dock img { -webkit-user-drag: none; user-drag: none; }

/* 위치: 콘텐츠 가림 최소화를 위해 가장자리에 더 붙임(요구사항 1) */
.dock-logo    { top: 14px; left: 14px; }
.dock-account { top: 14px; right: 14px; background: #1A1B20; border-radius: 999px; padding: 5px; gap: 4px; flex-direction: column; box-shadow: var(--sh-dock); }
.dock-nav     { left: 50%; bottom: 18px; transform: translateX(-50%); background: #1A1B20; border-radius: 999px; padding: 7px 9px; gap: 2px; box-shadow: var(--sh-dock); }
.dock-footer  { left: 14px; bottom: 18px; }
.dock-chat    { right: 14px; bottom: 18px; }

/* ── 기본 = 최소화(개별). 해당 독에 마우스를 올리면 그 독만 awake 로 펼쳐짐 ──
   로고 독은 예외: 항상 큰 상태 + 불투명 (브랜드 상시 노출) */
.dock:not(.dock-logo) { opacity: .4; }
.dock.awake { opacity: 1; }
.dock-logo  { opacity: 1; }                                      /* 로고는 최소화하되 불투명 유지(요구사항 2) */
.dock:not(.dock-nav) { transform: scale(.58); }                  /* 로고 포함 전 코너 독 동일 축소(요구사항 2) */
.dock:not(.dock-nav).awake { transform: none; }
.dock-nav   { transform: translateX(-50%) scale(.6); }
.dock-nav.awake { transform: translateX(-50%); }
/* transform-origin 은 각 독 요소 inline style 로 지정:
   logo=top left · account=top right · nav=bottom center · footer=bottom left · chat=bottom right */

/* ── 로고 독 (인터랙션) ── */
.logo-btn { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #EEF0F3;
  box-shadow: var(--sh-card); height: 44px; padding: 0 11px; border-radius: 999px; overflow: hidden; cursor: pointer; }
.logo-mark-wrap { display: flex; flex-shrink: 0; }
.logo-mark .bar { transform-box: fill-box; transform-origin: bottom; }
.dock-logo:hover .logo-mark .bar { animation: barWave .9s ease-in-out infinite; }
.dock-logo:hover .logo-mark .bar:nth-child(2) { animation-delay: .08s; }
.dock-logo:hover .logo-mark .bar:nth-child(3) { animation-delay: .16s; }
.dock-logo:hover .logo-mark .bar:nth-child(5) { animation-delay: .24s; }
@keyframes barWave { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(1.18)} }
.logo-word { max-width: 0; opacity: 0; white-space: nowrap; font-weight: 700; color: #22463A; font-size: 16px;
  letter-spacing: -.02em; margin-left: -3px; transition: max-width .38s cubic-bezier(.22,1,.36,1), opacity .25s, margin .38s; }
.dock-logo:hover .logo-word { max-width: 80px; opacity: 1; margin-left: 0; }
.dock-logo.bounce .logo-btn { animation: logoPop .6s cubic-bezier(.22,1,.36,1); }
@keyframes logoPop { 0%,100%{transform:scale(1)} 40%{transform:scale(.9)} }

/* ── 계정 독 (알림 카운트 + 아바타) ── */
.acc-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #B8BCC6; background: transparent; transition: .15s; cursor: pointer; }
.acc-btn:hover { color: #fff; background: #33343C; }
.acc-count { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: #C0392B; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; border: 2px solid #1A1B20; }
.acc-div { width: 20px; height: 1px; background: rgba(255,255,255,.12); }  /* 세로 독 → 가로 구분선(요구사항 3) */
.acc-avatar { width: 38px; height: 38px; border-radius: 50%; background: #33343C; color: #E7EBF2; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.16); transition: .15s; cursor: pointer; }
.acc-avatar:hover { border-color: #6CC08A; }
/* 비로그인 — 단일 로그인 아이콘(세로 독 폭에 맞춘 원형, 요구사항 3) */
.acc-login { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #B8BCC6; background: transparent; transition: .15s; cursor: pointer; }
.acc-login:hover { background: #33343C; color: #fff; }

/* ── 네비 독 (주 내비게이션) ── */
.nav-item { position: relative; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #B8BCC6; transition: .15s; }
.nav-item:hover { color: #fff; background: #33343C; }
.nav-item.active { background: #33343C; color: #6CC08A; }
.nav-label { position: absolute; bottom: calc(100% + 9px); font-size: 11px; font-weight: 600; color: #fff; background: #1A1B20;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap; opacity: 0; transform: translateY(4px); pointer-events: none; transition: .15s; box-shadow: var(--sh-dock); }
.nav-item:hover .nav-label { opacity: 1; transform: none; }

/* ── 푸터·토론 독 (단일 원형 버튼) ── */
.footer-btn, .chat-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; background: #1A1B20; color: #E7EBF2;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-dock); transition: .15s; cursor: pointer; }
.footer-btn:hover, .chat-btn:hover { background: #33343C; }
.chat-count { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #52A46D; color: #0E2417; font-size: 11px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; border: 2px solid #1A1B20; }

/* ════════ 팝오버 (프로필 / 알림 / 푸터메뉴) ════════ */
#dock-pop { position: fixed; inset: 0; z-index: 51; pointer-events: none; }
.pop-card { position: fixed; pointer-events: auto; background: #fff; border: 1px solid #EEF0F3; border-radius: 16px;
  box-shadow: 0 18px 50px -12px rgba(20,20,40,.30); opacity: 0; transition: opacity .18s, transform .2s cubic-bezier(.22,1,.36,1); }
.pop-profile, .pop-notif { transform: translateY(-8px) scale(.98); }   /* 상단 코너 → 아래로 펼침 */
.pop-footer { transform: translateY(8px) scale(.98); }                 /* 하단 코너 → 위로 펼침 */
.pop-card.show { opacity: 1; transform: none; }

/* 프로필 메뉴 */
.pop-profile { width: 244px; padding: 6px; overflow: hidden; }
.pop-head { display: flex; gap: 10px; align-items: center; padding: 14px 12px; margin: -6px -6px 6px; background: #FAFAFA; border-bottom: 1px solid #EEF0F3; }
.pop-avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid #EEF0F3; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #5A6061; }
.pop-name { font-weight: 700; font-size: 14px; }
.pop-sub { font-size: 12px; color: #767676; margin-top: 1px; }
.pop-row { display: block; width: 100%; text-align: left; padding: 11px 12px; font-size: 14px; color: #1A1A1A; border-radius: 9px; background: none; border: 0; cursor: pointer; text-decoration: none; }
.pop-row:hover { background: #F2F4F4; }
.pop-divline { border-bottom: 1px solid #EEF0F3; border-radius: 0; margin-bottom: 1px; }
.pop-danger { color: #C0392B; }
.pop-danger:hover { background: #FCECEC; }

/* 알림 패널 */
.pop-notif { width: 304px; padding: 6px; }
.pop-title { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 8px; font-weight: 700; font-size: 14px; }
.pop-readall { font-size: 12px; color: #5A6061; font-weight: 500; background: none; border: 0; cursor: pointer; }
.pop-readall:hover { color: #1A1A1A; }
.notif-list { max-height: 304px; overflow: auto; }
.notif-empty { padding: 28px 12px; text-align: center; font-size: 13px; color: #767676; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; position: relative; text-decoration: none; }
.notif-item:hover { background: #F2F4F4; }
.notif-item.unread { background: #F4F6FA; }
.notif-ic { color: #5A6061; background: #EEF0F3; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-body { min-width: 0; }
.notif-t { font-size: 13px; color: #1A1A1A; line-height: 1.35; }
.notif-s { font-size: 11px; color: #767676; margin-top: 2px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: #C0392B; position: absolute; right: 12px; top: 15px; }
.notif-all { display: block; text-align: center; padding: 11px; font-size: 13px; color: #22463A; font-weight: 600; border-top: 1px solid #EEF0F3; margin-top: 4px; text-decoration: none; }
.notif-all:hover { background: #FAFAFA; }

/* 푸터 메뉴 (신선도 + 링크 + 빌드) */
.pop-footer { width: 232px; padding: 6px; }
.fresh-row { display: flex; gap: 7px; align-items: center; font-size: 12px; color: #5A6061; padding: 10px 12px; }
.fresh-dot { width: 7px; height: 7px; border-radius: 50%; background: #2D8B4E; flex-shrink: 0; }  /* 비정상 시 #D48A2E */
.footer-links { display: flex; flex-direction: column; border-top: 1px solid #EEF0F3; padding-top: 4px; }
.footer-link { padding: 9px 12px; font-size: 14px; color: #1A1A1A; border-radius: 9px; text-decoration: none; }
.footer-link:hover { background: #F2F4F4; }
.footer-build { font-size: 11px; color: #767676; font-family: 'JetBrains Mono', monospace; padding: 10px 12px 6px; border-top: 1px solid #EEF0F3; margin-top: 4px; }

/* 의견 패널 자체 트리거(구 우하단 접힘 바·모바일 FAB)는 토론 독(.dock-chat)이 대체 → 숨김.
   토론 독 click → toggleOpinionPanel() 가 패널을 펼침/접힘(데스크톱)·시트 열기/닫기(모바일). */
#op-collapsed-bar, #op-fab { display: none !important; }

/* ── 모바일: 위치/크기 축소 ── */
@media (max-width: 640px) {
  .dock-logo { top: 12px; left: 12px; }
  .dock-account { top: 12px; right: 12px; }
  .dock-nav { bottom: 16px; }
  .dock-footer { left: 14px; bottom: 16px; }
  .dock-chat { right: 14px; bottom: 16px; }
  .nav-item { width: 38px; height: 38px; }
  .pop-card { max-width: calc(100vw - 24px); }
  .pop-notif { width: min(304px, calc(100vw - 24px)); }
}
