/* Translation System Styles */
.translation-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.translation-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%23333' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    border-radius: inherit;
    z-index: 1;
}

/* Language selector improvements */
#language-selector .group:hover #language-dropdown,
#mobile-language-selector {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#language-selector .group:hover #language-dropdown::-webkit-scrollbar {
    width: 4px;
}

#language-selector .group:hover #language-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

#language-selector .group:hover #language-dropdown::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Language option hover effects */
.language-option,
.language-option-mobile {
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.language-option:hover,
.language-option-mobile:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    transform: translateX(2px);
}

.language-option.active,
.language-option-mobile.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: rgb(37, 99, 235);
    font-weight: 600;
}

/* Current language display */
#current-language {
    font-weight: 500;
    margin-left: 4px;
    margin-right: 4px;
}

/* Translation feedback styles */
.translation-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideInFade 0.3s ease-out;
}

.translation-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: slideInFade 0.3s ease-out;
}

@keyframes slideInFade {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #mobile-language-selector {
        max-height: 300px;
    }
    
    .language-option-mobile {
        font-size: 16px;
        padding: 12px 10px;
    }
}

/* RTL language support */
[dir="rtl"] .language-option,
[dir="rtl"] .language-option-mobile {
    text-align: right;
}

[dir="rtl"] .language-option:hover,
[dir="rtl"] .language-option-mobile:hover {
    transform: translateX(-2px);
}

/* Improved loading indicator */
#translation-loader {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    animation: slideInFade 0.3s ease-out;
}

#translation-loader .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Language selector button styling */
#language-selector .btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#language-selector .btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Dropdown positioning improvements */
#language-dropdown {
    min-width: 200px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Flag emoji spacing */
.language-option .flag,
.language-option-mobile .flag {
    margin-right: 8px;
    font-size: 16px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #language-dropdown {
        background: rgba(30, 30, 30, 0.95);
        color: white;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .language-option:hover,
    .language-option-mobile:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    #translation-loader {
        background: rgba(255, 255, 255, 0.9);
        color: black;
    }
}
