/**
 * Polylang Hybrid Language Switcher Styles
 * Clean, modern design with smooth animations
 * @version 2.1.3
 */

 .polylang-hybrid-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
}

.language-dropdown {
    position: relative;
    width: 159px;
}

.language-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.language-dropdown-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.language-dropdown-toggle:hover::before {
    left: 100%;
}

.language-dropdown-toggle:hover, 
.language-dropdown-toggle:focus, 
.language-dropdown-toggle:active,  
.language-dropdown-toggle:visited {
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.2) !important;
    background: #fff;
    color: #212121;
    border: 2px solid #e0e0e0;
}

.language-dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.15), 0 8px 25px rgba(0, 124, 186, 0.2);
}

.language-dropdown-toggle:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

/* Globe icon styling (replaces flag on button) */
.language-globe-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #5D5D5D;
    transition: color 0.3s ease, transform 0.3s ease;
}

.language-dropdown-toggle:hover .language-globe-icon {
    color: #0066cc;
    transform: rotate(15deg);
}

/* Hide flags (legacy - now using globe icon) */
.language-flag {
    display: none !important;
}

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

.dropdown-arrow {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.language-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
    color: #007cba;
}

.language-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 150px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 8px 0 0 0;
    padding: 0;
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.language-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.language-dropdown-menu li {
    margin: 0;
    padding: 0;
    transform: translateX(-10px);
    opacity: 0;
    animation: slideInLeft 0.3s ease forwards;
}

.language-dropdown-menu.show li {
    animation-delay: calc(var(--item-index, 0) * 0.05s);
}

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

.language-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.language-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 124, 186, 0.1), transparent);
    transition: left 0.5s ease;
}

.language-link:hover::before {
    left: 100%;
}

.language-link:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e7f3ff 100%);
    color: #007cba;
    border-left-color: #007cba;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
}

.language-link:focus {
    outline: none;
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    color: #007cba;
    border-left-color: #007cba;
}

.language-link .language-flag {
    transition: transform 0.3s ease;
}

.language-link:hover .language-flag {
    transform: scale(1) rotate(5deg);
}

.translation-status {
    margin-left: auto;
    font-size: 12px;
    opacity: 0;
    display: none;
}

.translation-status .checking {
    animation: pulse 1.5s infinite;
}

.translation-status .has-translation {
    color: #10b981;
}

.translation-status .no-translation {
    color: #f59e0b;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Loading state for HybridTranslator */
.hybrid-translating .language-dropdown-toggle {
    opacity: 0.7;
    pointer-events: none;
}

.hybrid-translating .language-dropdown-toggle::after {
    content: '🔄';
    position: absolute;
    right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hide Google Translate elements */
#google_translate_element, 
.goog-te-gadget, 
.goog-te-banner-frame,
.skiptranslate {
    display: none !important;
}

body {
    top: 0px !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .language-dropdown-toggle {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .language-flag {
        width: 18px;
        height: 14px;
    }
    
    .language-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}
