/* 헤더 컨테이너 */
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max-width);
  height: 80px;
  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: 100%;
  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 > a {
  font-size: 16px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  padding: 0 var(--spacing-lg);
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
  white-space: nowrap;
  border-radius: 8px;
  margin: 0 4px;
}

.menu-area .nav-item > a:hover {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 54px;
  background: var(--color-primary-gradient);
  box-shadow: 0px 4px 15px rgba(178, 30, 35, 0.3);
  border-radius: 30px;
  color: #fff;
}

/* 햄버거 버튼 (모바일) */
.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: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 20px;
  border-top: 1px solid rgba(74, 144, 226, 0.1);
  position: fixed;
  top: var(--header-height-mobile);
  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 - var(--header-height-mobile));
  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;
}

/* 반응형 디자인 - 대형 화면 */
@media (min-width: 1200px) {
  .header-inner {
    height: 90px;
  }

  .logo {
    height: 60px;
    max-width: 250px;
  }

  .nav-item > a {
    font-size: 18px;
    padding: 0 var(--spacing-xl);
  }
}

/* 반응형 디자인 - 중간 화면 */
@media (max-width: 1199px) and (min-width: 1025px) {
  .header-inner {
    height: 85px;
    padding: 0 var(--spacing-lg);
  }

  .logo {
    height: 55px;
    max-width: 220px;
  }

  .nav-item > a {
    font-size: 17px;
    padding: 0 var(--spacing-lg);
  }
}

/* 반응형 디자인 - 태블릿 */
@media (max-width: 1024px) and (min-width: 769px) {
  .header-inner {
    height: 75px;
    padding: 0 var(--spacing-lg);
  }

  .logo {
    height: 45px;
    max-width: 180px;
  }

  /* 태블릿에서 로고 호버 애니메이션 제거 */
  .logo:hover {
    transform: none;
  }

  .nav-item > a {
    font-size: 15px;
    padding: 0 var(--spacing-md);
  }
}

/* 반응형 디자인 - 모바일 */
@media (max-width: 768px) {
  :root {
    --header-height: var(--header-height-mobile);
  }

  .header-inner {
    height: 65px;
    padding: 0 var(--spacing-lg);
  }

  .logo {
    height: 35px;
    max-width: 130px;
  }

  /* 모바일에서 로고 호버 애니메이션 제거 */
  .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) {
  .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);
}
