/* Hide Google Translate default UI */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-text-highlight,
.skiptranslate iframe,
iframe.skiptranslate {
    display: none !important;
    visibility: hidden !important;
}

body {
    top: 0 !important;
    position: static !important;
}

#google_translate_element,
.skiptranslate {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Custom language switcher */
.lang-switcher {
    position: relative;
    font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

.lang-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.85);
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dark .lang-switcher-trigger,
.lang-switcher-trigger.lang-switcher-trigger--dark {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.lang-switcher-trigger:hover,
.lang-switcher-trigger[aria-expanded="true"] {
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.lang-switcher-flag {
    font-size: 1rem;
    line-height: 1;
}

.lang-switcher-code {
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.85;
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(18rem, calc(100vw - 2rem));
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.2s ease;
    z-index: 100;
    max-height: 22rem;
    overflow-y: auto;
}

.dark .lang-switcher-menu,
.lang-switcher-menu.lang-switcher-menu--dark {
    background: rgba(18, 24, 38, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

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

.lang-switcher-menu-title {
    padding: 0.625rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.lang-switcher-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dark .lang-switcher-option,
.lang-switcher-option.lang-switcher-option--dark {
    color: #e2e8f0;
}

.lang-switcher-option:hover {
    background: rgba(99, 102, 241, 0.08);
}

.lang-switcher-option.is-active {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.dark .lang-switcher-option.is-active,
.lang-switcher-option.is-active.lang-switcher-option--dark {
    color: #a5b4fc;
}

.lang-switcher-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.lang-switcher-option-native {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.lang-switcher-option-en {
    font-size: 0.75rem;
    color: #64748b;
}

.lang-switcher-option-check {
    margin-left: auto;
    color: #6366f1;
    opacity: 0;
    font-size: 0.75rem;
}

.lang-switcher-option.is-active .lang-switcher-option-check {
    opacity: 1;
}

.lang-switcher--auth {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
}

@media (max-width: 640px) {
    .lang-switcher-trigger {
        padding: 0.5rem 0.625rem;
    }

    .lang-switcher-label {
        display: none;
    }
}
