/* =============================================
   Language Switcher Styles v2
   Native translations for PL/EN/DE/RU/UK
   Google Translate only for "Other" languages
   ============================================= */

/* === Hide Google Translate UI artifacts === */
.goog-te-banner-frame,
body > .skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-menu-frame,
.goog-te-gadget,
#google_translate_element {
    display: none !important;
}
body { top: 0 !important; }
.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}
.goog-tooltip,
.goog-tooltip:hover,
#goog-gt-tt,
.jfk-tooltip {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* === Switcher UI === */
.lang-switcher {
    position: relative;
    z-index: 1002;
    margin-left: 0.5rem;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 6px 12px;
    cursor: pointer;
    color: #fff;
    font-size: 1.15rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s;
}
.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}
.lang-btn svg { opacity: 0.7; }

.navbar.scrolled .lang-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a2e;
}
.navbar.scrolled .lang-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Dropdown */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    padding: 6px;
    min-width: 175px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}
.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.15s;
    text-align: left;
}
.lang-option:hover { background: #f0f4ff; }
.lang-option.active {
    background: #e8f0fe;
    font-weight: 600;
    color: #1a73e8;
}
.lang-flag { font-size: 1.25rem; line-height: 1; }
.lang-label { font-family: 'Inter', sans-serif; }
.lang-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 8px;
}

/* "Other" modal */
#gt-other-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gt-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}
.gt-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.gt-modal-content h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}
/* Show GT widget ONLY inside the modal */
#gt-other-modal #gt-other-element,
#gt-other-modal .goog-te-gadget {
    display: block !important;
}

/* Mobile */
@media (max-width: 768px) {
    .lang-switcher {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: auto;
        margin: 0;
    }
    .lang-dropdown {
        left: 0;
        right: auto;
    }
    .lang-btn {
        background: rgba(26, 26, 46, 0.85);
        border-color: rgba(255,255,255,0.2);
        color: #fff;
        box-shadow: 0 4px 16px rgba(0,0,0,0.2);
        padding: 8px 14px;
        font-size: 1.3rem;
    }
    .lang-btn:hover {
        background: rgba(26, 26, 46, 0.95);
    }
    .navbar.scrolled .lang-btn {
        background: rgba(26, 26, 46, 0.85);
        color: #fff;
        border-color: rgba(255,255,255,0.2);
    }
    .lang-dropdown {
        bottom: calc(100% + 8px);
        top: auto;
        right: 0;
        transform: translateY(8px);
    }
    .lang-dropdown.open {
        transform: translateY(0);
    }
}
