/* 헤더 컨테이너 */
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max-width);
  height: 100px;
  margin: 0 auto;
  position: relative;
}

/* 로고 스타일링 */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: var(--transition-fast);
  background-image: url('../images/header/blogo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 120px;
  max-width: 120px;
  height: 42px;
  z-index: 1001;
}

/* 네비게이션 메뉴 */
nav.menu-area {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 40%;
  display: flex;
  align-items: center;
}

/* 드롭다운 메뉴 스타일 */
.nav-item.has-dropdown {
  position: relative;
}

.nav-item.has-dropdown > a {
  position: relative;
}

.nav-item.has-dropdown .dropdown-arrow {
  font-size: 12px;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.nav-item.has-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* 하위메뉴 컨테이너 */
.submenu {
  position: absolute;
  top: 100%;
  left: 15px;
  background: #ffffff;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-item.has-dropdown:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 하위메뉴 아이템 */
.submenu-item {
  position: relative;
}

.submenu-item > a {
  display: block;
  padding: 12px 20px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

.submenu-item > a:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--color-primary);
  box-shadow: none;
}

.submenu-item:first-child > a {
  border-radius: 12px 12px 0 0;
}

.submenu-item:last-child > a {
  border-radius: 0 0 12px 12px;
}

/* 하위메뉴 구분선 */
.submenu-item:not(:last-child) > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.nav-item > a {
  font-size: 16px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  padding: 0 var(--spacing-md);
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  white-space: nowrap;
  border-radius: 8px;
  margin: 0 4px;
}

.menu-area .nav-item > a:hover {
  opacity: 0.8;
}

/* 햄버거 버튼 (모바일) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 20px;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s ease;
  background: none;
  border: none;
  padding: 0;
  outline: none;
}

.hamburger div {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #4a90e2, #357abd);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger:hover div {
  background: linear-gradient(90deg, #357abd, #4a90e2);
}

.hamburger:focus {
  outline: none;
}

/* 햄버거 버튼 애니메이션 */
.hamburger.active div:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active div:nth-child(2) {
  opacity: 0;
}

.hamburger.active div:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 모바일 메뉴 */
.mobile-menu {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 20px;
  border-top: 1px solid rgba(74, 144, 226, 0.1);
  position: fixed;
  top: 86px;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 86px);
  overflow-y: auto;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu .nav-item {
  overflow: hidden;
}

.mobile-menu .nav-item > a {
  width: 100%;
  padding: 16px 20px;
  border-bottom: 1px solid #e6e6e6;
  border-radius: 0;
  margin: 0;
  font-weight: 600;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.mobile-menu .nav-item:last-child > a {
  border-bottom: none;
}

.mobile-menu .nav-item > a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.1), transparent);
}

/* 아이콘과 텍스트 사이 여백 */
.mobile-menu .nav-item > a i {
  color: var(--primary-color);
  margin-right: 8px;
}

/* 모바일 메뉴 화살표 아이콘 오른쪽 정렬 */
.mobile-menu .nav-item > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu .nav-item > a i:last-child {
  margin-right: 0;
  margin-left: auto;
  font-size: 20px;
}

/* 모바일 드롭다운 메뉴 스타일 */
.mobile-dropdown {
  display: block;
  position: relative;
}

.mobile-dropdown > a {
  cursor: pointer;
}

.mobile-dropdown .dropdown-arrow {
  transition: transform 0.3s ease;
  font-size: 18px;
}

.mobile-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* 모바일 하위메뉴 */
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #ffffff;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.mobile-dropdown.active .mobile-submenu {
  max-height: 300px;
}

.mobile-submenu-item {
  border-bottom: 1px solid #e6e6e6;
}

.mobile-submenu-item:last-child {
  border-bottom: none;
}

.mobile-submenu-item > a {
  display: flex;
  align-items: center;
  padding: 12px 20px 12px 40px;
  color: #333333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

.mobile-submenu-item > a:hover {
  background: #f8f9fa;
  color: #333333;
  transform: none;
  box-shadow: none;
}

.mobile-submenu-item > a i {
  margin-right: 8px;
  font-size: 16px;
  color: #666666;
}

/* 반응형 디자인 - 중간 화면 */
@media (max-width: 1320px) and (min-width: 1025px) {
  .header-inner {
    height: 85px;
    padding: 0 var(--spacing-lg);
  }

  .logo {
    height: 30px;
  }

  .nav-item > a {
    font-size: 17px;
  }
}

/* 반응형 디자인 - 모바일 */
@media (max-width: 1024px) {
  :root {
    --header-height: var(--header-height-mobile);
  }

  .header-inner {
    height: 86px;
    padding: 0 var(--spacing-lg);
  }

  .logo {
    height: 30px;
    max-width: 98px;
  }

  /* 모바일에서 로고 호버 애니메이션 제거 */
  .logo:hover {
    transform: none;
  }

  nav.menu-area {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* 햄버거 메뉴 색상을 로고 색상과 맞춤 */
  .hamburger {
    width: 22px;
    height: 18px;
  }

  .hamburger div {
    background: #000;
    height: 2px;
  }

  .hamburger:hover div {
    background: #000;
  }

  /* 모바일에서 스크롤 시 헤더 스타일 변경 */
  header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
}

/* 반응형 디자인 - 작은 모바일 */
@media (max-width: 480px) {
  .logo {
    height: 26px;
    max-width: 84px;
  }

  .mobile-menu {
    padding: 16px;
  }

  .mobile-menu .nav-item > a {
    padding: 14px 16px;
  }
}

/* 반응형 디자인 - 매우 작은 모바일 */
@media (max-width: 360px) {
  .mobile-menu .nav-item > a {
    padding: 12px 14px;
  }
}

/* 스크롤 시 헤더 효과 */
header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}
