/**
 * Company: EMPIRE Solutions
 * Website: www.empiresolutions.ro
 * Author: Ilisia Raul Codruț
 * 
 * Language switcher styles
 * Namespaced to prevent conflicts with other plugins
 */

/* Base switcher container */
.emp-lang-switcher {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Fixed position container for full-page translations */
.emp-lang-switcher-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 12px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease !important;
}

.emp-lang-switcher-container:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-2px) !important;
}

/* Flags style */
.emp-lang-flags {
    display: flex;
    gap: 8px;
    align-items: center;
}

.emp-lang-flags .emp-lang-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.emp-lang-flags .emp-lang-link:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.emp-lang-flags .emp-lang-link.emp-lang-active {
    border-color: #0073aa;
    background: #e7f3ff;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.emp-lang-flag {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}

.emp-lang-name {
    font-weight: 500;
    font-size: 13px;
}

/* List style */
.emp-lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.emp-lang-list .emp-lang-item {
    margin: 0;
}

.emp-lang-list .emp-lang-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: all 0.2s ease;
}

.emp-lang-list .emp-lang-link:hover {
    background: #f8f9fa;
    border-color: #0073aa;
}

.emp-lang-list .emp-lang-item.emp-lang-active .emp-lang-link {
    background: #e7f3ff;
    border-color: #0073aa;
    color: #0073aa;
    font-weight: 600;
}

/* Dropdown style */
.emp-lang-dropdown {
    position: relative;
    display: inline-block;
}

.emp-lang-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 120px;
}

.emp-lang-dropdown-toggle:hover {
    background: #f8f9fa;
    border-color: #0073aa;
}

.emp-lang-dropdown-toggle:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.emp-lang-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.emp-lang-dropdown.open .emp-lang-arrow {
    transform: rotate(180deg);
}

.emp-lang-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.emp-lang-dropdown.open .emp-lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.emp-lang-dropdown-menu .emp-lang-item {
    margin: 0;
}

.emp-lang-dropdown-menu .emp-lang-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.emp-lang-dropdown-menu .emp-lang-link:hover {
    background: #f8f9fa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .emp-lang-flags {
        gap: 4px;
    }
    
    .emp-lang-flags .emp-lang-link {
        padding: 4px 6px;
    }
    
    .emp-lang-flag {
        font-size: 16px;
    }
    
    .emp-lang-name {
        font-size: 12px;
    }
}

/* Hide names on small screens unless explicitly shown */
.emp-lang-switcher:not(.emp-lang-with-names) .emp-lang-name {
    display: none;
}

@media (min-width: 769px) {
    .emp-lang-switcher.emp-lang-with-names .emp-lang-name {
        display: inline;
    }
}

/* Ensure switcher is not affected by translation plugins */
.emp-lang-switcher,
.emp-lang-switcher * {
    translate: no !important;
}

.emp-lang-switcher[data-no-translate] {
    -webkit-translate: no !important;
    translate: no !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .emp-lang-flags .emp-lang-link {
        border-width: 2px;
    }
    
    .emp-lang-flags .emp-lang-link.emp-lang-active {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .emp-lang-switcher * {
        transition: none !important;
        transform: none !important;
    }
}
