/* NFDS Language Switcher */

.nfds-lang-switcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    font-family: "Poppins", "Segoe UI", sans-serif;
}

.nfds-lang-switcher--widget {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: auto;
}

.nfds-lang-switcher__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--nfds-switcher-radius, 999px) !important;
    border: 1px solid var(--nfds-switcher-border, #e2e8f0);
    background: var(--nfds-switcher-bg, #111827);
    color: var(--nfds-switcher-text, #f9fafb);
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.nfds-lang-switcher__toggle:focus {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.nfds-lang-switcher__flag {
    font-size: 18px;
}

.nfds-lang-switcher__label {
    font-weight: 600;
}

.nfds-lang-switcher__chevron {
    font-size: 12px;
    opacity: 0.7;
}

.nfds-lang-switcher__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 200px;
    padding: 8px;
    border-radius: var(--nfds-switcher-panel-radius, 16px) !important;
    border: 1px solid var(--nfds-switcher-border, #1f2937);
    background: var(--nfds-switcher-panel-bg, #0f172a);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nfds-lang-switcher.is-open .nfds-lang-switcher__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nfds-lang-switcher__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow: hidden;
}

.nfds-lang-switcher__list.is-scroll {
    overflow-y: auto;
    padding-right: 4px;
}

.nfds-lang-switcher__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--nfds-switcher-item-radius, 10px) !important;
    color: var(--nfds-switcher-text, #e2e8f0);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nfds-lang-switcher__item:hover,
.nfds-lang-switcher__item:focus {
    background: var(--nfds-switcher-hover-bg, #1f2937);
    color: var(--nfds-switcher-hover-text, #ffffff);
}

.nfds-lang-switcher__item.is-active {
    background: var(--nfds-switcher-active-bg, #38bdf8);
    color: var(--nfds-switcher-active-text, #0b1120);
    font-weight: 600;
}

@media (max-width: 768px) {
    .nfds-lang-switcher {
        right: 12px;
        bottom: 12px;
    }

    .nfds-lang-switcher__toggle {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Cascade guard for theme overrides */
body .nfds-lang-switcher,
body .nfds-lang-switcher * {
    box-sizing: border-box !important;
}

body .nfds-lang-switcher {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 9999 !important;
}

body .nfds-lang-switcher__toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    border-radius: var(--nfds-switcher-radius, 999px) !important;
    background: var(--nfds-switcher-bg, #0f172a) !important;
    color: var(--nfds-switcher-text, #ffffff) !important;
    border: 1px solid var(--nfds-switcher-border, #1f2937) !important;
}

body .nfds-lang-switcher__panel {
    position: absolute !important;
    right: 0 !important;
    bottom: calc(100% + 10px) !important;
    min-width: 200px !important;
    padding: 8px !important;
    border-radius: var(--nfds-switcher-panel-radius, 16px) !important;
    border: 1px solid var(--nfds-switcher-border, #1f2937) !important;
    background: var(--nfds-switcher-panel-bg, #0f172a) !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35) !important;
}

body .nfds-lang-switcher__item {
    color: var(--nfds-switcher-text, #e2e8f0) !important;
    border-radius: var(--nfds-switcher-item-radius, 10px) !important;
    text-decoration: none !important;
}

body .nfds-lang-switcher__item:hover,
body .nfds-lang-switcher__item:focus {
    background: var(--nfds-switcher-hover-bg, #1f2937) !important;
    color: var(--nfds-switcher-hover-text, #ffffff) !important;
}
