/* --- Global Styles for ALL Language Selectors --- */

.uta-selector {
    position: relative;
    /* Ensure the list is hidden by default */
    display: inline-block;
    vertical-align: middle;
    list-style: none;
}

.uta-selector a {
    text-decoration: none;
    color: inherit;
}

.uta-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
}

/* Flag Icon Styling */
.uta-current-flag, .uta-flag {
    font-size: 1.2em;
    margin-right: 8px;
    line-height: 1; /* Fixes vertical alignment issues with emojis */
}

.uta-arrow {
    margin-left: 5px;
    font-size: 0.75em;
    transition: transform 0.2s;
}

.uta-selector.open .uta-arrow {
    transform: rotate(180deg);
}

/* Options List Container */
.uta-options-list {
    display: none;
    position: absolute;
    z-index: 99999; /* Higher than most things */
    min-width: 220px;
    padding: 8px 0;
    margin: 0;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    list-style: none;
    /* Align to the right edge by default */
    right: 0; 
    left: auto;
    top: 100%;

    /* --- EDITS START HERE: ADD SCROLLING --- */
    max-height: 300px; /* Set a maximum height for the scrollable area */
    overflow-y: auto; /* Enable vertical scrolling */
    /* --- EDITS END HERE --- */
}

.uta-selector.open .uta-options-list {
    display: block;
}

.uta-lang-option a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: #333;
    font-weight: 400;
}

.uta-lang-option a:hover {
    background-color: #f0f8ff;
    color: #0073aa;
}


/* --- 1. NAVBAR Specific Styles --- */

.navbar-uta-selector .uta-toggle {
    border: 1px solid #ccc;
    background-color: transparent;
    color: #333; /* Standard link color */
}

.navbar-uta-selector .uta-toggle:hover {
    background-color: #f1f1f1;
}

/* The parent LI added by WordPress */
.uta-menu-item {
    padding: 0;
    margin-left: 10px;
    list-style: none;
    display: inline-block; /* Ensure it flows horizontally with other menu items */
}


/* --- 2. FLOATING BUTTON Specific Styles (Bottom Right) --- */

#uta-floating-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

.floating-uta-selector .uta-toggle {
    /* Use short name only, hide arrow */
    justify-content: center; 
    border: none;
    background-color: #1abc9c; /* Teal/Green color */
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    min-width: 80px;
}

.floating-uta-selector .uta-toggle:hover {
    background-color: #16a085;
}

.floating-uta-selector .uta-arrow {
    display: none;
}

.floating-uta-selector .uta-options-list {
    bottom: 100%; /* Opens UPWARDS from the button */
    top: auto;
    margin-bottom: 5px;
    right: 0;
    left: auto;
}

/* Hide the full language name in the floating selector */
.floating-uta-selector .uta-lang-option a .uta-flag + span {
    display: none; /* Hide full name for better mobile look */
}


/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    /* Adjust Floating Widget position for mobile screens */
    #uta-floating-widget-container {
        bottom: 15px;
        right: 15px;
    }

    /* Adjust navbar menu display */
    .uta-menu-item {
        display: block; /* Stack on mobile menu */
        border-top: 1px solid #eee;
        margin-left: 0;
    }
    
    .navbar-uta-selector .uta-toggle {
        border: none;
        border-radius: 0;
        padding-left: 0; /* Align with standard mobile menu links */
    }

    .navbar-uta-selector .uta-options-list {
        position: relative;
        box-shadow: none;
        border: none;
        min-width: 100%;
        border-radius: 0;
    }
}


/* translator.css - minimal styling for selector */
.uta-selector { position: relative; display:inline-block; margin:0 8px; }
.uta-selector .uta-toggle { cursor:pointer; display:flex; align-items:center; gap:6px; text-decoration:none; color:inherit; }
.uta-selector .uta-options-list { display:none; position:absolute; z-index:9999; list-style:none; margin:6px 0 0 0; padding:6px 0; background:#fff; border:1px solid #ddd; border-radius:6px; box-shadow:0 6px 18px rgba(0,0,0,0.08); min-width:160px; }
.uta-selector.open .uta-options-list { display:block; }
.uta-options-list li { padding:0; }
.uta-options-list li a { display:block; padding:8px 12px; text-decoration:none; color:#222; }
.uta-options-list li a:hover { background:#f5f5f5; }
#uta-floating-widget-container { position:fixed; right:18px; bottom:18px; z-index:9998; }
.floating-uta-selector .uta-toggle { background:#fff; padding:8px 10px; border-radius:8px; border:1px solid rgba(0,0,0,0.06); box-shadow:0 6px 18px rgba(0,0,0,0.06); }
