/* ===== 데스크톱 스타일 ===== */

/* 데스크톱 메뉴 가로 정렬 */
#header .desktop-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

#header .desktop-menu .dropmenu {
    display: inline-block;
    flex-shrink: 0;
}

#header .desktop-menu .dropmenu ul {
    display: inline-flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

#header .desktop-menu .dropmenu ul li {
    display: inline-block;
    margin: 0;
    white-space: nowrap;
}

/* 데스크톱 언어 선택기 */
.desktop-langswitcher {
    display: inline-block;
    margin-left: 30px;
    position: relative;
    top: 13px;
    flex-shrink: 0;
    white-space: nowrap;
}

.desktop-langswitcher .langswitcher {
    display: inline-block;
    white-space: nowrap;
}

.desktop-langswitcher a {
    padding: 0 8px;
    text-decoration: none;
    transition: opacity 0.3s ease;
    display: inline-block;
    white-space: nowrap;
    position: relative;
}

.desktop-langswitcher a:hover {
    opacity: 0.7;
}

/* 현재 선택된 언어 강조 */
.langswitcher a.active {
    font-weight: bold;
    color: #007bff;
}

/* 언어 왼쪽에 구분선 추가 (첫 번째 언어 제외) */
.desktop-langswitcher a:not(:first-child)::before {
    content: "|";
    position: absolute;
    left: -4px;
    color: #ccc;
    font-weight: normal;
}

/* 선택된 언어의 왼쪽 구분선을 주황색으로 */
.desktop-langswitcher a.active:not(:first-child)::before {
    color: #ff6600 !important;
}

/* 메뉴와 언어 선택기 사이 구분선 (선택사항) */
.desktop-langswitcher::before {
    content: "|";
    margin-right: 15px;
    color: #ccc;
    position: relative;
    top: -13px;
}

/* 네비게이션 전체 컨테이너 */
#header .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

#header .navbar-section {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

/* 화면이 좁아져도 한 줄 유지 */
#header .navbar-section.desktop-menu {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
}

/* 로고 섹션 */
#header .navbar-section.logo {
    flex-shrink: 0;
}

/* 모바일 언어 메뉴 숨김 (데스크톱에서) */
.mobile-lang-menu {
    display: none !important;
}

/* ===== 중간 크기 화면 대응 (태블릿 ~ 작은 데스크톱) ===== */
@media (min-width: 841px) and (max-width: 1200px) {
    #header .desktop-menu .dropmenu ul li a {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .desktop-langswitcher {
        margin-left: 20px;
    }
    
    .desktop-langswitcher a {
        font-size: 14px;
        padding: 0 6px;
    }
}

/* ===== 모바일 스타일 ===== */
@media (max-width: 840px) {
    /* 데스크톱 언어 선택기 숨김 */
    .desktop-langswitcher {
        display: none !important;
    }
    
    /* 모바일 언어 메뉴 표시 */
    .mobile-lang-menu {
        display: block !important;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 60px;
        padding-top: 40px;
        position: relative;
        transform: translateY(50px);
    }
    
    /* 모바일 메뉴 내 언어 선택기 스타일 */
    .langswitcher-mobile-wrapper {
        text-align: center;
        padding: 20px 30px;
        margin-top: 20px;
    }
    
    .langswitcher-mobile-wrapper .langswitcher {
        display: block;
    }
    
    .langswitcher-mobile-wrapper .langswitcher a {
        display: inline-block;
        padding: 10px 20px;
        margin: 5px;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 25px;
        color: #fff;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .langswitcher-mobile-wrapper .langswitcher a:hover,
    .langswitcher-mobile-wrapper .langswitcher a.active {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.4);
    }
    
    /* 모바일에서 구분선 제거 */
    .langswitcher-mobile-wrapper .langswitcher a::before {
        display: none;
    }
}

/* ===== 모바일 메뉴 애니메이션 ===== */
@keyframes fadeInRight {
    0% {
        opacity: 0;
        left: 20%;
    }
    100% {
        opacity: 1;
        left: 0;
    }
}

/* Quark 테마 모바일 메뉴 스타일과 통합 */
#header .mobile-menu.active ~ .overlay nav ul li.mobile-lang-menu {
    animation: fadeInRight 0.5s ease forwards;
    animation-delay: 0.4s;
}
