/**
 * Versatile Language Switcher Widget Styles
 *
 * @package Versatile_Haus
 * @subpackage Elementor
 */

.vh-lang-switcher {
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    vertical-align: middle;
}

/* Vertical middle by default (overridable from the Elementor controls) */
.elementor-widget-vh-language-switcher {
    align-self: center;
}

.vh-lang-switcher *,
.vh-lang-switcher *::before,
.vh-lang-switcher *::after {
    box-sizing: border-box;
}

/* =========================================================
   LIST / INLINE LAYOUT
   ========================================================= */
.vh-lang-list {
    display: flex;
    width: 100%;
}

.vh-lang-list.layout-horizontal {
    flex-direction: row;
}

.vh-lang-list.layout-vertical {
    flex-direction: column;
}

.vh-lang-list-inner {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.vh-lang-list.layout-vertical .vh-lang-list-inner {
    flex-direction: column;
    align-items: flex-start;
}

.vh-lang-item {
    display: inline-flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.vh-lang-item > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
}

.vh-lang-item > a:hover {
    text-decoration: none;
}

/* Divider between list items */
.vh-lang-divider {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    user-select: none;
    font-size: 13px;
    line-height: 1;
}

/* =========================================================
   FLAGS
   ========================================================= */
.vh-lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    flex-shrink: 0;
    vertical-align: middle;
    width: 20px;
    height: 14px;
    aspect-ratio: 3 / 2;
}

.vh-lang-flag .pll-translation-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.vh-lang-flag img,
.vh-lang-flag svg,
.vh-lang-flag .pll-translation-flag img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    vertical-align: middle !important;
    border-radius: inherit !important;
    object-fit: cover !important;
}

.vh-lang-name {
    display: inline-block;
    line-height: 1;
    font-weight: 500;
}

/* =========================================================
   CUSTOM DROPDOWN LAYOUT
   ========================================================= */
.vh-lang-dropdown {
    position: relative;
    display: inline-block;
}

.vh-lang-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    line-height: 1.2;
    transition: all 0.2s ease;
    user-select: none;
    font-family: inherit;
}

.vh-lang-dropdown-toggle:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.vh-lang-dropdown.is-open .vh-lang-dropdown-toggle {
    border-color: #0c71e0;
    box-shadow: 0 0 0 2px rgba(12, 113, 224, 0.15);
}

.vh-lang-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: transform 0.25s ease;
    color: #64748b;
    margin-left: 2px;
}

.vh-lang-arrow svg {
    display: block;
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
}

.vh-lang-dropdown.is-open .vh-lang-arrow,
.vh-lang-dropdown.is-open .vh-lang-arrow svg {
    transform: rotate(180deg);
}

/* Dropdown Menu Box */
.vh-lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    padding: 6px;
    min-width: 140px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* Alignment modifiers */
.vh-lang-dropdown.align-left .vh-lang-dropdown-menu {
    left: 0;
    right: auto;
}

.vh-lang-dropdown.align-right .vh-lang-dropdown-menu {
    right: 0;
    left: auto;
}

.vh-lang-dropdown.align-center .vh-lang-dropdown-menu {
    left: 50%;
    right: auto;
    transform: translate(-50%, -6px);
}

.vh-lang-dropdown.is-open .vh-lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.vh-lang-dropdown.align-center.is-open .vh-lang-dropdown-menu {
    transform: translate(-50%, 0);
}

/* Hover-open support on desktop */
@media (hover: hover) and (pointer: fine) {
    .vh-lang-dropdown[data-event="hover"]:hover .vh-lang-dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .vh-lang-dropdown.align-center[data-event="hover"]:hover .vh-lang-dropdown-menu {
        transform: translate(-50%, 0);
    }

    .vh-lang-dropdown[data-event="hover"]:hover .vh-lang-arrow,
    .vh-lang-dropdown[data-event="hover"]:hover .vh-lang-arrow svg {
        transform: rotate(180deg);
    }
}

.vh-lang-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vh-lang-dropdown-list .vh-lang-item {
    width: 100%;
}

.vh-lang-dropdown-list .vh-lang-item > a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    gap: 8px;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.vh-lang-dropdown-list .vh-lang-item > a:hover {
    background: #f1f5f9;
    color: #0c71e0;
}

.vh-lang-dropdown-list .vh-lang-item.is-active > a {
    background: #eff6ff;
    color: #0c71e0;
    font-weight: 600;
}

