/* Force hide mobile user info bar */
.mobile-user-info, .mobile-user-link, #mobile-logout-btn, .header-divider { display: none !important; }

/* Mobile menu button and sheet */
@media (max-width: 768px) {
  .logo { display:none !important; }
  .mobile-menu-button { background: transparent; border: none; color: var(--text-color); font-size: 22px; margin-right: 8px; display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; }
}
@media (min-width: 769px) { .mobile-menu-button { display:none !important; } }

.mobile-menu { position: fixed; inset: 0; z-index: 1000; display:none; }
.mobile-menu.is-open { display:block; }
.mobile-menu-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.mobile-menu-panel { position: absolute; left:0; top:0; bottom:0; width: 80%; max-width: 360px; background: var(--bg-color); border-right:1px solid var(--border-color); box-shadow: 8px 0 30px rgba(0,0,0,.25); transform: translateX(-100%); transition: transform .25s ease; }
.mobile-menu.is-open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-header { display:flex; align-items:center; justify-content:space-between; padding: 14px 12px; border-bottom:1px solid var(--border-color); }
.mobile-menu-header .title { font-weight:800; }
.mobile-menu-close { background: transparent; border: none; color: var(--text-color); font-size: 20px; width:36px; height:36px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; }
.mobile-menu-list { display:flex; flex-direction:column; padding: 8px; }
.mobile-menu-list .mitem { display:flex; align-items:center; gap:12px; padding:12px; color: var(--text-color); text-decoration:none; border-radius: 12px; }
.mobile-menu-list .mitem:hover { background: var(--bg-secondary); }
/* ========================================
   🧭 NAVBAR COMPONENT
   ======================================== */

/* 🔥 Navbar Base */
.navbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 12px 40px;
  position: sticky;
  top: 0;
    z-index: 1001;
  height: 50px;
  background-color: var(--bg-primary);
}

.navbar .logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary-color);
  text-decoration: none;
}

.navbar .logo img {
  display: block;
  margin-top: 0px;
  height: 30px;
}

.navbar nav {
  margin-left: 24px;
}

/* 헤더 nav 메뉴 한 줄 정렬 및 커뮤니티 드롭다운 버튼 정렬 개선 */
.navbar nav ul {
  display: flex;
  align-items: center;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navbar nav ul li {
  display: flex;
  align-items: center;
  font-size: 1.18em;
  font-weight: 700;
  color: #23272f;
  line-height: 1.2;
  position: relative;
  height: 56px;
}

.navbar nav ul li .dropdown-toggle {
  font-size: 16.8px;
  display: flex;
  align-items: center;
  height: 56px;
  line-height: 56px;
  font-weight: 700;
  color: #23272f;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 8px;
}

.navbar nav ul li .dropdown-menu {
  top: 56px;
  padding: 8px 0 !important;
  min-width: 120px;
  width: 120px;
  box-sizing: border-box;
}

.navbar nav ul li .dropdown-menu li {
  width: 100%;
  margin: 0;
  padding: 0;
}

.navbar nav ul li .dropdown-menu a {
  display: block;
  width: 100%;
  padding: 8px 16px;
  margin: 0;
  box-sizing: border-box;
}

.navbar nav a {
  color: var(--text-color-secondary);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
}

.navbar nav a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 50%;
  background-color: var(--primary-color);
  transition: all 0.3s ease-out;
}

.navbar nav a:hover {
  color: var(--primary-color);
}

.navbar nav a:hover:after {
  width: 100%;
  left: 0;
}

.header-right {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin-left: auto;
}

/* 활성 페이지 강조 */
.navbar nav a.active {
  color: var(--text-color);
  font-weight: 800;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-buttons .login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 30px;
  color: var(--text-color);
  border: 1px solid var(--border-color-button, #dbdfe6);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}

.auth-buttons .login:hover {
  background-color: var(--bg-secondary-color);
}

.auth-buttons .signup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 30px;
  color: #fff;
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.auth-buttons .signup:hover {
  background-color: #2563eb;
}

#user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-color);
  background-color: var(--bg-secondary-color);
  padding: 6px 12px;
  border-radius: 8px;
}

#user-profile #user-level {
  font-weight: 700;
}

#user-profile #user-display-name {
  font-weight: 600;
}

