/* Language Switcher Styles */
.language-switcher-container {
    position: relative;
    margin-left: auto;
    z-index: 1000;
}

.language-switcher {
    position: relative;
    display: inline-block;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-current:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-current:focus {
    outline: 2px solid var(--accent-color, #8a2be2);
    outline-offset: 2px;
}

.language-flag {
    font-size: 20px;
    line-height: 1;
}

.language-name {
    font-weight: 500;
}

.language-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.language-current[aria-expanded="true"] .language-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-option:first-child {
    border-radius: 8px 8px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 8px 8px;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.language-option:focus {
    background: rgba(138, 43, 226, 0.3);
    color: white;
    outline: none;
}

.language-option.active {
    background: rgba(138, 43, 226, 0.2);
    color: white;
    font-weight: 600;
}

.language-option.active::after {
    content: '✓';
    margin-left: auto;
    color: #8a2be2;
}

/* RTL Support */
.rtl .language-switcher-container {
    margin-left: 0;
    margin-right: auto;
}

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

.rtl .language-option {
    text-align: right;
    flex-direction: row-reverse;
}

.rtl .language-current {
    flex-direction: row-reverse;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-switcher-container {
        margin: 10px 0;
    }
    
    .language-current {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .language-flag {
        font-size: 18px;
    }
    
    .language-dropdown {
        min-width: 180px;
    }
    
    .language-option {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .language-current {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .language-dropdown {
        background: rgba(20, 20, 20, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .language-current {
        border-width: 2px;
    }
    
    .language-option:focus {
        outline: 2px solid white;
        outline-offset: -2px;
    }
}

/* Animation for dropdown items */
.language-dropdown.show .language-option {
    animation: fadeInUp 0.3s ease forwards;
}

.language-dropdown.show .language-option:nth-child(1) { animation-delay: 0.05s; }
.language-dropdown.show .language-option:nth-child(2) { animation-delay: 0.1s; }
.language-dropdown.show .language-option:nth-child(3) { animation-delay: 0.15s; }
.language-dropdown.show .language-option:nth-child(4) { animation-delay: 0.2s; }
.language-dropdown.show .language-option:nth-child(5) { animation-delay: 0.25s; }
.language-dropdown.show .language-option:nth-child(6) { animation-delay: 0.3s; }
.language-dropdown.show .language-option:nth-child(7) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}