/**
 * Language Switcher CSS Styles
 * أنماط CSS لمبدل اللغة
 */

/* Language Switcher Wrapper */
.language-switcher-wrapper {
    position: relative;
    display: inline-block;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
}

/* Current Language Button - Template Matching Design */
.language-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7f2;
    border-radius: 4px;
    color: #566985;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', 'Cairo', 'Jost', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.language-current:hover {
    border-color: #fd7b21;
    color: #fd7b21;
    box-shadow: 0 4px 8px rgba(253, 123, 33, 0.15);
}

.language-current .lang-flag {
    font-size: 18px;
}

.language-current .lang-name {
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.language-current .fa-chevron-down {
    font-size: 10px;
    margin-right: 0;
    margin-left: 4px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

[dir="ltr"] .language-current .fa-chevron-down {
    margin-left: 0;
    margin-right: 4px;
}

.language-dropdown:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* Language Options Dropdown - Template Style */
.language-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    margin-top: 8px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 1000;
    padding: 6px 0;
    border: 1px solid #eee;
}

[dir="rtl"] .language-options {
    left: auto;
    right: 0;
}

.language-dropdown:hover .language-options,
.language-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Language Option Item - Template Style */
.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #566985;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Tajawal', 'Cairo', 'Jost', sans-serif;
}

[dir="rtl"] .language-option {
    text-align: right;
}

.language-option:hover {
    background: #f5f7fb;
    color: #fd7b21;
}

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

.language-option .lang-name {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-weight: 500;
}

/* Language Buttons Style - Enhanced */
.language-buttons {
    display: flex;
    gap: 10px;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 2px solid #ffe8d6;
    border-radius: 50px;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.language-btn:hover {
    border-color: #fd7b21;
    color: #fd7b21;
    background: linear-gradient(135deg, #fff5eb 0%, #fff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 123, 33, 0.15);
}

.language-btn.active {
    background: linear-gradient(135deg, #fd7b21 0%, #ff8c42 100%);
    border-color: #fd7b21;
    color: white;
    box-shadow: 0 4px 12px rgba(253, 123, 33, 0.35);
}

.language-btn .lang-flag {
    font-size: 16px;
}

/* Minimal Language Switcher - Enhanced */
.language-switcher-minimal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #fd7b21;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #fd7b21;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: transparent;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.language-switcher-minimal:hover {
    background: linear-gradient(135deg, #fd7b21 0%, #ff8c42 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 123, 33, 0.35);
}

/* Header Language Switcher Container - Fixed positioning */
.header-language-switcher {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    margin-right: 10px;
    height: 70px;
    position: relative;
    z-index: 100;
}

[dir="rtl"] .header-language-switcher {
    margin-left: 10px;
    margin-right: 10px;
}

/* Mobile Language Switcher - Template Style */
@media (max-width: 768px) {
    .language-current {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .language-current .lang-flag {
        font-size: 16px;
    }
    
    .language-current .lang-name {
        display: none;
    }
    
    .language-options {
        min-width: 140px;
        border-radius: 4px;
    }
    
    .language-option {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Animation for language switch */
@keyframes languagePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.language-current.switching {
    animation: languagePulse 0.3s ease;
}

/* RTL Specific Adjustments */
[dir="rtl"] .language-switcher-wrapper {
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

[dir="ltr"] .language-switcher-wrapper {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

/* Fixed Header Position */
.fixed-header .language-switcher-wrapper {
    margin: 0 10px;
}

/* Integration with existing header styles - Template Matching */
.header-right-side .language-switcher-wrapper {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
}

[dir="rtl"] .header-right-side .language-switcher-wrapper {
    margin-right: 0;
    margin-left: 10px;
}

.main-header .language-dropdown .language-current {
    background: #fff;
    border: 1px solid #e5e7f2;
    color: #566985;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.main-header .language-dropdown .language-current:hover {
    border-color: #fd7b21;
    color: #fd7b21;
    box-shadow: 0 4px 8px rgba(253, 123, 33, 0.15);
}

.main-header.scrolled .language-dropdown .language-current {
    background: #fff;
    border: 1px solid #e5e7f2;
    color: #566985;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
