/* Hybrid Language Switcher Styles */

/* Load Font Awesome if not already loaded */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
.hls-language-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
}

.hls-dropdown {
    position: relative;
    display: inline-block;
}

.hls-dropdown-toggle {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: space-between;
}

.hls-dropdown-toggle:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.hls-dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.hls-flag {
    width: 20px;
    height: 20px;
    object-fit: cover;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: middle;
}

.hls-language-name {
    flex-grow: 1;
    text-align: left;
}

.hls-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: #666;
}

/* Icon positioning */
.hls-icon-position-right .hls-arrow {
    margin-left: 8px;
}

.hls-icon-position-left .hls-arrow {
    margin-right: 8px;
    order: -1;
}

/* Icon types */
.hls-icon-plus {
    font-size: 14px;
    font-weight: bold;
}

.hls-icon-globe {
    font-size: 16px;
}

.hls-icon-dots {
    font-size: 18px;
    line-height: 1;
}

.hls-icon-chevron {
    font-size: 14px;
}

.hls-icon-fa-angle-down i,
.hls-icon-fa-chevron-down i {
    font-size: 12px;
    color: #666;
}

/* FontAwesome icon specific styles */
.hls-icon-fa-angle-down .fas,
.hls-icon-fa-chevron-down .fas {
    transition: transform 0.3s ease;
}

.hls-dropdown.active .hls-icon-fa-angle-down .fas,
.hls-dropdown.active .hls-icon-fa-chevron-down .fas {
    transform: rotate(180deg);
}

.hls-dropdown.active .hls-arrow {
    transform: rotate(180deg);
}

.hls-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 300px;
    overflow-y: auto;
}

.hls-dropdown.active .hls-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hls-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.hls-dropdown-item:last-child {
    border-bottom: none;
}

.hls-dropdown-item:hover {
    background-color: #f8f9fa;
}

.hls-dropdown-item .hls-flag {
    margin-right: 10px;
}

.hls-dropdown-item .hls-language-name {
    flex-grow: 1;
}

/* Manual link styling - remove visual differences */
.hls-dropdown-item.hls-manual-link {
    /* No special styling - should look identical to WPML links */
}

/* Elementor widget specific styles */
.hls-elementor-widget {
    display: inline-block;
}

/* Hide elements based on settings */
.hls-hide-flag .hls-flag {
    display: none !important;
}

.hls-hide-name .hls-language-name {
    display: none !important;
}

.hls-hide-flag .hls-hide-name .hls-dropdown-toggle {
    min-width: auto;
    padding: 8px 12px 8px 8px;
}

/* WPML Style variations */
.hls-style-wpml_style .hls-dropdown-toggle {
    background: transparent;
    border: none;
    padding: 6px 10px;
    font-size: 13px;
}

.hls-style-wpml_style .hls-dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hls-style-wpml_style .hls-dropdown-menu {
    border: 1px solid #e1e1e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .hls-dropdown-toggle {
        min-width: 100px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .hls-flag {
        width: 18px;
        height: 18px;
        margin-right: 6px;
    }
    
    .hls-dropdown-menu {
        left: -50px;
        right: -50px;
    }
}

/* RTL Support */
.rtl .hls-flag {
    margin-right: 0;
    margin-left: 8px;
}

.rtl .hls-icon-position-right .hls-arrow {
    margin-left: 0;
    margin-right: 8px;
}

.rtl .hls-icon-position-left .hls-arrow {
    margin-right: 0;
    margin-left: 8px;
}

.rtl .hls-dropdown-menu {
    left: auto;
    right: 0;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .hls-dropdown-toggle {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .hls-dropdown-toggle:hover {
        background: #374151;
    }
    
    .hls-dropdown-menu {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .hls-dropdown-item {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    .hls-dropdown-item:hover {
        background: #374151;
    }
}