/**
 * Skillory Translator - Frontend Styles
 */

.skillory-translate-selector {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.skillory-translate-dropdown {
    position: relative;
    display: inline-block;
}

.skillory-translate-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 100%;
    box-sizing: border-box;
}

.skillory-translate-current:hover {
    border-color: #999;
}

.skillory-translate-current:focus {
    outline: none;
}

.skillory-translate-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.skillory-translate-dropdown.open .skillory-translate-arrow {
    transform: rotate(180deg);
}

.skillory-translate-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    min-width: 100%;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    box-sizing: border-box;
}

.skillory-translate-dropdown.open .skillory-translate-list {
    display: block;
}

.skillory-translate-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.skillory-translate-list li:hover,
.skillory-translate-list li.active {
    background: #f5f5f5;
}

.skillory-translate-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.skillory-translate-flag-btn {
    padding: 4px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.skillory-translate-flag-btn:hover {
    transform: scale(1.1);
}

.skillory-translate-inline-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.skillory-translate-vertical .skillory-translate-inline-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.skillory-translate-inline-list li {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.skillory-translate-lang-link {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 6px;
    text-decoration: none;
    font-size: 14px;
    color: inherit;
    transition: text-decoration 0.2s;
}

.skillory-translate-lang-link .skillory-translate-flag {
    flex-shrink: 0;
    vertical-align: middle;
}

.skillory-translate-lang-link .skillory-translate-lang-name {
    vertical-align: middle;
}

.skillory-translate-lang-link:hover {
    text-decoration: underline;
}

.skillory-translate-lang-link.active {
    text-decoration: underline;
}

.skillory-translate-preview {
    pointer-events: none;
    opacity: 0.9;
}

.skillory-translate-preview .skillory-translate-current:disabled {
    cursor: default;
    opacity: 1;
}

.skillory-translate-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background-color 0.2s, border-color 0.2s;
}

.skillory-translate-lang-btn:hover {
    background: #e5e5e5;
    border-color: #999;
}

.skillory-translate-lang-btn.active {
    color: #fff;
}

.skillory-translate-flag {
    display: inline-block;
    width: 24px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.skillory-translate-flag[data-lang="en"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30"><clipPath id="a"><path d="M0 0v30h60V0z"/></clipPath><clipPath id="b"><path d="M30 15h30v15zv15H0zH0V0zV0h30z"/></clipPath><g clip-path="url(%23a)"><path d="M0 0v30h60V0z" fill="%23012169"/><path d="M0 0l60 30m0-30L0 30" stroke="%23fff" stroke-width="6"/><path d="M0 0l60 30m0-30L0 30" clip-path="url(%23b)" stroke="%23C8102E" stroke-width="4"/><path d="M30 0v30M0 15h60" stroke="%23fff" stroke-width="10"/><path d="M30 0v30M0 15h60" stroke="%23C8102E" stroke-width="6"/></g></svg>'); }
.skillory-translate-flag[data-lang="es"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 500"><rect width="750" height="500" fill="%23c60b1e"/><rect width="750" height="250" y="125" fill="%23ffc400"/></svg>'); }
.skillory-translate-flag[data-lang="fr"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect width="900" height="600" fill="%23ED2939"/><rect width="600" height="600" fill="%23fff"/><rect width="300" height="600" fill="%23002395"/></svg>'); }
.skillory-translate-flag[data-lang="de"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5 3"><rect width="5" height="3" y="0" fill="%23000"/><rect width="5" height="2" y="1" fill="%23D00"/><rect width="5" height="1" y="2" fill="%23FFCE00"/></svg>'); }
.skillory-translate-flag[data-lang="it"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2"><rect width="1" height="2" fill="%23009246"/><rect width="1" height="2" x="1" fill="%23fff"/><rect width="1" height="2" x="2" fill="%23ce2b37"/></svg>'); }
.skillory-translate-flag[data-lang="pt"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 400"><rect width="600" height="400" fill="%23006600"/><rect width="360" height="400" x="240" fill="%23ff0000"/><circle cx="240" cy="200" r="80" fill="%23ffff00"/></svg>'); }
.skillory-translate-flag[data-lang="ru"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 6"><rect fill="%23fff" width="9" height="3"/><rect fill="%230039A6" y="3" width="9" height="3"/><rect fill="%23D52B1E" y="4" width="9" height="2"/></svg>'); }
.skillory-translate-flag[data-lang="zh-CN"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect width="30" height="20" fill="%23de2910"/><polygon fill="%23ffde00" points="5,4 6,7 9,7 6.5,9 7.5,12 5,10 2.5,12 3.5,9 1,7 4,7"/></svg>'); }
.skillory-translate-flag[data-lang="zh-TW"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect width="30" height="20" fill="%23fe0000"/><rect width="15" height="10" fill="%23000095"/><circle cx="7.5" cy="5" r="3" fill="%23fff"/></svg>'); }
.skillory-translate-flag[data-lang="ja"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%23fff" width="900" height="600"/><circle fill="%23bc002d" cx="450" cy="300" r="180"/></svg>'); }
.skillory-translate-flag[data-lang="ko"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%23fff" width="900" height="600"/><circle fill="%23c60c30" cx="450" cy="300" r="150"/></svg>'); }
.skillory-translate-flag[data-lang="ar"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6"><rect fill="%23007A3D" width="12" height="2"/><rect fill="%23fff" y="2" width="12" height="2"/><rect fill="%23000" y="4" width="12" height="2"/><polygon fill="%23CE1126" points="0,0 4,3 0,6"/></svg>'); }
.skillory-translate-flag[data-lang="hi"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%23f93" width="900" height="200"/><rect fill="%23fff" y="200" width="900" height="200"/><rect fill="%23128807" y="400" width="900" height="200"/><circle fill="%23008" cx="450" cy="300" r="60" fill="none" stroke="%23000080" stroke-width="4"/></svg>'); }
.skillory-translate-flag[data-lang="nl"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 6"><rect fill="%2321468B" width="9" height="6"/><rect fill="%23fff" width="9" height="4"/><rect fill="%23AE1C28" width="9" height="2"/></svg>'); }
.skillory-translate-flag[data-lang="pl"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 5"><rect width="8" height="5" fill="%23dc143c"/><rect width="8" height="2.5" fill="%23fff"/></svg>'); }
.skillory-translate-flag[data-lang="tr"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect width="30" height="20" fill="%23E30A17"/><circle cx="11" cy="10" r="6" fill="%23fff"/><circle cx="12.5" cy="10" r="4.8" fill="%23E30A17"/><polygon fill="%23fff" points="18,10 15,8 15,12"/></svg>'); }
.skillory-translate-flag[data-lang="vi"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 20"><rect width="30" height="20" fill="%23da251d"/><polygon fill="%23ff0" points="15,4 16.5,9 21.5,9 17.5,12 19,17 15,14 11,17 12.5,12 8.5,9 13.5,9"/></svg>'); }
.skillory-translate-flag[data-lang="th"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%23A51931" width="900" height="600"/><rect fill="%23F4F5F8" y="100" width="900" height="400"/><rect fill="%232D2A4A" y="200" width="900" height="200"/></svg>'); }
.skillory-translate-flag[data-lang="sv"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 10"><rect width="16" height="10" fill="%23006aa7"/><rect width="2" height="10" x="5" fill="%23fecc00"/><rect width="16" height="2" y="4" fill="%23fecc00"/></svg>'); }
.skillory-translate-flag[data-lang="da"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 28"><rect width="37" height="28" fill="%23c8102e"/><rect width="4" height="28" x="12" fill="%23fff"/><rect width="37" height="4" y="12" fill="%23fff"/></svg>'); }
.skillory-translate-flag[data-lang="no"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 16"><rect width="22" height="16" fill="%23ba0c2f"/><rect width="2" height="16" x="6" fill="%23fff"/><rect width="22" height="2" y="7" fill="%23fff"/><rect width="22" height="1" y="7.5" fill="%2300205b"/><rect width="1" height="16" x="6.5" fill="%2300205b"/></svg>'); }
.skillory-translate-flag[data-lang="fi"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 11"><rect width="18" height="11" fill="%23fff"/><rect width="3" height="11" x="5" fill="%23003580"/><rect width="18" height="3" y="4" fill="%23003580"/></svg>'); }
.skillory-translate-flag[data-lang="el"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 18"><rect fill="%230d5eaf" width="27" height="18"/><path fill="%23fff" d="M0,2h10v2H0zM0,6h27v2H0zM0,10h27v2H0zM0,14h27v2H0zM4,0h2v10H4zM0,2h10v2H0z"/></svg>'); }
.skillory-translate-flag[data-lang="cs"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect width="900" height="300" fill="%23fff"/><rect y="300" width="900" height="300" fill="%23d7141a"/><polygon points="0,0 450,300 0,600" fill="%2311457e"/></svg>'); }
.skillory-translate-flag[data-lang="hu"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 3"><rect fill="%23477050" width="6" height="3"/><rect fill="%23fff" width="6" height="2"/><rect fill="%23ce2939" width="6" height="1"/></svg>'); }
.skillory-translate-flag[data-lang="ro"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2"><rect width="1" height="2" fill="%23002B7F"/><rect width="1" height="2" x="1" fill="%23FCD116"/><rect width="1" height="2" x="2" fill="%23CE1126"/></svg>'); }
.skillory-translate-flag[data-lang="bg"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5 3"><rect fill="%2300966E" width="5" height="3"/><rect fill="%23fff" width="5" height="2"/><rect fill="%23D62612" width="5" height="1" y="2"/></svg>'); }
.skillory-translate-flag[data-lang="uk"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2"><rect width="3" height="1" fill="%230057b7"/><rect width="3" height="1" y="1" fill="%23ffd700"/></svg>'); }
.skillory-translate-flag[data-lang="hr"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 3"><rect fill="%23171796" width="6" height="3"/><rect fill="%23fff" width="6" height="2"/><rect fill="%23FF0000" width="6" height="1"/></svg>'); }
.skillory-translate-flag[data-lang="sk"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%23ee1c25" width="900" height="600"/><rect fill="%230b4ea2" width="900" height="400"/><rect fill="%23fff" width="900" height="200"/></svg>'); }
.skillory-translate-flag[data-lang="sl"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 3"><rect fill="%23005CE6" width="6" height="3"/><rect fill="%23fff" width="6" height="2"/><rect fill="%23ED1C24" width="6" height="1" y="2"/></svg>'); }
.skillory-translate-flag[data-lang="sr"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%230c4076" width="900" height="600"/><rect fill="%23fff" width="900" height="400"/><rect fill="%23c6363c" width="900" height="200"/></svg>'); }
.skillory-translate-flag[data-lang="id"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2"><rect fill="%23fff" width="3" height="2"/><rect fill="%23ce1126" width="3" height="1"/></svg>'); }
.skillory-translate-flag[data-lang="ms"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 1"><rect fill="%23cc0001" width="2" height="1"/><rect fill="%23fff" y=".5" width="2" height=".5"/></svg>'); }
.skillory-translate-flag[data-lang="tl"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 450"><rect fill="%230038a8" width="900" height="225"/><rect fill="%23ce1126" y="225" width="900" height="225"/><polygon fill="%23fff" points="0,0 450,225 0,450"/><polygon fill="%23fcd116" points="75,225 120,240 120,260 75,275 30,260 30,240"/></svg>'); }
.skillory-translate-flag[data-lang="he"],
.skillory-translate-flag[data-lang="iw"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 8"><rect fill="%23fff" width="11" height="8"/><rect fill="%230038b8" width="11" height="1.5"/><rect fill="%230038b8" y="6.5" width="11" height="1.5"/></svg>'); }
.skillory-translate-flag[data-lang="fa"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 360"><rect fill="%23239f40" width="630" height="120"/><rect fill="%23fff" y="120" width="630" height="120"/><rect fill="%23da0000" y="240" width="630" height="120"/></svg>'); }
.skillory-translate-flag[data-lang="af"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 4"><rect fill="%23007a4d" width="2" height="4"/><rect fill="%23ffb612" x="2" width="2" height="4"/><rect fill="%23de3831" x="4" width="2" height="4"/></svg>'); }
.skillory-translate-flag[data-lang="sw"] { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600"><rect fill="%231eb53a" width="900" height="600"/><rect fill="%2300a3dd" width="900" height="400"/><rect fill="%23000" y="150" width="900" height="200"/></svg>'); }

.skillory-translate-floating {
    position: fixed;
    z-index: 99998;
    padding: 10px;
}

.skillory-translate-bottom-right {
    bottom: 20px;
    right: 20px;
}

.skillory-translate-bottom-left {
    bottom: 20px;
    left: 20px;
}

.skillory-translate-top-right {
    top: 20px;
    right: 20px;
}

.skillory-translate-top-left {
    top: 20px;
    left: 20px;
}

.skillory-translate-floating .skillory-translate-dropdown {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.skillory-translate-floating .skillory-translate-current {
    border: none;
    border-radius: 8px;
}

.skillory-translate-floating .skillory-translate-list {
    bottom: 100%;
    top: auto;
    margin: 0 0 4px;
}

.skillory-translate-top-right .skillory-translate-list,
.skillory-translate-top-left .skillory-translate-list {
    bottom: auto;
    top: 100%;
    margin: 4px 0 0;
}

@media (max-width: 480px) {
    .skillory-translate-floating {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 0;
    }
    .skillory-translate-floating.skillory-translate-bottom-left,
    .skillory-translate-floating.skillory-translate-top-left {
        right: auto;
    }
    .skillory-translate-floating.skillory-translate-bottom-right,
    .skillory-translate-floating.skillory-translate-top-right {
        left: auto;
    }
}