/* HabitChallenge Navbar - 깔끔한 반응형 */
.habit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 70px;
}

.habit-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  text-decoration: none;
  z-index: 1001;
}

.habit-logo:hover {
  color: #111827;
  text-decoration: none;
}

.habit-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981, #06d6a0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.habit-beta-badge {
  background: #10b981;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

/* 데스크탑 네비게이션 메뉴 */
.habit-nav-menu {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.habit-nav-menu a {
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  transition: color 0.2s;
  padding: 8px 16px;
  border-radius: 6px;
}

.habit-nav-menu a:hover {
  color: #10b981;
  background: #f0fdf4;
}

.habit-nav-menu a.active {
  color: #10b981;
  background: #f0fdf4;
  font-weight: 600;
}

/* 데스크탑에서는 nav-auth-item 숨기기 */
.nav-auth-item {
  display: none;
}

/* 데스크탑 로그인 버튼 */
.habit-nav-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.habit-btn-login {
  background: none;
  border: none;
  color: #374151;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.habit-btn-login:hover {
  background: #f9fafb;
  color: #374151;
  text-decoration: none;
}

/* Mobile Menu Toggle */
.habit-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  z-index: 1002;
}

.habit-mobile-toggle span {
  width: 22px;
  height: 2px;
  background: #374151;
  transition: all 0.3s ease;
  border-radius: 1px;
  margin: 2px 0;
}

.habit-mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.habit-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.habit-mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .habit-header {
    padding: 14px 20px;
  }

  .habit-logo {
    font-size: 20px;
  }

  .habit-logo-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .habit-beta-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* 햄버거 버튼 표시 */
  .habit-mobile-toggle {
    display: flex;
  }

  /* 데스크탑 네비게이션 숨기기 */
  nav .habit-nav-menu {
    display: none;
  }

  /* 데스크탑 액션 버튼들 숨기기 */
  .habit-nav-actions {
    display: none;
  }

  /* 모바일 드롭다운 메뉴 */
  .habit-nav-menu.active {
    display: flex !important;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px;
    gap: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e5e7eb;
    transform: translateY(0);
    z-index: 1001;  /* fixed-bottom-btn(999)보다 위 */
  }

  /* 모바일에서는 nav-auth-item 보이기 */
  .habit-nav-menu.active .nav-auth-item {
    display: list-item;
  }

  .habit-nav-menu.active li {
    width: 100%;
    margin: 0;
  }

  .habit-nav-menu.active a,
  .habit-nav-menu.active button {
    display: block;
    padding: 16px 20px;
    font-size: 18px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    width: 100%;
    margin: 0;
    border-radius: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
  }

  .habit-nav-menu.active li:last-child a,
  .habit-nav-menu.active li:last-child button {
    border-bottom: none;
  }

  .habit-nav-menu.active a:hover,
  .habit-nav-menu.active button:hover {
    background: #f0fdf4;
    color: #10b981;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .habit-header {
    padding: 12px 16px;
  }

  .habit-logo {
    font-size: 18px;
  }

  .habit-nav-menu.active a,
  .habit-nav-menu.active button {
    font-size: 16px;
    padding: 14px 16px;
  }
}
