/* Smart Language Manager Styles */

/* Loading states for language switcher */
.lang-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

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

/* Success animation for language switcher */
.lang-success {
    animation: langSuccess 0.6s ease-out;
}

@keyframes langSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 10px rgba(34, 197, 94, 0.5); }
    100% { transform: scale(1); }
}

/* Spin animation for loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Direction transition for RTL/LTR switching */
.direction-transition {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fallback translation indicator */
.fallback-translation {
    position: relative;
    opacity: 0.8;
}

.fallback-translation::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px dashed rgba(255, 193, 7, 0.5);
    border-radius: 2px;
    pointer-events: none;
}

/* Notification styles */
.language-notification {
    backdrop-filter: blur(10px);
    animation: slideInRight 0.4s ease-out;
}

.language-notification.removing {
    animation: slideOutRight 0.4s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Language dropdown improvements */
.language-dropdown {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-option {
    transition: all 0.15s ease;
}

.lang-option:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(99, 102, 241, 0.1));
    transform: translateX(2px);
}

/* RTL specific styles */
[dir="rtl"] .lang-option:hover {
    transform: translateX(-2px);
}

[dir="rtl"] .language-switcher {
    direction: rtl;
}

/* Enhanced dropdown positioning */
.language-dropdown-container {
    position: relative;
    z-index: 2147483647;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .language-dropdown {
        min-width: 100%;
        max-width: none;
    }

    .lang-option {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Edge browser compatibility */
@supports (-ms-ime-align: auto) {
    .language-dropdown {
        border: 2px solid rgba(255, 255, 255, 0.2);
    }

    .lang-option:hover {
        background: rgba(147, 51, 234, 0.2);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fallback-translation::before {
        border-color: #fbbf24;
        border-width: 2px;
    }

    .lang-option:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .lang-loading::after,
    .direction-transition,
    .lang-success,
    .language-notification {
        animation: none;
        transition: none;
    }

    .lang-option {
        transition: none;
    }
}
