/**
 * Voitrans 国际化样式
 * 语言切换器和相关UI组件样式
 */

/* 语言切换器容器 */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

/* 语言切换按钮 */
.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #ffffff;
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 40px;
    height: 32px;
}

.lang-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f8f9fa;
}

.lang-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: #ffffff;
}

.lang-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* 语言切换分隔符 */
.lang-separator {
    width: 1px;
    height: 16px;
    background: #e0e0e0;
    margin: 0 4px;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .lang-switcher {
        margin-left: 8px;
        gap: 4px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 32px;
        height: 28px;
    }
}

/* 导航栏中的语言切换器 */
.navigation-bar---menu-items-container .lang-switcher {
    margin-left: auto;
}

/* 确保语言切换器在导航栏中正确对齐 */
.navigation-bar---content-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navigation-bar---menu-items-container {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* 下拉菜单样式的语言切换器（备选方案） */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #ffffff;
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-dropdown-toggle:hover {
    border-color: #007bff;
    color: #007bff;
}

.lang-dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.lang-dropdown.open .lang-dropdown-toggle::after {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 120px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.lang-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.lang-dropdown-item:hover {
    background: #f8f9fa;
}

.lang-dropdown-item.active {
    background: #007bff;
    color: #ffffff;
}

/* 加载状态 */
/* 加载状态样式 */
.i18n-loading {
    cursor: wait;
}

.i18n-loading .lang-btn {
    opacity: 0.6;
    pointer-events: none;
}

.i18n-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* 错误通知样式 */
.i18n-error-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 语言切换动画 */
.i18n-fade-out {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.i18n-fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 改进的语言切换器样式 */
.lang-switcher {
    position: relative;
}

.lang-switcher::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px;
    width: 1px;
    height: 20px;
    background: #e0e0e0;
    transform: translateY(-50%);
}

/* 语言切换器悬停效果 */
.lang-switcher:hover .lang-btn:not(.active) {
    opacity: 0.7;
}

.lang-switcher:hover .lang-btn.active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* 更好的焦点状态 */
.lang-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .lang-btn {
        border-width: 2px;
    }

    .lang-btn.active {
        border-width: 3px;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    .lang-btn,
    .i18n-loading,
    .i18n-fade-out,
    .i18n-fade-in {
        transition: none;
    }

    .lang-switcher:hover .lang-btn.active {
        transform: none;
        box-shadow: none;
    }
}
