/* Advanced Language Switcher Enhancements */
.lang-switcher {
    position: relative;
    z-index: 1000;
}

/* Floating Animation for Language Switcher */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-2px); }
}

.lang-switcher:hover {
    animation: float 2s ease-in-out infinite;
}

/* Glow Effect for Active Language */
.lang-btn.active,
.lang-select:focus {
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Smooth Language Transition */
.lang-switcher * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Flag Styling */
.lang-flag-emoji {
    position: relative;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Language Switcher Tooltip */
.lang-switcher::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.lang-switcher:hover::after {
    opacity: 1;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .lang-switcher {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .lang-btn,
    .lang-select {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .lang-btn,
    .lang-select {
        border-width: 3px;
        border-color: rgba(255, 255, 255, 0.8);
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .lang-switcher *,
    .lang-btn::before,
    .lang-flag-emoji {
        animation: none;
        transition: none;
    }
    
    .lang-btn:hover,
    .lang-select:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .lang-switcher {
        display: none;
    }
}

/* Focus Visible for Accessibility */
.lang-btn:focus-visible,
.lang-select:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Loading State */
.lang-switcher.loading .lang-btn,
.lang-switcher.loading .lang-select {
    opacity: 0.7;
    pointer-events: none;
}

.lang-switcher.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1002;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
