/* =========================================================================
   WTAI Language Switcher — Frontend Styles
   ========================================================================= */

/* Floating container */
.wtai-ls-floating {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.wtai-ls-bottom-right { bottom: 20px; right: 20px; }
.wtai-ls-bottom-left  { bottom: 20px; left: 20px; }
.wtai-ls-top-right    { top: 20px; right: 20px; }
.wtai-ls-top-left     { top: 20px; left: 20px; }

/* Inline (shortcode) variant */
.wtai-ls-inline {
    display: inline-block;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

/* Toggle button */
.wtai-ls-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    color: #1d2327;
    border: 1px solid #dcdcde;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wtai-ls-toggle:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: #2271b1;
}

.wtai-ls-toggle:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.wtai-ls-flag {
    font-size: 18px;
    line-height: 1;
}

.wtai-ls-name {
    font-weight: 500;
}

.wtai-ls-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.wtai-ls-floating.open .wtai-ls-arrow,
.wtai-ls-inline.open .wtai-ls-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.wtai-ls-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 1000000;
    padding: 6px;
}

/* Position adjustments */
.wtai-ls-top-right .wtai-ls-dropdown,
.wtai-ls-top-left .wtai-ls-dropdown {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translateY(-8px);
}

.wtai-ls-bottom-left .wtai-ls-dropdown,
.wtai-ls-top-left .wtai-ls-dropdown {
    right: auto;
    left: 0;
}

.wtai-ls-floating.open .wtai-ls-dropdown,
.wtai-ls-inline.open .wtai-ls-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wtai-ls-top-right.open .wtai-ls-dropdown,
.wtai-ls-top-left.open .wtai-ls-dropdown {
    transform: translateY(0);
}

/* Dropdown items */
.wtai-ls-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #1d2327;
    border-radius: 8px;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.wtai-ls-item:hover {
    background: #f0f0f1;
    color: #1d2327;
    text-decoration: none;
}

.wtai-ls-item.wtai-ls-active {
    background: #f0f6fc;
    color: #2271b1;
    font-weight: 600;
}

.wtai-ls-check {
    margin-left: auto;
    color: #2271b1;
}

/* Scrollbar styling */
.wtai-ls-dropdown::-webkit-scrollbar {
    width: 4px;
}

.wtai-ls-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.wtai-ls-dropdown::-webkit-scrollbar-thumb {
    background: #c3c4c7;
    border-radius: 4px;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .wtai-ls-floating {
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        top: auto !important;
    }

    .wtai-ls-dropdown {
        min-width: 180px;
        right: 0;
        left: auto;
    }

    .wtai-ls-name {
        display: none;
    }

    .wtai-ls-toggle {
        padding: 10px 12px;
    }
}