.icon-button {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
}

/* PWA 설치 버튼은 모바일에서도 강제 표시 허용 */
#pwa-install-btn { display: inline-flex; }
@media (max-width: 768px) {
  #pwa-install-btn { display: inline-flex !important; }
}

.icon-button:hover {
  background-color: var(--bg-secondary-color);
  color: var(--primary-color);
}

/* 헤더 아이템 사이 구분선 */
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 8px;
  display: inline-block;
}

.icon-button i {
  font-size: 1.2rem;
  line-height: 1;
}

#search-page-link { text-decoration:none; }

/* 아바타 이미지가 있을 때 아이콘 숨김 처리 */
#my-page-link.has-avatar #my-page-icon {
  display: none !important;
}

/* 아바타 이미지 기본 스타일 (인라인 보완용) */
#my-page-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
}

/* 다크모드 대비 여백 정렬 */
#my-page-link {
  padding: 4px;
}

/* 헤더 지갑 팝오버 */
#wallet-toggle {
  position: relative;
}

.wallet-popover {
  position: absolute;
  right: 64px; /* 프로필/테마 사이 대략 위치 */
  top: 56px;
  width: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-color);
  z-index: 1200;
}

/* 알림 팝오버 */
#notif-toggle { position: relative; }
.notif-popover {
  position: absolute;
  right: 108px; /* 월렛보다 왼쪽 */
  top: 56px;
  width: 360px;
  max-height: 420px;
  overflow: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-color);
  z-index: 1200;
}
.notif-head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border-color); }
.notif-title { color: var(--text-color); font-weight:800; }
.notif-more { color: var(--text-color-secondary); text-decoration:none; font-weight:600; font-size:13px; }
.notif-list { display:flex; flex-direction:column; }
.notif-item { display:grid; grid-template-columns:36px 1fr; gap:10px; padding:12px 14px; border-bottom:1px solid var(--border-color); }
.notif-item .avatar { width:36px; height:36px; border-radius:999px; background:#e5e7eb; background-size:cover; background-position:center; border:1px solid var(--border-color); }
.notif-item .meta { display:flex; align-items:center; gap:8px; font-size:12px; color: var(--text-color-secondary); }
.notif-item .text { color: var(--text-color); font-size:14px; line-height:1.5; }

.wallet-popover .hw-inner {
  padding: 24px;
}

.wallet-popover .hw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wallet-popover .hw-title {
  color: var(--text-color-secondary);
  font-weight: 500;
}
.wallet-popover .hw-hint {
  color: var(--text-color-secondary);
}
/* hw-eye 제거됨 */

.hw-amount-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-color);
}

.hw-amount-row .tb-amount {
  font-size: 20px;
}

.hw-unit {
  color: var(--text-color-secondary);
}

/* Wallet 열기 링크 제거됨 */

/* hw-inner 전체 클릭 시 포인터 */
#hw-inner { cursor: pointer; }
#hw-inner:hover { background: var(--bg-secondary-color); }

/* =====================
   프로필 드롭다운
   ===================== */
.profile-dropdown {
  position: absolute;
  right: 16px;
  top: 60px;
  width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-color);
  z-index: 1200;
  overflow: hidden;
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.profile-dropdown-header img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-dropdown-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-dropdown-header-container {
  padding: 12px 12px 0px;
}

#profile-dropdown-name {
  color: var(--text-color);
  font-weight: 700;
}

#profile-dropdown-email {
  color: var(--text-color-secondary);
  font-size: 13px;
}

.profile-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
}

.profile-dropdown-menu li a,
.profile-dropdown-menu li button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.profile-dropdown-menu li a:hover,
.profile-dropdown-menu li button:hover {
  background: var(--bg-secondary-color);
}

.logout-button {
  color: #ef4444;
}

/* 아이콘 정렬/간격 */
.profile-dropdown-menu li a,
.profile-dropdown-menu li button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-dropdown-menu li i {
  width: 18px;
  text-align: center;
  color: var(--text-color-secondary);
}

/* 구분선 */
.profile-dropdown-menu .menu-separator {
  height: 1px;
  margin: 8px 0;
  background: var(--border-color);
  pointer-events: none;
}

 

body.dark-mode .navbar nav a:hover:after {
  background-color: var(--primary-color);
}

