/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switcher .flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: auto;
    min-width: 50px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 4px 8px;
    gap: 2px;
}

.lang-switcher .flag-btn .flag-image {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.lang-switcher .flag-btn .flag-emoji {
    font-size: 16px;
    line-height: 1;
    transition: all 0.3s ease;
}

.lang-switcher .flag-btn .lang-text {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 1px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.lang-switcher .flag-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lang-switcher .flag-btn:hover .flag-image {
    transform: scale(1.1);
}

.lang-switcher .flag-btn:hover .flag-emoji {
    transform: scale(1.1);
}

.lang-switcher .flag-btn:hover .lang-text {
    opacity: 1;
}

.lang-switcher .flag-btn.active {
    border-color: #007bff;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.lang-switcher .flag-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

/* Ripple effect */
.lang-switcher .flag-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.lang-switcher .flag-btn:active::before {
    width: 40px;
    height: 40px;
}

/* Language Switcher for Desktop */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-switcher .lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.language-switcher .lang-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.language-switcher .lang-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.language-switcher .lang-btn .flag {
    font-size: 16px;
    line-height: 1;
}

.language-switcher .lang-btn .code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lang-switcher .flag-btn {
        min-width: 45px;
        height: 32px;
        font-size: 9px;
        padding: 3px 6px;
        gap: 1px;
    }
    
    .lang-switcher .flag-btn .flag-image {
        width: 20px;
        height: 15px;
    }
    
    .lang-switcher .flag-btn .flag-emoji {
        font-size: 14px;
    }
    
    .lang-switcher .flag-btn .lang-text {
        font-size: 8px;
    }
    
    .language-switcher {
        gap: 2px;
        padding: 2px;
    }
    
    .language-switcher .lang-btn {
        padding: 6px 8px;
        font-size: 12px;
        gap: 4px;
    }
    
    .language-switcher .lang-btn .flag {
        font-size: 14px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .language-switcher {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .lang-switcher .flag-btn {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Animation for language change */
.lang-switching {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Loading state */
.lang-switcher.loading .flag-btn {
    opacity: 0.6;
    cursor: wait;
}

.lang-switcher.loading .flag-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.lang-switcher .flag-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.language-switcher .lang-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .lang-switcher .flag-btn {
        border-width: 3px;
        border-color: white;
    }
    
    .lang-switcher .flag-btn.active {
        background: #0066cc;
        border-color: white;
    }
    
    .language-switcher {
        border-width: 2px;
        border-color: white;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lang-switcher .flag-btn,
    .language-switcher .lang-btn {
        transition: none;
    }
    
    .lang-switcher .flag-btn:hover,
    .language-switcher .lang-btn:hover {
        transform: none;
    }
    
    .lang-switcher .flag-btn::before {
        display: none;
    }
}
