/* ============================================
   CHABY PC Layout - Phase 1
   활성화: URL에 ?pc=1 또는 body.pc-mode 클래스
   ============================================ */

/* PC 모드가 아닐 때는 아무것도 안 함 */
body:not(.pc-mode) #chaby-pc-wrapper { display: none !important; }

/* === PC 모드 활성화 시 === */
body.pc-mode {
  /* 메쉬 그라디언트 배경 */
  background:
    radial-gradient(ellipse 600px 500px at 12% 18%, #ffd1a8 0%, transparent 55%),
    radial-gradient(ellipse 700px 600px at 88% 22%, #a8c8ff 0%, transparent 55%),
    radial-gradient(ellipse 800px 700px at 50% 95%, #ffa8d8 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 80% 75%, #c8a8ff 0%, transparent 55%),
    radial-gradient(ellipse 600px 500px at 20% 80%, #a8ffd1 0%, transparent 55%),
    radial-gradient(ellipse 550px 500px at 92% 50%, #e8c8ff 0%, transparent 58%),
    radial-gradient(ellipse 500px 450px at 95% 90%, #ffc8e8 0%, transparent 55%),
    linear-gradient(135deg, #fce8dc 0%, #dcdffd 40%, #e8dcfd 70%, #fcdce8 100%) !important;
  background-attachment: fixed !important;
  overflow: hidden !important;
}

body.pc-mode::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle 400px at 30% 40%, rgba(255,180,100,0.3) 0%, transparent 70%),
    radial-gradient(circle 500px at 70% 60%, rgba(100,149,237,0.25) 0%, transparent 70%),
    radial-gradient(circle 450px at 90% 30%, rgba(200,168,255,0.28) 0%, transparent 70%),
    radial-gradient(circle 420px at 85% 80%, rgba(255,168,216,0.25) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: pc-float 20s ease-in-out infinite;
}

@keyframes pc-float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(30px, -20px); }
  66% { transform: translate(-20px, 30px); }
}

/* PC 모드: 기존 모바일 앱을 플로팅 윈도우 중앙에 배치 */
body.pc-mode #root {
  position: fixed !important;
  top: 24px !important;
  left: calc(50% - 260px) !important;
  width: 520px !important;
  height: calc(100vh - 48px) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(30px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.08),
    0 30px 80px rgba(0,0,0,0.18),
    0 8px 24px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6) !important;
  z-index: 2 !important;
}

/* 캐비 앱 내부도 투명 배경으로 */
body.pc-mode #chaby-app {
  background: transparent !important;
}

/* === PC 전용 사이드 패널 === */
#chaby-pc-wrapper {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 520px 1fr;
  gap: 24px;
  padding: 24px;
  align-items: stretch;
}

.pc-panel {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.08),
    0 30px 80px rgba(0,0,0,0.18),
    0 8px 24px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 240px;
  max-width: 340px;
}

/* 오른쪽 패널 내부: 스크롤 + 하단 여백 */
.pc-panel-right {
  overflow-y: auto;
}
.pc-panel-right > *:last-child {
  margin-bottom: 40px;
  padding-bottom: 20px;
}

/* 왼쪽 패널: 오른쪽 정렬 (중앙 앱과 가까이) */
.pc-panel-left {
  justify-self: end;
  width: 280px;
}

/* 오른쪽 패널: 왼쪽 정렬 */
.pc-panel-right {
  justify-self: start;
  width: 320px;
}

