/**
 * 다국어 시스템 스타일
 */

/* 언어 선택기 컨테이너 */
.language-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 20px;
    pointer-events: auto !important;
    z-index: 1000;
    position: relative;
}

/* 언어 버튼 */
.lang-btn {
    padding: 8px 14px;
    background: #f0f0f0;
    border: 2px solid #00d084;
    color: #2c3e50;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    pointer-events: auto !important;
    z-index: 1000;
    position: relative;
}

.lang-btn:hover {
    background: #00d084;
    color: white;
    border-color: #00d084;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.3);
}

.lang-btn.active {
    background: #00d084;
    color: white;
    border-color: #00d084;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.4);
}

/* 네비게이션 내 언어 선택기 */
nav .language-selector {
    margin-left: 20px;
}

/* 네비게이션 오른쪽 영역 (메뉴 + 언어) */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 모바일 네비게이션 언어 선택기 */
.mobile-nav .language-selector {
    padding: 20px;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

/* 다국어 컨텐츠 전환 애니메이션 */
[data-i18n],
[data-i18n-html] {
    transition: opacity 0.2s ease;
}

.i18n-transition {
    opacity: 0;
}

/* 언어별 폰트 최적화 */
:lang(ko) {
    font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

:lang(en) {
    font-family: 'Inter', 'Roboto', sans-serif;
}

:lang(zh) {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

/* 반응형 - 태블릿 및 모바일 */
@media (max-width: 768px) {
    /* 모바일 헤더 레이아웃 조정 */
    .nav-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    /* 모바일에서는 nav-menu만 슬라이드 메뉴로 동작 */
    .nav-right {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        padding: 30px;
        transition: left 0.3s ease;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        z-index: 999;
        gap: 20px;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    /* 모바일에서 언어 선택기는 항상 보이도록 */
    .language-selector {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 4px;
        margin-left: 0;
        position: relative;
        z-index: 1001;
        flex-shrink: 0;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 11px;
        border-width: 1px;
        border-color: #ddd;
        color: #999;
        background: white;
        white-space: nowrap;
        min-width: 35px;
        flex-shrink: 0;
    }
    
    .lang-btn.active {
        background: var(--primary-green);
        color: white;
        border-color: var(--primary-green);
    }
}

/* 반응형 - 작은 모바일 */
@media (max-width: 480px) {
    .language-selector {
        gap: 3px;
    }
    
    .lang-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 30px;
        border-width: 1px;
        border-color: #ddd;
        color: #999;
        background: white;
    }
    
    .lang-btn.active {
        background: var(--primary-green);
        color: white;
        border-color: var(--primary-green);
    }
}

/* 언어 선택기 툴팁 */
.lang-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

/* 로딩 상태 */
.i18n-loading [data-i18n],
.i18n-loading [data-i18n-html] {
    opacity: 0.5;
}
