html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f7f9fc;
  color: #333;
  overflow-x: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 5%;
  background-color: transparent;
  box-shadow: none;
  width: 100%;
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  position: relative;
  padding: 5px;
  transition: transform 0.3s ease;
  margin-left: -70px;
}

.logo-image {
  height: 120px;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
}

.logo-container:hover {
  transform: translateY(-2px);
}

.logo-container:hover .logo-image {
  transform: scale(1.05);
}

.logo-container::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0056d6, transparent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.logo-container:hover::after {
  transform: scaleX(1);
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0056d6, #00b2ff);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 86, 214, 0.2);
  transition: all 0.3s ease;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: rotate(45deg) translateY(-100%);
  }
  100% {
    transform: rotate(45deg) translateY(100%);
  }
}

.logo-icon:hover {
  transform: rotate(-5deg) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 86, 214, 0.3);
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-left: 10px;
}

.logo-text h1 {
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(135deg, #0056d6, #00b2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  letter-spacing: -0.5px;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.logo-text h1 .korea-text {
  font-size: 14px;
  font-weight: 600;
  color: #0056d6 !important;
  -webkit-text-fill-color: #0056d6 !important;
  background: none !important;
  padding: 0;
  letter-spacing: 0.5px;
  vertical-align: baseline;
  text-transform: lowercase;
  line-height: 1.2;
  margin-left: 4px;
  display: inline-block;
}

.logo-text span {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transform: translateX(-8px);
}

.nav-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  justify-content: center;
  position: relative;
  margin-left: 80px;
  flex-wrap: nowrap;
}

.nav-banner-item {
  position: relative;
  padding: 14px 26px;
  background-color: transparent;
  color: #333333;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-banner-item:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.nav-banner-item:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.nav-banner-item:hover {
  color: #0056d6;
}

.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 100;
  min-width: 180px;
  padding: 8px 0;
}

.nav-banner-item:hover .sub-menu {
  display: block;
}

.sub-menu a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: #333;
  background-color: #ffffff;
  font-size: 14px;
  position: relative;
}

.sub-menu a::before {
  content: "";
  width: 4px;
  height: 100%;
  background-color: #007bff;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sub-menu a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background-color: #007bff;
  transition: width 0.4s ease-in-out;
}

.sub-menu a:hover {
  color: #0056d6;
  background-color: #ffffff;
}

.sub-menu a:hover::before {
  opacity: 1;
}

.sub-menu a:hover::after {
  width: 100%;
}

/* 🔍 검색창 */
.search {
  position: absolute;
  right: 20px;
  width: 50px;
  height: 50px;
  background: white;
  box-sizing: border-box;
  border-radius: 25px;
  border: 4px solid white;
  padding: 5px;
  transition: width 0.3s ease;
  z-index: 1000;
}

.search input {
  position: absolute;
  top: 0;
  right: 45px;
  width: calc(100% - 50px);
  height: 42.5px;
  line-height: 30px;
  outline: none;
  border: none;
  display: none !important;
  border-radius: 20px;
  padding: 0 10px;
  background: white;
}

.search:hover {
  width: 250px;
  cursor: pointer;
}

.search .fa {
  box-sizing: border-box;
  padding: 10px;
  width: 42.5px;
  height: 42.5px;
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 50%;
  color: #000000;
  text-align: center;
  font-size: 1.2em;
  transition: all 0.3s ease;
  background: transparent;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 시각장애인용 숨김 텍스트 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.autocomplete-items {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  background-color: #fff;
  border: 1px solid #ddd;
  border-top: none;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  border-radius: 0 0 8px 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.autocomplete-items li {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.autocomplete-items li:hover {
  background-color: #f0f4ff;
  color: #0056d6;
  font-weight: 500;
}

/* 햄버거 메뉴 버튼 */
.menu-toggle {
  display: none;
  width: 25px;
  height: 20px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1000;
  margin-right: 20px;
}

.menu-toggle span {
  display: block;
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #0056d6;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 8px; }
.menu-toggle span:nth-child(3) { top: 16px; }

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 모바일 메뉴 스타일 */
@media screen and (max-width: 1024px) {
  header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo-container {
    flex: 0 1 auto;
  }

  .menu-toggle {
    display: block;
    flex: 0 0 auto;
  }

  .nav-banner {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    padding: 80px 0 20px;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
    z-index: 999;
    margin: 0;
    flex-direction: column;
    gap: 0;
  }

  .menu-toggle:hover + .nav-banner,
  .nav-banner:hover {
    right: 0;
  }

  .nav-banner-item {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
    transition: background-color 0.3s ease;
    white-space: normal;
  }

  .nav-banner-item:hover {
    background-color: #f8f9fa;
  }

  .nav-banner-item::after {
    content: '▶';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 12px;
  }

  .nav-banner-item:hover::after {
    transform: translateY(-50%) rotate(90deg);
  }

  .sub-menu {
    position: static;
    display: none;
    width: 100%;
    padding: 0;
    margin-top: 10px;
    background: #f8f9fa;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

  .nav-banner-item:hover .sub-menu {
    display: block;
  }

  .sub-menu a {
    padding: 12px 35px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
  }

  .sub-menu a:hover {
    background-color: #e8e8e8;
    padding-left: 40px;
  }

  .sub-menu a:last-child {
    border-bottom: none;
  }

  /* 검색창 모바일 스타일 */
  .search {
    position: static;
    width: calc(100% - 40px);
    margin: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
  }
}

/* 로고 반응형 조정 */
@media screen and (max-width: 768px) {
  .logo-image {
    height: 85px;
  }
}