/* 왼쪽 패널 내부 */
.pc-brand {
  padding: 20px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pc-logo {
  font-family: 'OkDandan', 'OkMallangB', 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #6495ED;
  letter-spacing: -0.04em;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.pc-search-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8b8b9e;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pc-search-btn:hover { background: rgba(100,149,237,0.15); color: #6495ED; }
.pc-search-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.pc-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
}

.pc-nav-section { margin-bottom: 18px; }

.pc-nav-label {
  font-size: 11px;
  font-weight: 600;
  color: #8b8b9e;
  padding: 8px 12px 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pc-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: #4a4b5e;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.pc-nav-item:hover {
  background: rgba(255,255,255,0.6);
  color: #1a1b2e;
}

.pc-nav-item.active {
  background: rgba(100,149,237,0.18);
  color: #6495ED;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(100,149,237,0.15), 0 1px 3px rgba(100,149,237,0.15);
}

.pc-nav-icon {
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-nav-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.pc-nav-item .pc-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #E24B4A;
  color: #fff;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(226,75,74,0.3);
}

.pc-cm-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: #4a4b5e;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.005em;
}

.pc-cm-item:hover { background: rgba(255,255,255,0.5); }

.pc-cm-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.pc-profile {
  padding: 10px 12px;
  margin: 0 8px 12px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.pc-profile:hover { background: rgba(255,255,255,0.8); }

.pc-av {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  background: #6495ED;
  font-size: 12px;
  width: 32px; height: 32px;
}

.pc-profile-info { flex: 1; min-width: 0; }
.pc-profile-name { font-size: 13px; font-weight: 600; color: #1a1b2e; }
.pc-profile-handle { font-size: 11px; color: #8b8b9e; }

.pc-profile-menu { color: #8b8b9e; display: flex; }
.pc-profile-menu svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* 오른쪽 패널 */
.pc-side-block {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.pc-side-block:last-child { border-bottom: none; }

.pc-side-title {
  font-size: 11px;
  font-weight: 600;
  color: #8b8b9e;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pc-side-title .pc-more {
  font-size: 11px;
  color: #6495ED;
  cursor: pointer;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.005em;
}

/* 프로필 카드 (오른쪽) */
.pc-profile-card {
  text-align: center;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pc-profile-card .pc-av {
  width: 60px; height: 60px;
  font-size: 22px;
  margin: 0 auto 12px;
  box-shadow: 0 4px 12px rgba(100,149,237,0.4);
}

.pc-pc-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: #1a1b2e; }
.pc-pc-handle { font-size: 11px; color: #8b8b9e; margin-top: 2px; }

.pc-pc-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.pc-pc-stat { text-align: center; cursor: pointer; }
.pc-pc-stat-n { font-size: 17px; font-weight: 700; color: #1a1b2e; letter-spacing: -0.02em; }
.pc-pc-stat-l { font-size: 10px; color: #8b8b9e; margin-top: 1px; letter-spacing: -0.005em; }

/* 알림 */
.pc-noti {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0 -12px;
}

.pc-noti:hover { background: rgba(255,255,255,0.5); }

.pc-noti .pc-av { width: 30px; height: 30px; font-size: 11px; }

.pc-noti-text {
  font-size: 12px;
  line-height: 1.5;
  color: #4a4b5e;
  letter-spacing: -0.005em;
}

.pc-noti-text b { color: #1a1b2e; font-weight: 600; }
.pc-noti-time { font-size: 10px; color: #8b8b9e; margin-top: 3px; }

.pc-noti-unread {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #6495ED;
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(100,149,237,0.6);
}

/* 접속 중 */
.pc-online-list { display: flex; flex-direction: column; gap: 4px; }

.pc-o-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0 -10px;
}

.pc-o-row:hover { background: rgba(255,255,255,0.5); }

.pc-o-row .pc-av { width: 28px; height: 28px; font-size: 10px; position: relative; }

.pc-o-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid rgba(255,255,255,0.8);
}

.pc-o-name { font-size: 12px; font-weight: 500; color: #1a1b2e; }
.pc-o-role { font-size: 10px; color: #8b8b9e; }

/* 추천 커뮤 */
.pc-rec-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.pc-rec-card:hover { background: rgba(255,255,255,0.8); }

.pc-rec-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.pc-rec-info { flex: 1; min-width: 0; overflow: hidden; }
.pc-rec-name { 
  font-size: 12px; 
  font-weight: 600; 
  letter-spacing: -0.005em; 
  color: #1a1b2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-rec-desc { 
  font-size: 10px; 
  color: #8b8b9e; 
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-rec-join {
  padding: 5px 12px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(100,149,237,0.3);
  font-size: 10px;
  font-weight: 600;
  color: #6495ED;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.12s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pc-rec-join:hover { background: #6495ED; color: #fff; border-color: #6495ED; }

/* 화면이 너무 좁으면 PC 모드 완전 비활성 (기존 모바일 그대로) */
@media (max-width: 1200px) {
  body.pc-mode {
    overflow: auto !important;
    background: #f5f5f7 !important;
    background-attachment: scroll !important;
  }
  body.pc-mode #root {
    position: static !important;
    top: auto !important; left: auto !important;
    width: 100% !important;
    height: 100vh !important;
    border-radius: 0 !important;
    background: #f5f5f7 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  #chaby-pc-wrapper { display: none !important; }
  body.pc-mode::before { display: none !important; }
}

/* 스크롤바 스타일 */
body.pc-mode *::-webkit-scrollbar { width: 8px; }
body.pc-mode *::-webkit-scrollbar-track { background: transparent; }
body.pc-mode *::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
body.pc-mode *::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); background-clip: content-box; border: 2px solid transparent; }

/* 프로필 드롭다운 애니메이션 */
@keyframes chaby-dd-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 프로필 풋터 hover: 클릭 가능한 거 표시 */
#pc-profile-footer {
  cursor: pointer;
  transition: background 0.15s ease;
}
#pc-profile-footer:hover {
  background: rgba(100, 149, 237, 0.06);
}
