/* Simple Multilingual - Frontend Styles */

/* Плавающий переключатель языков — Apple style */
.sml-floating-switcher {
    position: fixed;
    top: 90px;
    right: 16px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 22px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
    padding: 4px;
    animation: smlFadeIn 0.4s ease-out;
}

/* Переключатель флагами */
.sml-language-switcher.sml-flags {
    display: flex;
    gap: 2px;
    align-items: center;
}

.sml-lang-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: transparent;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sml-lang-flag:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sml-lang-flag:active {
    transform: scale(0.92);
}

.sml-lang-flag.active {
    background: rgba(0, 0, 0, 0.08);
}

.sml-flag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sml-lang-flag:not(.active) .sml-flag-icon {
    opacity: 0.55;
    filter: grayscale(30%);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.sml-lang-flag:hover .sml-flag-icon {
    opacity: 1;
    filter: none;
}

/* Переключатель выпадающим списком */
.sml-language-switcher.sml-dropdown {
    display: inline-block;
}

.sml-language-switcher.sml-dropdown select {
    padding: 7px 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    cursor: pointer;
    transition: border-color 0.2s ease;
    outline: none;
    color: #1d1d1f;
}

.sml-language-switcher.sml-dropdown select:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.sml-language-switcher.sml-dropdown select:focus {
    border-color: rgba(0, 122, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* Адаптивность */
@media (max-width: 768px) {
    .sml-floating-switcher {
        top: auto;
        bottom: 16px;
        right: 12px;
        padding: 3px;
        border-radius: 18px;
    }
    
    .sml-lang-flag {
        width: 28px;
        height: 28px;
        border-radius: 14px;
        font-size: 15px;
    }
}

/* Блок в редакторе и на фронте */
.sml-block-switcher {
    display: inline-block;
}
.sml-block-switcher .sml-language-switcher.sml-flags {
    position: static;
    background: none;
    box-shadow: none;
    padding: 0;
}

/* Анимация появления */
@keyframes smlFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .sml-floating-switcher {
        background: rgba(44, 44, 46, 0.72);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
    }
    
    .sml-lang-flag:hover {
        background: rgba(255, 255, 255, 0.08);
    }
    
    .sml-lang-flag.active {
        background: rgba(255, 255, 255, 0.12);
    }
    
    .sml-language-switcher.sml-dropdown select {
        background: rgba(44, 44, 46, 0.72);
        color: #f5f5f7;
        border-color: rgba(255, 255, 255, 0.12);
    }
}


/* ── Prevent mid-word breaks on mobile ─────────────────────────────────────── */
/* Browsers may break long words mid-syllable on narrow screens.               */
/* overflow-wrap: break-word only breaks when the WHOLE word doesn't fit.      */
/* word-break: normal prevents breaking inside words.                          */
/* hyphens: none disables automatic hyphenation that some browsers add.        */
body {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
}
h1,h2,h3,h4,h5,h6,p,li,td,th,a,span,div,blockquote,figcaption,nav,footer,header,section,article,main {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
}
