#header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-family: 'Pretendard', sans-serif;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#hrdflex_header {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  position: relative;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.hd1 img {
  height: 36px;
  transition: all 0.3s ease;
  filter: brightness(1.1);
}

.hd1 img:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.hd2 {
  flex-grow: 1;
  margin: 0 2rem;
  max-width: 600px;
}

.search__container {
  position: relative;
}

.search__input,
.search__input_mobile {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  padding: 0.875rem 1.25rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search__input:focus,
.search__input_mobile:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--hrdflix-red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.search__input::placeholder,
.search__input_mobile::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.hashtag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  background: linear-gradient(135deg, rgba(101, 184, 255, 0.15), rgba(101, 184, 255, 0.08));
  border: 1px solid rgba(101, 184, 255, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  color: rgba(101, 184, 255, 0.9);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.hashtag:hover {
  background: linear-gradient(135deg, rgba(101, 184, 255, 0.25), rgba(101, 184, 255, 0.15));
  border-color: rgba(101, 184, 255, 0.4);
  color: rgba(101, 184, 255, 1);
  transform: translateY(-1px);
}

.login {
  margin-right: 1rem;
}

.login ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.login a {
  color: #212529;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

.login a:hover {
  color: #0066ff;
  background: rgba(0, 102, 255, 0.1);
}

.hd3 img {
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform 0.2s ease;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.hd3 img:hover {
  transform: scale(1.1);
  border-color: var(--hrdflix-red);
}

.navi {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.navi ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 1600px;
}

.navi li {
  position: relative;
}

.navi li > a {
  display: inline-block;
  padding: 1rem 1.5rem;
  color: #212529;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.navi li > a:hover {
  color: #0066ff;
  border-bottom-color: #0066ff;
  background: rgba(0, 102, 255, 0.05);
}

.navi li > ul {
  display: none;
}

/* 메가메뉴 박스 */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
}

.mega-menu.active {
  display: block;
}

/* 해시태그 래퍼 */
.hashtags-wrapper {
  z-index: 100;
}

.hashtags-wrapper.active {
  z-index: 100;
}

/* 해시태그가 열려있을 때 메가메뉴 비활성화 */
.hashtags-wrapper.active ~ .mega-menu {
  display: none !important;
}

.mega-menu-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.mega-menu-column {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 1rem;
}

.mega-menu-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(0, 102, 255, 0.3);
}

.mega-menu-item {
  display: block;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  border-radius: 6px;
  margin-bottom: 0.25rem;
}

.mega-menu-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.navi li > ul > li > a {
  display: block;
  padding: 0.875rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  border-bottom: none;
}

.navi li > ul > li > a:hover {
  background: linear-gradient(90deg, var(--hrdflix-red), transparent);
  color: white;
  padding-left: 1.75rem;
}

#flexside_menu_bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9998;
  display: none;
}

#flexside_menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.98) 0%, rgba(0, 0, 0, 0.98) 100%);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  overflow-y: auto;
  display: none;
}

.menu_line {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.menu_line:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu_line_center {
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.menu_line_center:hover {
  background: rgba(255, 255, 255, 0.1);
}

.m_navi_icon {
  display: none;
  width: 24px;
  height: 20px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.m_navi_icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: white;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.m_navi_icon span:nth-child(1) { top: 0; }
.m_navi_icon span:nth-child(2) { top: 9px; }
.m_navi_icon span:nth-child(3) { top: 18px; }

.m_navi_icon.open span:nth-child(1) {
  top: 9px;
  transform: rotate(135deg);
  background: var(--hrdflix-red);
}

.m_navi_icon.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.m_navi_icon.open span:nth-child(3) {
  top: 9px;
  transform: rotate(-135deg);
  background: var(--hrdflix-red);
}

.ml1_r {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ml2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ml2_l {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.ml2_r {
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
}

.ml3 {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  display: flex;
  justify-content: space-around;
}

.ml3_l, .ml3_r {
  text-align: center;
}

.ml3_l_t, .ml3_r_t {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.25rem;
}

.ml3_l_c, .ml3_r_c {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

@media screen and (max-width: 1024px) {
  #hrdflex_header {
    padding: 0.75rem 1rem;
  }
  
  .hd2 {
    margin: 0 1rem;
  }
}

@media screen and (max-width: 768px) {
  .m_navi_icon { 
    display: block; 
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .hd1 { 
    margin: 0 auto; 
  }
  
  .hd2 {
    display: none;
  }
  
  .login {
    margin-right: 0.5rem;
  }
  
  .login ul {
    gap: 0.5rem;
  }
  
  .login a {
    font-size: 0.8rem;
    padding: 0.375rem 0.5rem;
  }
  
  .navi { 
    display: none; 
  }
  
  .navi.mobile-open {
    display: block;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
  }
  
  .navi.mobile-open ul { 
    flex-direction: column; 
  }
  
  .navi.mobile-open li > a {
    text-align: left;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .navi.mobile-open li > ul {
    position: static;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  
  .navi.mobile-open li.active > ul { 
    display: block; 
  }
  
  #flexside_menu {
    width: min(340px, 100vw - 2rem);
  }
}

@media screen and (max-width: 480px) {
  #hrdflex_header {
    padding: 0.5rem 0.75rem;
  }
  
  .hd1 img {
    height: 28px;
  }
  
  .login a {
    font-size: 0.75rem;
    padding: 0.25rem 0.375rem;
  }
  
  #flexside_menu {
    width: 100%;
    right: 0;
  }
}

/* 스크롤 애니메이션 */
@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

#header {
  animation: slideInFromTop 0.6s ease-out;
}

#flexside_menu {
  animation: slideInFromRight 0.4s ease-out;
}

.menu_line_l img {
  transition: all 0.3s ease;
  filter: brightness(0.8);
}

.menu_line:hover .menu_line_l img {
  filter: brightness(1.2);
  transform: scale(1.1);
}