/**
 * 语言切换器样式
 * 优雅的下拉式语言选择器
 */

.language-switcher {
    position: relative;
    display: inline-block;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(155, 143, 165, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lang-trigger:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(155, 143, 165, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.lang-trigger:active {
    transform: translateY(0);
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-name {
    font-weight: 500;
    white-space: nowrap;
}

.lang-arrow {
    transition: transform 0.3s ease;
    color: #666;
}

.lang-trigger:hover .lang-arrow {
    color: #9B8FA5;
}

.lang-dropdown.show .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    position: relative;
}

.lang-option:hover {
    background: rgba(155, 143, 165, 0.08);
}

.lang-option.active {
    background: rgba(155, 143, 165, 0.12);
    color: #9B8FA5;
    font-weight: 600;
}

.lang-option .lang-flag {
    font-size: 20px;
}

.lang-option .lang-name {
    flex: 1;
    text-align: left;
}

.lang-check {
    color: #9B8FA5;
    flex-shrink: 0;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .lang-trigger {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .lang-flag {
        font-size: 16px;
    }
    
    .lang-dropdown {
        min-width: 140px;
    }
    
    .lang-option {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .lang-trigger {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .lang-trigger:hover {
        background: rgba(40, 40, 40, 1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .lang-dropdown {
        background: #2a2a2a;
    }
    
    .lang-option {
        color: #fff;
    }
    
    .lang-option:hover {
        background: rgba(255, 255, 255, 0.08);
    }
    
    .lang-option.active {
        background: rgba(155, 143, 165, 0.2);
    }
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-dropdown.show {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 焦点样式 */
.lang-trigger:focus,
.lang-option:focus {
    outline: 2px solid rgba(155, 143, 165, 0.5);
    outline-offset: 2px;
}

/* 简洁版本（用于紧凑空间） */
.language-switcher.compact .lang-trigger {
    padding: 6px 10px;
}

.language-switcher.compact .lang-name {
    display: none;
}

.language-switcher.compact .lang-flag {
    font-size: 20px;
}

/* 导航栏中的样式调整 */
.navbar-fixed .language-switcher .lang-trigger {
    background: rgba(255, 255, 255, 0.9);
}

.navbar-scrolled .language-switcher .lang-trigger {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