/* --- 커뮤니티 드롭다운 메뉴 --- */
.navbar nav ul li.dropdown {
  position: relative;
}

.navbar nav ul li .dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar nav ul li .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0 0 12px 12px;
  min-width: 160px;
  box-shadow: 0 4px 16px var(--shadow-color);
  z-index: 100;
  padding: 8px 0;
}

.navbar nav ul li.dropdown:hover .dropdown-menu,
.navbar nav ul li.dropdown:focus-within .dropdown-menu {
  display: block;
}

.navbar nav ul li .dropdown-menu li {
  width: 100%;
}

.navbar nav ul li .dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}

.navbar nav ul li .dropdown-menu a:hover {
  background: var(--bg-secondary-color);
  color: var(--primary-color);
}

/* 테마 버튼 */
.theme-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-color);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  font-size: 1.2em;
  border-radius: 50%;
}

.theme-button:hover {
  color: var(--primary-color);
}

.theme-button i {
  font-size: 1.2rem;
  line-height: 1;
}

/* ========================================
   🔥 모바일 반응형 스타일
   ======================================== */
@media (max-width: 768px) {
  /* 모바일에서 네비게이션 메뉴 숨기기 */
  .navbar nav {
    display: none !important;
  }
  
  /* 모바일에서 사용자 프로필 숨기기 */
  #user-profile {
    display: none !important;
  }
  
  /* 모바일에서 마이페이지 링크 숨기기 */
  #my-page-link {
    display: none !important;
  }
  
  /* 모바일에서 로고 클릭 비활성화 */
  .navbar .logo {
    pointer-events: none !important;
    cursor: default !important;
  }
  
  /* 모바일용 사용자 정보 스타일 - 기본적으로 숨김 */
  .mobile-user-info {
    display: none !important;
  }
  
  /* PC 버전에서는 완전히 숨김 */
  @media (min-width: 769px) {
    .mobile-user-info {
      display: none !important;
    }
  }

  /* 모바일에서만 표시 */
  @media (max-width: 768px) {
    /* 로그인 후에만 모바일용 사용자 정보 표시 */
    .mobile-user-info[style*="display: flex"] {
      display: flex !important;
      align-items: center;
      gap: 8px;
    }
  }
  
  .mobile-user-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: 6px;
  }
  
  .mobile-user-link i {
    font-size: 16px;
    color: var(--text-color-secondary);
  }
  
  .mobile-user-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  #mobile-logout-btn {
    background: none;
    border: none;
    color: var(--text-color-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
  }
  
  #mobile-logout-btn:hover {
    background-color: var(--bg-secondary-color);
    color: var(--text-color);
  }
  
  /* 모바일에서 헤더 패딩 조정 */
  .navbar {
    padding: 12px 16px;
    height: 60px;
  }
  
  /* 모바일에서 로고 크기 조정 */
  .navbar .logo img {
    height: 28px;
  }
  
  /* 모바일에서 헤더 우측 영역 정렬 */
  .header-right {
    gap: 8px;
  }
  
  /* 모바일에서 로그인 버튼 크기 조정 */
  .auth-buttons .login,
  .auth-buttons .signup {
    width: 75px;
    height: 32px;
    font-size: 13px;
    padding: 8px 12px;
  }
  
  /* 모바일에서 테마 버튼 크기 조정 */
  .theme-button {
    width: 32px;
    height: 32px;
  }
  
  .theme-button i {
    font-size: 1.1rem;
  }
  
  /* 모바일에서 터치 인터랙션 개선 */
  .auth-buttons .login:active,
  .theme-button:active,
  #mobile-logout-btn:active {
    transform: scale(0.95);
  }
  
  /* 모바일에서 헤더 그림자 효과 */
  .navbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* 모바일에서 로그인 후 로그인 버튼 숨기기 */
  .auth-buttons[style*="display: none"] {
    display: none !important;
  }
}

/* ========== 다크 모드 ========== */
:root.dark-mode .navbar nav > ul > li > a {
  color: #ffffff;
}

:root.dark-mode .dropdown-menu {
  background-color: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

:root.dark-mode .dropdown-item {
  color: var(--text-color);
}

:root.dark-mode .dropdown-item:hover {
  background-color: var(--bg-secondary-color);
  color: var(--text-color);
} 