/* RTL-specific styles for the switcher */
body.rtl .textuned-switcher-container.textuned-switcher-sticky {
    left: 20px;
    right: auto;
}

body.rtl .textuned-switcher-list {
    text-align: left;
}

body.popup_show{
    position: relative;
    height: 100%;
    width: 100%;
}
body.popup_show::before{
    content: "";
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: hidden auto;
    outline: 0px;
    z-index: 1;
}

/* Language Switcher Container */
.textuned-switcher-container {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    z-index: 999;
}

.textuned-switcher-container.textuned-switcher-sticky {
    position: fixed;
    top: 40px;
    right: 20px;
}

/* Astra theme support start */

.wp-theme-astra header nav {
    margin-right: 50px;
}

.rtl.wp-theme-astra header nav {
    margin-left: 50px;
    margin-right: 0;
}

.wp-theme-astra.admin-bar .textuned-switcher-container.textuned-switcher-sticky {
    top: 55px;
}

.wp-theme-astra .textuned-switcher-container.textuned-switcher-sticky {
    top: 25px;
}

/* Astra theme support end */

/* Switcher Toggle Button */
.textuned-switcher-toggle {
    background-color: #fff !important;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    min-width: 102px;
    align-items: center;
    gap: 8px;
    color: #000 !important;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.textuned-switcher-toggle:hover {
    background-color: #f0f0f0;
}

/* Dropdown List */
.textuned-switcher-list {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    list-style: none;
    margin: 5px 0 0;
    padding: 0 !important;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 100px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none; /* Hidden by default, shown by JS */
}

/* List Item Link */
.textuned-switcher-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.textuned-switcher-item:hover,
.textuned-switcher-item:focus {
    background-color: #f0f0f0;
}

/* Flag Image */
.textuned-switcher-flag img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}


/* Auto-detect Prompt Popup */
.textuned-auto-detect-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50% , -50%);
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-family: inherit;
    display: none;
    padding: 30px 50px;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 200px;
    flex-direction: column;
}

.textuned-auto-detect-prompt p {
    margin: 0 0 10px;
}

.textuned-auto-detect-prompt .popup-actions{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.textuned-auto-detect-prompt button {
    cursor: pointer;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
}

.textuned-auto-detect-prompt .textuned-accept-prompt {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.textuned-auto-detect-prompt .textuned-decline-prompt {
    background-color: #fff;
    color: #333;
}

@media (max-width:767px) {
    .textuned-auto-detect-prompt{
        width: 60%;
        margin: auto;
    }
}