/* 헤더 컴포넌트 전용 CSS */

/* 인사이트 메뉴 숨김 (기본값) */
.insight-menu {
    display: none !important;
}

/* 한국어일 때만 인사이트 메뉴 표시 */
body[lang="ko"] .insight-menu,
html[lang="ko"] .insight-menu,
.insight-menu.show-for-korean {
    display: block !important;
}

/* 헤더 기본 스타일 */
header { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 80px; 
    transition: 1s; 
    z-index: 99; 
    background-color: transparent; 
}

/* 스크롤된 헤더 스타일 */
header.scrolled { 
    background-color: rgba(255, 255, 255, 0.3); 
    backdrop-filter: blur(15px); 
    transition: 1s; 
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15); 
}

header.scrolled nav .navi a, 
header.scrolled nav { 
    color: #333; 
}

header.scrolled nav .menu_wrap .navi a { 
    color: #333; 
}


header.scrolled nav .logo { 
    background-image: url(../img/logo_color.png); 
}

/* 네비게이션 스타일 */
header nav { 
    max-width: 1025px; 
    margin: 0 auto; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    color: var(--cfff); 
    padding: 0 20px;
}

header nav .logo { 
    width: 170px; 
    height: 45px; 
    margin-top: 10px; 
    background-repeat: no-repeat; 
    background-size: contain; 
    background-image: url(../img/logo.svg); 
    cursor: pointer; 
}

header nav .logo a { 
    display: block; 
    width: 100%; 
    height: 100%; 
}

header nav .logo img { 
    width: 100%; 
}

header nav .navi a { 
    display: inline-block; 
    padding: 0 10px; 
    text-decoration: none; 
    color: var(--cfff); 
}

header nav .menu_wrap { 
    display: flex; 
    align-items: center; 
    justify-content: end; 
    width: 60%; 
}

/* PC용 네비게이션 스타일 */
header nav .menu_wrap .navi { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

header nav .menu_wrap .navi a { 
    color: var(--cfff); 
    font-size: 16px; 
    padding: 8px 16px; 
    border-radius: 20px; 
    transition: all 0.3s ease; 
}


/* 언어 선택기 스타일 */
.language-selector { 
    position: relative; 
    margin-left: 20px; 
    z-index: 1000; 
    cursor: pointer; 
}

.language-selector * { 
    pointer-events: auto; 
}

.selected-language { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 16px; 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 8px; 
    cursor: pointer; 
    color: var(--cfff); 
    font-size: 14px; 
    transition: all 0.3s ease; 
    user-select: none; 
}

header.scrolled .selected-language { 
    color: var(--c333); 
    background: rgba(0, 0, 0, 0.05); 
}

.selected-language:hover { 
    background: rgba(255, 255, 255, 0.2); 
    transform: translateY(-1px); 
}

header.scrolled .selected-language:hover { 
    background: rgba(0, 0, 0, 0.1); 
}

.selected-language:active { 
    transform: translateY(0); 
}

.selected-language .flag { 
    font-size: 16px; 
    transition: transform 0.2s ease; 
}

.selected-language:hover .flag { 
    transform: scale(1.1); 
}

.selected-language .arrow { 
    font-size: 10px; 
    transition: transform 0.3s ease; 
}

.selected-language.active .arrow { 
    transform: rotate(180deg); 
}

.language-options { 
    position: absolute; 
    top: calc(100% + 8px); 
    right: 0; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); 
    padding: 8px 0; 
    min-width: 160px; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px) scale(0.95); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1003;
    touch-action: manipulation;
    pointer-events: none;
}

.language-options.active { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0) scale(1); 
    pointer-events: all;
    z-index: 1004;
}

.language-options li { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 12px 16px; 
    color: var(--c333); 
    font-size: 14px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    position: relative; 
    overflow: hidden; 
}

.language-options li::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: -100%; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); 
    transition: left 0.5s ease; 
}

.language-options li:hover::before { 
    left: 100%; 
}

.language-options li:hover { 
    background: var(--cf8f); 
    transform: translateX(4px); 
}