.vh-lang-check-icon {
    margin-left: auto;
    font-size: 13px;
    color: #0c71e0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* =========================================================
   NATIVE SELECT LAYOUT
   ========================================================= */
.vh-lang-select {
    display: inline-block;
    position: relative;
}

.vh-lang-select select {
    display: block;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 30px 6px 12px;
    font-size: 13.5px;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vh-lang-select select:hover {
    border-color: #94a3b8;
}

.vh-lang-select select:focus {
    border-color: #0c71e0;
    box-shadow: 0 0 0 2px rgba(12, 113, 224, 0.15);
}

.vh-lang-select-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
    font-size: 12px;
    display: flex;
    align-items: center;
}

/* =========================================================
   EDITOR PREVIEW BADGE
   ========================================================= */
.vh-lang-preview-notice {
    display: inline-block;
    margin-top: 4px;
    font-size: 10.5px;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    letter-spacing: 0.2px;
}

/* =========================================================
   MODERN DESIGN PRESETS
   ========================================================= */

/* 1. Pill (no outer background; only the active item gets a pill) */
.vh-preset-pill .vh-lang-list-inner {
    background: none;
    border: 0;
    padding: 0;
    gap: 4px;
    box-shadow: none;
}

.vh-preset-pill .vh-lang-item > a {
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    opacity: 0.8;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.vh-preset-pill .vh-lang-item > a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.vh-preset-pill .vh-lang-item.is-active > a {
    background: #ffffff;
    color: #0f172a !important;
    opacity: 1;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15), 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* 2. Modern Frosted Glass (no outer background; only the active item is frosted) */
.vh-preset-glass .vh-lang-list-inner {
    background: none;
    border: 0;
    padding: 0;
    gap: 4px;
    box-shadow: none;
}

.vh-preset-glass .vh-lang-item > a {
    padding: 6px 13px;
    border-radius: 9999px;
    color: inherit;
    opacity: 0.85;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.vh-preset-glass .vh-lang-item > a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.vh-preset-glass .vh-lang-item.is-active > a {
    opacity: 1;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* 3. Floating Modern Cards */
.vh-preset-card .vh-lang-list-inner {
    gap: 8px;
}

.vh-preset-card .vh-lang-item > a {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vh-preset-card .vh-lang-item > a:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.vh-preset-card .vh-lang-item.is-active > a {
    border-color: #0c71e0;
    background: #ffffff;
    color: #0c71e0 !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(12, 113, 224, 0.18);
}

/* 4. Minimal Outline / Ghost */
.vh-preset-outline .vh-lang-item > a {
    border: 1.5px solid currentColor;
    opacity: 0.75;
    border-radius: 9999px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    transition: all 0.2s ease;
}

.vh-preset-outline .vh-lang-item > a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.vh-preset-outline .vh-lang-item.is-active > a {
    opacity: 1;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* =========================================================
   FLAG SHAPES & EFFECTS
   ========================================================= */

/* Shape: Circle (1:1 Round Avatar) */
html body .elementor-element.elementor-widget .vh-flag-shape-circle .vh-lang-flag,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-circle .vh-lang-flag,
.vh-lang-switcher.vh-flag-shape-circle .vh-lang-flag,
.vh-flag-shape-circle .vh-lang-flag {
    width: 20px !important;
    height: 20px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-shadow: none;
}

html body .elementor-element.elementor-widget .vh-flag-shape-circle .vh-lang-flag img,
html body .elementor-element.elementor-widget .vh-flag-shape-circle .vh-lang-flag svg,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-circle .vh-lang-flag img,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-circle .vh-lang-flag svg,
.vh-lang-switcher.vh-flag-shape-circle .vh-lang-flag img,
.vh-lang-switcher.vh-flag-shape-circle .vh-lang-flag svg,
.vh-flag-shape-circle .vh-lang-flag img,
.vh-flag-shape-circle .vh-lang-flag svg {
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* Shape: Square (1:1 Squircle) */
html body .elementor-element.elementor-widget .vh-flag-shape-square .vh-lang-flag,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-square .vh-lang-flag,
.vh-lang-switcher.vh-flag-shape-square .vh-lang-flag,
.vh-flag-shape-square .vh-lang-flag {
    width: 20px !important;
    height: 20px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: none;
}

html body .elementor-element.elementor-widget .vh-flag-shape-square .vh-lang-flag img,
html body .elementor-element.elementor-widget .vh-flag-shape-square .vh-lang-flag svg,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-square .vh-lang-flag img,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-square .vh-lang-flag svg,
.vh-lang-switcher.vh-flag-shape-square .vh-lang-flag img,
.vh-lang-switcher.vh-flag-shape-square .vh-lang-flag svg,
.vh-flag-shape-square .vh-lang-flag img,
.vh-flag-shape-square .vh-lang-flag svg {
    border-radius: 6px !important;
    object-fit: cover !important;
}

/* Shape: Rounded Rectangle (3:2) */
html body .elementor-element.elementor-widget .vh-flag-shape-rounded .vh-lang-flag,
html body .elementor-element .vh-lang-switcher.vh-flag-shape-rounded .vh-lang-flag,
.vh-lang-switcher.vh-flag-shape-rounded .vh-lang-flag,
.vh-flag-shape-rounded .vh-lang-flag {
    width: 20px !important;
    height: 14px !important;
    aspect-ratio: 3 / 2 !important;
    border-radius: 3px !important;
    overflow: hidden !important;
}

/* Effect: Floating Shadow */
.vh-flag-effect-shadow .vh-lang-flag {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22) !important;
}

/* Effect: Grayscale Inactive */
.vh-flag-effect-grayscale .vh-lang-item:not(.is-active) .vh-lang-flag {
    filter: grayscale(85%) opacity(0.7);
    transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.vh-flag-effect-grayscale .vh-lang-item:hover .vh-lang-flag {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.08);
}

.vh-flag-effect-grayscale .vh-lang-item.is-active .vh-lang-flag {
    filter: grayscale(0%) opacity(1);
}

/* Micro-interaction: Active Press */
.vh-lang-item > a:active {
    transform: scale(0.97);
}

/* =========================================================
   ACTIVE INDICATOR DOT
   ========================================================= */
.vh-lang-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    margin-left: 4px;
    vertical-align: middle;
    animation: vh-lang-pulse 2s infinite ease-in-out;
}

@keyframes vh-lang-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.65;
    }
}
