/* Компонент переключателя языка в шапке */

.language-switcher {
    display: flex;
    align-items: center;
    gap:  8px;
}

.lang-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-btn {
    width: 36px ! important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 18px;
    backdrop-filter: blur(10px);
    flex-shrink: 0; /* Запрет сжатия кнопки */
    overflow: hidden; /* Обрезка выходящего за границы контента */
    padding: 0 ! important;
}

.lang-btn svg {
    width: 18px ! important;
    height: 12px !important;
    min-width: 18px !important;
    min-height: 12px !important;
    max-width: 18px !important;
    max-height: 12px !important;
    display: block;
    border-radius: 2px;
    object-fit: contain;
    object-position: center;
}

.lang-btn img {
    width: 18px !important;
    height:  12px !important;
    min-width: 18px !important;
    min-height: 12px !important;
    max-width: 18px !important;
    max-height: 12px !important;
    display: block;
    border-radius: 2px;
    object-fit: contain; /* Сохраняем пропорции */
    object-position: center; /* Центрируем изображение */
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-btn. active {
    background: white;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

. lang-btn. active: hover {
    transform: translateY(-2px);
}

/* Старый стиль для совместимости (если где-то используется) */
.lang-selector {
    display: flex;
    align-items: center;
    gap:  8px;
}

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

.lang-select {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    outline: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.lang-select:hover {
    background: #f0f0f0;
    color: #3498db;
}

. lang-select:focus {
    background: #e8f4f8;
}

.lang-select option {
    padding: 8px;
    background: white;
}

/* RTL поддержка */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Адаптация переключателя для RTL */
[dir="rtl"] .language-switcher {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-buttons {
    flex-direction: row-reverse;
}

/* Адаптация интерфейса для RTL */
[dir="rtl"] .header {
    flex-direction: row-reverse;
}

[dir="rtl"] . action-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] table {
    direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] .modal-header {
    flex-direction:  row-reverse;
}

[dir="rtl"] .form-group label {
    text-align: right;
}

[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
    text-align: right;
}

[dir="rtl"] .checkbox-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .tabs {
    flex-direction: row-reverse;
}

[dir="rtl"] . filters {
    direction: rtl;
}

/* Анимация смены языка */
. lang-transition {
    transition:  all 0.3s ease;
}

body.lang-switching {
    opacity: 0.95;
}

/* Стили для разных языков */
body.lang-he {
    font-family: 'Arial', 'Tahoma', sans-serif;
}

body.lang-en {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.lang-ru {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .lang-btn {
        width: 32px ! important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        font-size: 16px;
    }
    
    .lang-btn img,
    .lang-btn svg {
        width: 16px !important;
        height:  11px !important;
        min-width: 16px !important;
        min-height: 11px !important;
        max-width: 16px !important;
        max-height: 11px !important;
    }
    
    .lang-buttons {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .lang-btn {
        width: 28px !important;
        height:  28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        font-size: 14px;
    }
    
    .lang-btn img,
    .lang-btn svg {
        width: 14px !important;
        height:  10px !important;
        min-width: 14px ! important;
        min-height:  10px !important;
        max-width: 14px ! important;
        max-height:  10px !important;
    }
    
    .lang-buttons {
        gap: 4px;
    }
}
