/* 多语言切换器样式 */
/* Language Switcher Styles */

.language-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.language-switch {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #e1f3f2;
    padding: 10px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 60, 116, 0.12);
    box-shadow: 0 6px 16px rgba(0, 44, 116, 0.12);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #002c74;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lang-btn:hover {
    background: #0640a5;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.lang-btn.active {
    background: linear-gradient(135deg, #0b3a88 0%, #002c74 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(6, 64, 165, 0.45), 0 0 18px rgba(0, 44, 116, 0.45);
    transform: scale(1.05);
}

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

.lang-name {
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .language-switch {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 6px;
        padding: 10px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .lang-name {
        font-size: 11px;
    }
    
    .lang-flag {
        font-size: 16px;
    }
}

/* 小屏幕 - 只显示旗帜 */
@media (max-width: 480px) {
    .lang-name {
        display: none;
    }
    
    .lang-btn {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }
    
    .lang-flag {
        font-size: 20px;
    }
}

/* RTL（从右到左）语言支持 */
body.rtl {
    direction: rtl;
}

body.rtl .language-switcher {
    margin-left: 0;
    margin-right: 20px;
}

body.rtl .nav-links {
    flex-direction: row-reverse;
}

body.rtl .main-category-header {
    text-align: right;
}

body.rtl .category-card {
    text-align: right;
}

body.rtl .subcategory-card {
    text-align: right;
}

body.rtl .subcategory-features {
    align-items: flex-end;
}

body.rtl .btn {
    flex-direction: row-reverse;
}

body.rtl .category-link {
    flex-direction: row-reverse;
}

body.rtl .hero-content {
    text-align: right;
}

body.rtl .hero-buttons {
    flex-direction: row-reverse;
}

/* 平滑过渡 */
* {
    transition: direction 0.3s ease;
}

/* 语言切换动画 */
@keyframes languageChange {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-i18n] {
    animation: languageChange 0.3s ease;
}

/* 阿拉伯语特殊字体优化 */
html[lang="ar"] {
    font-family: 'Arabic', 'Segoe UI', 'Tahoma', sans-serif;
}

html[lang="ar"] .hero-title {
    font-size: 3.5rem;
}

html[lang="ar"] .main-category-header h2 {
    font-size: 2rem;
}

/* 德语长单词优化 */
html[lang="de"] {
    word-break: break-word;
    hyphens: auto;
}

/* 移动端导航栏语言切换 */
@media (max-width: 768px) {
    .nav-links.active {
        display: flex;
        flex-direction: column;
    }
    
    .nav-links.active .language-switcher {
        order: 999;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* 悬停效果增强 */
.lang-btn {
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.lang-btn:hover::before {
    width: 200%;
    height: 200%;
}

/* 活动语言指示器 */
.lang-btn.active::after {
    content: '✓';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #4ade80;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 可访问性 - 焦点状态 */
.lang-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 打印时隐藏 */
@media print {
    .language-switcher {
        display: none;
    }
}

