/**
 * TranslatorJS - Стили переключателя языков
 * Адаптировано для Laravel + Tailwind CSS
 */

/* === Скрытие элементов Google Translate === */
.skiptranslate {
    display: none !important;
}

.goog-text-highlight,
font > font {
    background-color: transparent !important;
    box-shadow: none !important;
    box-sizing: inherit;
}

body {
    top: 0px !important;
    position: relative !important;
}

/* === Базовый контейнер переключателя (fixed) === */
.translatorjs_langs {
    display: flex !important;
    flex-direction: column;
    left: 0;
    line-height: 24px;
    max-width: 60px;
    padding: 8px 6px;
    position: fixed;
    text-align: center;
    text-transform: uppercase;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    z-index: 9999;
}

/* === Позиции fixed === */
.translatorjs_langs--middle-left {
    left: 0;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border-radius: 0 8px 8px 0;
}

.translatorjs_langs--middle-right {
    left: auto;
    right: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border-radius: 8px 0 0 8px;
}

.translatorjs_langs--top-left {
    left: 10px;
    right: auto;
    top: 10px;
    bottom: auto;
    transform: none;
    border-radius: 8px;
    flex-direction: row;
}

.translatorjs_langs--top-right {
    left: auto;
    right: 10px;
    top: 10px;
    bottom: auto;
    transform: none;
    border-radius: 8px;
    flex-direction: row;
}

.translatorjs_langs--bottom-left {
    left: 10px;
    right: auto;
    top: auto;
    bottom: 10px;
    transform: none;
    border-radius: 8px;
    flex-direction: row;
}

.translatorjs_langs--bottom-right {
    left: auto;
    right: 10px;
    top: auto;
    bottom: 10px;
    transform: none;
    border-radius: 8px;
    flex-direction: row;
}

/* === Inline режим (встраивание в шаблон) === */
.translatorjs_langs--inline {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    max-width: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    z-index: auto;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.translatorjs_langs--inline .translatorjs_lang_item {
    margin-bottom: 0;
    margin-right: 0;
}

/* === Элемент (флаг) === */
.translatorjs_lang_item {
    cursor: pointer;
    margin-bottom: 20px;
    max-width: 45px;
    min-width: 45px;
    width: 45px;
    height: auto;
    border-radius: 4px;
    opacity: 0.5;
    display: block;
    visibility: visible;
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.translatorjs_lang_item:last-of-type {
    margin-bottom: 0;
}

.translatorjs_lang_item:hover {
    opacity: 0.85;
    transform: scale(1.1);
}

.translatorjs_lang_item:active {
    opacity: 1;
    transform: scale(0.95);
}

.translatorjs_lang_active {
    opacity: 1 !important;
    box-shadow: 0 0 0 2px #22c55e;
}

/* === Текстовый элемент (если нет флага) === */
.translatorjs_lang_item--text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    height: 32px;
    width: 32px;
    border-radius: 4px;
}

/* === Информационное сообщение === */
.translatorjs_info {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 8px 8px 0 0;
    bottom: 0;
    color: #92400e;
    font-size: 12px;
    left: 50%;
    padding: 8px 16px;
    position: fixed;
    text-align: center;
    transform: translateX(-50%);
    z-index: 999998;
    max-width: 90%;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .translatorjs_langs {
        max-width: 45px;
        padding: 6px 4px;
    }

    .translatorjs_lang_item {
        max-width: 32px;
        min-width: 32px;
        width: 32px;
    }

    .translatorjs_lang_item--text {
        height: 28px;
        width: 28px;
        font-size: 9px;
    }
}

/* === Анимация появления === */
@keyframes translatorjs-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.translatorjs_langs--middle-left {
    animation: translatorjs-fadeIn 0.3s ease;
}

@keyframes translatorjs-fadeInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.translatorjs_langs--middle-right {
    animation: translatorjs-fadeInRight 0.3s ease;
}