.language-options li.active { 
    background: var(--ce3e); 
    color: var(--c209); 
    font-weight: 600; 
    position: relative; 
}

.language-options li .flag { 
    font-size: 16px; 
    transition: transform 0.2s ease; 
}

.language-options li:hover .flag { 
    transform: scale(1.2); 
}

/* 모바일 컨트롤 영역 */
.mobile-controls { 
    display: none; 
    align-items: center; 
    gap: 12px; 
    position: relative; 
    z-index: 100; 
}

/* 모바일 언어 선택기 */
.mobile-language-selector { 
    position: relative; 
}

.mobile-language-selector .selected-language { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 8px 12px; 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 8px; 
    cursor: pointer; 
    color: var(--cfff); 
    font-size: 12px; 
    transition: all 0.3s ease; 
    min-height: 32px;
    min-width: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-language-selector .selected-language .flag { 
    font-size: 14px; 
}

.mobile-language-selector .selected-language .arrow { 
    font-size: 8px; 
}

.mobile-language-selector .language-options { 
    position: absolute; 
    top: calc(100% + 4px); 
    right: 0; 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); 
    padding: 4px 0; 
    min-width: 80px; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-5px); 
    transition: all 0.2s ease; 
    z-index: 1002; 
}

.mobile-language-selector .language-options.active { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}

.mobile-language-selector .language-options li { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 10px 12px; 
    color: #333; 
    font-size: 12px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    min-height: 36px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-language-selector .language-options li:hover { 
    background: #f0f0f0; 
}

/* 햄버거 메뉴 애니메이션 */
.mobile_menu { 
    display: none; 
    flex-direction: column; 
    justify-content: space-between; 
    cursor: pointer; 
    transition: transform 0.3s ease; 
    width: 20px; 
    height: 14px; 
    color: #fff; 
}

.mobile_menu span { 
    display: block; 
    background-color: #fff; 
    transition: all 0.3s ease; 
    transform-origin: center; 
    height: 2px; 
    border-radius: 1px; 
}

.mobile_menu.active span:nth-child(1) { 
    transform: translateY(5px) rotate(45deg); 
}

.mobile_menu.active span:nth-child(2) { 
    opacity: 0; 
    transform: scale(0); 
}

.mobile_menu.active span:nth-child(3) { 
    transform: translateY(-5px) rotate(-45deg); 
}

/* 스크롤된 헤더에서의 색상 */
header.scrolled .mobile_menu { 
    color: #333; 
}

header.scrolled .mobile_menu span { 
    background-color: #333; 
}

header.scrolled .mobile-language-selector .selected-language { 
    background: rgba(0, 0, 0, 0.05); 
    color: #333; 
}

/* PC/태블릿 (769px 이상) */
@media (min-width: 769px) {
    .mobile-controls { 
        display: none !important; 
    }
    .selected-language .lang-short, 
    .language-options li .lang-short { 
        display: none; 
    }
    .selected-language .lang-text, 
    .language-options li .lang-text { 
        display: inline; 
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    header { 
        position: fixed; 
        height: 60px; 
        top: 0; 
        left: 0; 
        right: 0; 
        z-index: 99; 
    }
    header nav { 
        max-width: 100%; 
        padding: 0 16px; 
        height: 60px; 
        
    }
    header nav .logo { 
        width: 140px; 
        height: 35px; 
        margin-top: 5px; 
    }
    
    /* PC용 언어 선택기 숨기기 */
    .language-selector { 
        display: none !important; 
    }
    
    /* 모바일에서도 네비게이션 메뉴 표시 */
    header nav .menu_wrap { 
        display: flex !important; 
        width: 100% !important;
        justify-content: center !important;
        margin-top: 10px;
    }
    
    header nav .menu_wrap .navi {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    header nav .menu_wrap .navi a {
        font-size: 14px !important;
        padding: 6px 12px !important;
        margin: 0 !important;
        border-radius: 15px !important;
        color: #fff !important;
        transition: all 0.3s ease;
    }
   
    .mobile-controls { 
        display: flex; 
    }
    /* 모바일에서 네비게이션은 항상 표시되므로 드롭다운 스타일 제거 */
    
}
