/**
 * Kraftinox Language Switcher - Frontend Styles
 * Uses CSS variables for dynamic colors: --kx-accent, --kx-text, --kx-bg
 */

/* Hide ALL Google Translate UI */
.goog-te-banner-frame,
.goog-te-menu-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-gadget,
.goog-te-spinner-pos,
.goog-te-ftab-frame,
#kx-google-translate,
.skiptranslate,
div.skiptranslate,
iframe.skiptranslate,
iframe[id*=":container"],
iframe.goog-te-menu-frame,
iframe.goog-te-banner-frame {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

body {
    top: 0 !important;
}

html.translated-ltr,
html.translated-rtl {
    margin-top: 0 !important;
}

body > .skiptranslate {
    display: none !important;
    height: 0 !important;
}

iframe[id^=":"] {
    display: none !important;
    visibility: hidden !important;
}

/* Language Switcher Container */
.kx-language-switcher {
    position: fixed;
    z-index: 9999;
    /* Smooth transition for header color changes */
    --kx-transition: all 0.3s ease;
}

/* Dropdown Container */
.kx-lang-dropdown {
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Main Button */
.kx-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--kx-bg, #fff);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--kx-text, #333);
    transition: all 0.3s ease;
}

.kx-lang-btn:hover {
    border-color: var(--kx-accent-hex, #366d71);
    box-shadow: 0 4px 16px rgba(54, 109, 113, 0.2);
}

/* Icon */
.kx-lang-icon {
    width: 18px;
    height: 18px;
    color: var(--kx-accent-hex, #366d71);
    flex-shrink: 0;
    transition: color 0.3s ease;
}

/* Flag */
.kx-lang-flag {
    font-size: 18px;
    line-height: 1;
}

/* Current Language Text */
.kx-lang-current {
    font-weight: 500;
}

/* Arrow */
.kx-lang-arrow {
    width: 18px;
    height: 18px;
    color: #999;
    transition: transform 0.2s ease;
    margin-left: -2px;
}

.kx-lang-btn[aria-expanded="true"] .kx-lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.kx-lang-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: var(--kx-bg, #fff);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    list-style: none;
    padding: 8px 0;
    margin-top: 0;
    min-width: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.kx-lang-menu.has-names {
    min-width: 160px;
}

.kx-lang-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.kx-lang-menu li {
    margin: 0;
}

.kx-lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--kx-text, #333);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.kx-lang-menu a:hover {
    background: rgba(0,0,0,0.05);
}

.kx-lang-menu li.active a {
    background: var(--kx-accent-hex, #366d71);
    color: #fff;
    font-weight: 500;
}

.kx-menu-flag {
    font-size: 18px;
}

/* Button Styles */
.kx-lang-dropdown[data-style="minimal"] .kx-lang-btn {
    padding: 8px 12px;
}

.kx-lang-dropdown[data-style="flag-only"] .kx-lang-btn {
    padding: 8px 10px;
}

.kx-lang-dropdown[data-style="pill"] .kx-lang-btn {
    border-radius: 50px;
    padding: 8px 14px;
}

.kx-lang-dropdown[data-style="pill"] .kx-lang-arrow {
    display: none;
}

/* No border style - keeps background color, only removes border and shadow */
.kx-lang-dropdown.no-border .kx-lang-btn {
    border: none;
    box-shadow: none;
}

.kx-lang-dropdown.no-border .kx-lang-btn:hover {
    border: none;
    box-shadow: none;
}

/* Inline style - text links */
.kx-lang-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

.kx-lang-inline a {
    color: var(--kx-text, #333);
    text-decoration: none;
    padding: 4px 2px;
    transition: color 0.3s ease;
}

.kx-lang-inline a:hover {
    color: var(--kx-accent-hex, #366d71);
}

.kx-lang-inline a.active {
    color: var(--kx-accent-hex, #366d71);
    font-weight: 600;
}

.kx-lang-separator {
    color: var(--kx-text-hex, #333);
    opacity: 0.5;
    font-weight: 300;
    transition: color 0.3s ease;
}

/* Inline (shortcode) placement */
.kx-language-inline {
    display: inline-block;
    position: static;
}

.kx-language-inline .kx-lang-menu {
    bottom: auto;
    top: 100%;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .kx-language-switcher:not(.kx-language-inline) {
        bottom: 15px !important;
        right: 15px !important;
        left: auto !important;
        top: auto !important;
    }

    .kx-lang-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .kx-lang-menu {
        bottom: 100%;
        top: auto;
        margin-bottom: 8px;
        margin-top: 0;
    }
}
