/* ============================================================
   WBW Translation — Language Switcher Styles v2.0.0
   ============================================================ */

/* Base item link */
.wbw-sw-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.wbw-sw-item:hover,
.wbw-sw-item:focus {
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    text-decoration: none;
}
.wbw-sw-item.wbw-sw-active {
    font-weight: 600;
}
.wbw-sw-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    line-height: 1;
    flex-shrink: 0;
    font-size: 18px;
}
.wbw-sw-flag svg {
    display: block;
    width: 22px;
    height: 22px;
}
.wbw-sw-label {
    font-size: 14px;
    letter-spacing: 0.2px;
}

/* ============================================================
   Dropdown style
   ============================================================ */
.wbw-sw-dropdown {
    position: relative;
    display: inline-block;
    font-family: inherit;
}
.wbw-sw-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 6px 10px 6px 6px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.wbw-sw-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.25);
}
.wbw-sw-trigger .wbw-sw-item {
    padding: 0;
    background: none;
}
.wbw-sw-trigger .wbw-sw-item:hover {
    background: none;
}
.wbw-sw-arrow {
    font-size: 10px;
    color: inherit;
    margin-left: 2px;
    opacity: 0.7;
    transition: transform 0.2s;
}
.wbw-sw-dropdown.open .wbw-sw-arrow {
    transform: rotate(180deg);
}

.wbw-sw-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #fff;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 100;
}
.wbw-sw-dropdown.open .wbw-sw-panel {
    display: block;
    animation: wbw-sw-fade-in 0.15s ease;
}
.wbw-sw-panel .wbw-sw-item {
    display: flex;
    color: #1d1d1f;
    padding: 8px 10px;
    border-radius: 6px;
}
.wbw-sw-panel .wbw-sw-item:hover {
    background: #f6f7f7;
}

@keyframes wbw-sw-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Inline style
   ============================================================ */
.wbw-sw-inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    font-family: inherit;
}
.wbw-sw-inline .wbw-sw-item {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
}
.wbw-sw-inline .wbw-sw-item.wbw-sw-active {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.04);
}

/* ============================================================
   Popup style (trigger + overlay bar)
   ============================================================ */
.wbw-sw-popup-wrap {
    display: inline-flex;
    align-items: center;
}
.wbw-sw-popup-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.wbw-sw-popup-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
}

.wbw-sw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, 0.55);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.wbw-sw-overlay.open {
    display: flex;
    animation: wbw-sw-fade-in 0.15s ease;
}
.wbw-sw-bar {
    background: #fff;
    color: #1d1d1f;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
}
.wbw-sw-bar .wbw-sw-item {
    color: #1d1d1f;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.wbw-sw-bar .wbw-sw-item:hover {
    background: #f6f7f7;
}
.wbw-sw-bar .wbw-sw-item.wbw-sw-active {
    background: #f0f0f1;
    border-color: rgba(0, 0, 0, 0.1);
}
.wbw-sw-bar-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #50575e;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-left: 4px;
    transition: background 0.15s;
}
.wbw-sw-bar-close:hover {
    background: #f0f0f1;
    color: #1d1d1f;
}

/* ============================================================
   Floating switcher (fixed corner)
   ============================================================ */
.wbw-sw-floating {
    position: fixed;
    z-index: 9999;
}
.wbw-sw-floating-bottom-right { bottom: 20px; right: 20px; }
.wbw-sw-floating-bottom-left  { bottom: 20px; left: 20px; }
.wbw-sw-floating-top-right    { top: 20px;    right: 20px; }
.wbw-sw-floating-top-left     { top: 20px;    left: 20px; }

.wbw-sw-globe-trigger {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #1e1e2e;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}
.wbw-sw-globe-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.wbw-sw-float-inner {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
    padding: 4px 4px 4px 8px;
}
.wbw-sw-float-inner .wbw-sw-trigger {
    border: none;
    padding: 6px 10px;
    color: #1d1d1f;
}
.wbw-sw-float-inner .wbw-sw-trigger:hover {
    background: #f6f7f7;
}
.wbw-sw-floating-bottom-right .wbw-sw-panel,
.wbw-sw-floating-top-right    .wbw-sw-panel { right: 0; }
.wbw-sw-floating-bottom-left  .wbw-sw-panel,
.wbw-sw-floating-top-left     .wbw-sw-panel { left: 0; right: auto; }
.wbw-sw-floating-bottom-right .wbw-sw-panel,
.wbw-sw-floating-bottom-left  .wbw-sw-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

/* ============================================================
   Menu integration helpers
   ============================================================ */
.wbw-menu-switcher {
    display: flex !important;
    align-items: center;
    align-self: center;
}
.wbw-menu-switcher .wbw-sw-dropdown,
.wbw-menu-switcher .wbw-sw-popup-wrap,
.wbw-menu-switcher .wbw-sw-inline {
    font-family: inherit;
    font-size: inherit;
}

/* Dark-mode hint: if theme uses a dark header, switcher panel content stays light */
@media (prefers-color-scheme: dark) {
    .wbw-sw-panel,
    .wbw-sw-bar,
    .wbw-sw-float-inner {
        background: #1d1d1f;
        color: #f5f5f7;
        border-color: rgba(255, 255, 255, 0.15);
    }
    .wbw-sw-panel .wbw-sw-item,
    .wbw-sw-bar .wbw-sw-item {
        color: #f5f5f7;
    }
    .wbw-sw-panel .wbw-sw-item:hover,
    .wbw-sw-bar .wbw-sw-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}
