/* Language Slider Toggle Component */
.language-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--vz-body-bg);
    border: 1px solid var(--vz-border-color);
    border-radius: 20px;
    padding: 4px;
    min-width: 120px;
    height: 40px;
    transition: all 0.3s ease;
}

.language-slider-container:hover {
    border-color: #F2B90F;
    box-shadow: 0 0 0 0.125rem rgba(242, 185, 15, 0.25);
}

.language-slider-track {
    position: relative;
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    border-radius: 16px;
    background: transparent;
    overflow: hidden;
    direction: ltr; /* keep slider logic consistent even on rtl pages */
}

.language-slider-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #F2B90F, #ffc107);
    border-radius: 16px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(242, 185, 15, 0.3);
    z-index: 1;
}

.language-slider-background.arabic-active {
    transform: translateX(100%);
}

.language-slider-option {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--vz-body-color);
    text-align: center;
    padding: 0 8px;
}

.language-slider-option.active {
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: none;
}

.language-slider-option:not(.active) {
    color: var(--vz-gray-600);
}

.language-slider-option:hover:not(.active) {
    color: var(--vz-gray-700);
    background: rgba(242, 185, 15, 0.1);
}

.language-flag {
    width: 16px;
    height: 12px;
    margin-right: 4px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.language-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1;
    white-space: nowrap;
}

/* Arabic text styling */
.language-slider-option[data-lang="ar"] .language-text {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 12px;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .language-slider-container {
        background: #2a2e3a;
        border-color: #404656;
    }
    
    .language-slider-option:not(.active) {
        color: #9ca3af;
    }
    
    .language-slider-option:hover:not(.active) {
        color: #d1d5db;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-slider-container {
        min-width: 100px;
        height: 36px;
    }
    
    .language-slider-track {
        height: 28px;
    }
    
    .language-slider-option {
        font-size: 12px;
        padding: 0 6px;
    }
    
    .language-flag {
        width: 14px;
        height: 10px;
        margin-right: 3px;
    }
}

/* Animation states */
.language-slider-loading .language-slider-background {
    background: linear-gradient(135deg, #F2B90F, #ffc107, #F2B90F);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Accessibility */
.language-slider-container:focus-within {
    outline: 2px solid #F2B90F;
    outline-offset: 2px;
}

.language-slider-option:focus {
    outline: none;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .language-slider-container {
        border-width: 2px;
    }
    
    .language-slider-background {
        background: #F2B90F;
    }
    
    .language-slider-option.active {
        color: #000;
        font-weight: 700;
    }
}
