/**
 * 多语言切换插件样式
 * Language Switcher Plugin Styles
 */

.language-switcher-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.language-switcher-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.language-switcher-icon:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.language-switcher-icon i {
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
}

.language-switcher-icon:hover i {
    color: #2CAC80;
}

.language-switcher-icon.loading {
    background: rgba(44, 172, 128, 0.1);
}

.language-switcher-icon.loading i {
    color: #2CAC80;
}

.language-switcher-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.language-switcher-dropdown.language-switcher-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid white;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.language-switcher-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.language-switcher-item:last-child {
    border-bottom: none;
}

.language-switcher-item:hover {
    background: rgba(44, 172, 128, 0.1);
}

.language-switcher-item.language-switcher-active {
    background: rgba(44, 172, 128, 0.15);
    color: #2CAC80;
    font-weight: 500;
}

.language-switcher-item.language-switcher-active::after {
    content: '✓';
    margin-left: auto;
    color: #2CAC80;
    font-weight: bold;
}

.language-switcher-item .lang-name {
    font-size: 14px;
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .language-switcher-icon {
        width: 36px;
        height: 36px;
    }
    
    .language-switcher-icon i {
        font-size: 16px;
    }
    
    .language-switcher-dropdown {
        min-width: 100px;
        margin-top: 6px;
    }
    
    .language-switcher-item {
        padding: 10px 14px;
    }
    
    .language-switcher-item .lang-name {
        font-size: 13px;
    }
    
    /* 移动端固定定位的语言切换器样式调整 - 放在汉堡菜单右侧 */
    .header-language-switcher {
        position: fixed !important;
        top: 18px !important;
        right: 15px !important; /* 靠右边缘，在汉堡菜单右侧 */
        z-index: 1050 !important; /* 与导航栏同级 */
    }
    
    .header-language-switcher .language-switcher-icon {
        width: 38px !important;
        height: 38px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(0, 0, 0, 0.15) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    }
    
    .header-language-switcher .language-switcher-icon i {
        font-size: 16px !important;
        color: #333 !important;
    }
    
    .header-language-switcher .language-switcher-dropdown {
        right: 0 !important;
        margin-top: 8px !important;
        min-width: 95px !important;
    }
    
    /* 调整汉堡菜单位置，为语言切换器腾出空间 */
    .navbar-toggle {
        margin-right: 55px !important; /* 向左移动，给语言切换器留空间 */
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .header-language-switcher {
        top: 16px !important;
        right: 12px !important; /* 靠右边缘 */
    }
    
    .header-language-switcher .language-switcher-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .header-language-switcher .language-switcher-icon i {
        font-size: 15px !important;
    }
    
    .header-language-switcher .language-switcher-dropdown {
        min-width: 90px !important;
        margin-top: 6px !important;
    }
    
    .header-language-switcher .language-switcher-item {
        padding: 8px 10px !important;
    }
    
    .header-language-switcher .language-switcher-item .lang-name {
        font-size: 12px !important;
    }
    
    /* 超小屏幕汉堡菜单位置调整 */
    .navbar-toggle {
        margin-right: 50px !important;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .language-switcher-icon {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .language-switcher-icon:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .language-switcher-icon i {
        color: #fff;
    }
    
    .language-switcher-dropdown {
        background: #2a2a2a;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .language-switcher-dropdown::before {
        border-bottom-color: #2a2a2a;
    }
    
    .language-switcher-item {
        border-bottom-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .language-switcher-item:hover {
        background: rgba(44, 172, 128, 0.2);
    }
    
    .language-switcher-item.language-switcher-active {
        background: rgba(44, 172, 128, 0.25);
    }
}

/* Header语言切换器样式 */
.header-language-switcher {
    display: inline-block;
    margin: 0px 10px;
}

/* 关键断点优化 - 1121px 以下防止换行 */
@media (min-width: 769px) and (max-width: 1121px) {
    .header-language-switcher {
        margin: 0px 8px 0px 12px !important; /* 压缩间距 */
    }
    
    /* 压缩所有导航项 */
    .navbar-nav > li > a {
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: 14px !important;
    }
    
    /* 压缩下拉菜单图标 */
    .navbar-nav > li > a > i {
        margin-left: 3px !important;
    }
    
    /* 压缩注册按钮 */
    .navbar-btn {
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin-left: 8px !important;
        font-size: 13px !important;
    }
}

/* 更窄视口进一步压缩 - 991px 以下 */
@media (min-width: 769px) and (max-width: 991px) {
    .header-language-switcher {
        margin: 0px 6px 0px 10px !important; /* 进一步压缩 */
    }
    
    .navbar-nav > li > a {
        padding-left: 6px !important;
        padding-right: 6px !important;
        font-size: 13px !important;
    }
    
    .navbar-btn {
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-left: 6px !important;
        font-size: 12px !important;
    }
}

.header-language-switcher .language-switcher-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0);
    box-shadow:0 0;
    margin: 0;
}

.header-language-switcher .language-switcher-icon i {
    font-size: 14px;
    color: #000;
}

.header-language-switcher .language-switcher-icon:hover i {
    /*color: #2CAC80;*/
    color: #000;
}

.header-language-switcher .language-switcher-dropdown {
    top: 100%;
    right: -10px;
    margin-top: 5px;
    min-width: 100px;
}

.header-language-switcher .language-switcher-dropdown::before {
    right: 15px;
}

.header-language-switcher .language-switcher-item {
    padding: 8px 12px;
}

.header-language-switcher .language-switcher-item .lang-name {
    font-size: 12px;
} 