/* Frontend Language Switcher Styles */

.wp-mlm-language-switcher {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dropdown Style */
.wp-mlm-switcher-dropdown {
    position: relative;
}

.wp-mlm-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: space-between;
}

.wp-mlm-switcher-toggle:hover {
    border-color: #999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wp-mlm-switcher-toggle:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.wp-mlm-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.wp-mlm-switcher-dropdown.open .wp-mlm-dropdown-arrow {
    transform: rotate(180deg);
}

.wp-mlm-switcher-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1000;
    display: none;
}

.wp-mlm-switcher-dropdown.open .wp-mlm-switcher-menu {
    display: block;
}

.wp-mlm-switcher-menu li {
    margin: 0;
    padding: 0;
}

.wp-mlm-lang-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.wp-mlm-lang-link:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* Flags Style */
.wp-mlm-switcher-flags {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wp-mlm-flag-link {
    display: inline-block;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.wp-mlm-flag-link:hover,
.wp-mlm-flag-link.wp-mlm-flag-current {
    opacity: 1;
    transform: scale(1.1);
}

/* Text Style */
.wp-mlm-switcher-text {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wp-mlm-text-link {
    color: #0073aa;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.wp-mlm-text-link:hover {
    background-color: #0073aa;
    color: #fff;
}

.wp-mlm-text-link.wp-mlm-text-current {
    background-color: #0073aa;
    color: #fff;
    font-weight: bold;
}

.wp-mlm-separator {
    color: #999;
    font-size: 12px;
}

/* Flag Icons */
.wp-mlm-flag {
    display: inline-block;
    width: 20px;
    height: 15px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.wp-mlm-flag-es {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzUwIiBoZWlnaHQ9IjUwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iNzUwIiBoZWlnaHQ9IjUwMCIgZmlsbD0iI0FBMTUxQiIvPgogIDxyZWN0IHdpZHRoPSI3NTAiIGhlaWdodD0iMjUwIiB5PSIxMjUiIGZpbGw9IiNGMUJGMDAiLz4KPC9zdmc+');
}

.wp-mlm-flag-en {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAxMjAwIDYwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMTIwMCIgaGVpZ2h0PSI2MDAiIGZpbGw9IiMwMTI0NjkiLz4KICA8ZyBmaWxsPSIjRkZGIj4KICAgIDxwYXRoIGQ9Im0wLDAgbDIwMCwxMDAgTDAsIDIwMCBNNDAwLDAgbDQwMCwyMDAgTDQwMCw0MDAgeiIvPgogICAgPHBhdGggZD0ibTYwMCwwIGw2MDAsNDAwIE02MDAsNDAwIGw2MDAsLTQwMCIvPgogIDwvZz4KICA8ZyBmaWxsPSIjQ0UxMTI0Ij4KICAgIDxwYXRoIGQ9Im0wLDAgbDEwMCw1MCBMMC4xMDAiLz4KICA8L2c+Cjwvc3ZnPg==');
}

.wp-mlm-flag-fr {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTAwIiBoZWlnaHQ9IjYwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMzAwIiBoZWlnaHQ9IjYwMCIgZmlsbD0iIzAwMjM5NSIvPgogIDxyZWN0IHdpZHRoPSIzMDAiIGhlaWdodD0iNjAwIiB4PSIzMDAiIGZpbGw9IiNGRkYiLz4KICA8cmVjdCB3aWR0aD0iMzAwIiBoZWlnaHQ9IjYwMCIgeD0iNjAwIiBmaWxsPSIjRUQyOTM5Ii8+Cjwvc3ZnPg==');
}

.wp-mlm-flag-de {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAxMDAwIDYwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiMwMDAiLz4KICA8cmVjdCB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIyMDAiIHk9IjIwMCIgZmlsbD0iI0REMDAzRiIvPgogIDxyZWN0IHdpZHRoPSIxMDAwIiBoZWlnaHQ9IjIwMCIgeT0iNDAwIiBmaWxsPSIjRkZDRTAwIi8+Cjwvc3ZnPg==');
}

.wp-mlm-flag-it {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwMCIgaGVpZ2h0PSIxMDAwIiB2aWV3Qm94PSIwIDAgMTUwMCAxMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHdpZHRoPSI1MDAiIGhlaWdodD0iMTAwMCIgZmlsbD0iIzAwOTI0NiIvPgogIDxyZWN0IHdpZHRoPSI1MDAiIGhlaWdodD0iMTAwMCIgeD0iNTAwIiBmaWxsPSIjRkZGIi8+CiAgPHJlY3Qgd2lkdGg9IjUwMCIgaGVpZ2h0PSIxMDAwIiB4PSIxMDAwIiBmaWxsPSIjQ0UyQjM3Ii8+Cjwvc3ZnPg==');
}

.wp-mlm-flag-pt {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMjQwIiBoZWlnaHQ9IjQwMCIgZmlsbD0iIzAwNjYwMCIvPgogIDxyZWN0IHdpZHRoPSIzNjAiIGhlaWdodD0iNDAwIiB4PSIyNDAiIGZpbGw9IiNGRjAwMDAiLz4KPC9zdmc+');
}

/* Language Names */
.wp-mlm-lang-name {
    font-size: 14px;
    font-weight: 500;
}

/* Menu Integration */
.wp-mlm-menu-item {
    position: relative;
}

.wp-mlm-menu-switcher {
    margin: 0;
}

.wp-mlm-menu-switcher .wp-mlm-switcher-flags {
    gap: 4px;
}

.wp-mlm-menu-switcher .wp-mlm-flag {
    width: 24px;
    height: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-mlm-switcher-toggle {
        min-width: 100px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .wp-mlm-lang-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .wp-mlm-flag {
        width: 18px;
        height: 13px;
    }
    
    .wp-mlm-text-link {
        padding: 3px 6px;
        font-size: 13px;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .wp-mlm-switcher-toggle {
        background: #2c2c2c;
        border-color: #555;
        color: #fff;
    }
    
    .wp-mlm-switcher-toggle:hover {
        border-color: #777;
    }
    
    .wp-mlm-switcher-menu {
        background: #2c2c2c;
        border-color: #555;
    }
    
    .wp-mlm-lang-link {
        color: #fff;
    }
    
    .wp-mlm-lang-link:hover {
        background-color: #3c3c3c;
        color: #fff;
    }
}

/* Animation */
.wp-mlm-switcher-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.wp-mlm-switcher-dropdown.open .wp-mlm-switcher-menu {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State */
.wp-mlm-language-switcher.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wp-mlm-language-switcher.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wp-mlm-spin 1s linear infinite;
}

@keyframes wp-mlm-spin {
    to { transform: rotate(360deg); }
}
/* Enhanced Translation Overlay */
.wp-mlm-translation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wp-mlm-translation-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wp-mlm-translation-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.wp-mlm-translation-overlay.active .wp-mlm-translation-content {
    transform: translateY(0);
}

.wp-mlm-translation-spinner {
    margin-bottom: 20px;
}

.wp-mlm-spinner-ring {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: wp-mlm-spin 1s linear infinite;
}

.wp-mlm-translation-message {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.wp-mlm-translation-progress {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.wp-mlm-progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.wp-mlm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 2px;
    width: 0%;
    transition: width 2s ease-in-out;
}

/* Legacy spinner for compatibility */
.wp-mlm-spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: wp-mlm-spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Real-time translation effects */
.wp-mlm-translating {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.wp-mlm-translated {
    opacity: 1;
    animation: wp-mlm-highlight 0.5s ease;
}

@keyframes wp-mlm-highlight {
    0% { background-color: rgba(255, 255, 0, 0.3); }
    100% { background-color: transparent; }
}

/* Language switcher active states */
.wp-mlm-language-switcher.translating {
    pointer-events: none;
}

.wp-mlm-language-switcher.translating .wp-mlm-switcher-toggle {
    opacity: 0.6;
}

/* Enhanced Translation Notices */
.wp-mlm-translation-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 999998;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.wp-mlm-translation-notice.active {
    transform: translateX(0);
}

.wp-mlm-translation-notice.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.wp-mlm-translation-notice.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.wp-mlm-notice-icon {
    font-size: 18px;
    font-weight: bold;
}

/* Legacy notification for compatibility */
.wp-mlm-translation-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: wp-mlm-slideIn 0.3s ease;
}

@keyframes wp-mlm-slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
/
* Enhanced Real-time Translation Effects */
.wp-mlm-translating {
    position: relative;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.wp-mlm-translating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 124, 186, 0.1), transparent);
    animation: wp-mlm-shimmer 1.5s infinite;
    pointer-events: none;
}

@keyframes wp-mlm-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.wp-mlm-translated {
    opacity: 1;
    animation: wp-mlm-highlight 0.8s ease;
}

@keyframes wp-mlm-highlight {
    0% { 
        background-color: rgba(0, 124, 186, 0.2);
        transform: scale(1.02);
    }
    50% { 
        background-color: rgba(0, 124, 186, 0.1);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
    }
}

/* Enhanced Animations */
@keyframes wp-mlm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes wp-mlm-slide-in {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Optimizations for Translation Features */
@media (max-width: 768px) {
    .wp-mlm-translation-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .wp-mlm-translation-message {
        font-size: 16px;
    }
    
    .wp-mlm-spinner-ring {
        width: 50px;
        height: 50px;
    }
    
    .wp-mlm-translation-notice {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .wp-mlm-translation-notice.active {
        transform: translateY(0);
    }
}

/* Dark Mode Support for Translation Features */
@media (prefers-color-scheme: dark) {
    .wp-mlm-translation-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .wp-mlm-translation-message {
        color: #ecf0f1;
    }
    
    .wp-mlm-translation-progress {
        background: #34495e;
    }
    
    .wp-mlm-translating::after {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wp-mlm-translation-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .wp-mlm-translation-content {
        border: 2px solid #007cba;
    }
    
    .wp-mlm-spinner-ring {
        border-top-color: #ff6b35;
    }
    
    .wp-mlm-translation-notice.success {
        background: #28a745;
    }
    
    .wp-mlm-translation-notice.error {
        background: #dc3545;
    }
}

/* Accessibility Improvements */
.wp-mlm-translation-overlay[aria-hidden="true"] {
    display: none;
}

.wp-mlm-translation-content {
    role: dialog;
    aria-labelledby: "wp-mlm-translation-title";
    aria-describedby: "wp-mlm-translation-desc";
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wp-mlm-translation-overlay,
    .wp-mlm-translation-content,
    .wp-mlm-translation-notice,
    .wp-mlm-spinner-ring,
    .wp-mlm-progress-fill {
        animation: none;
        transition: none;
    }
    
    .wp-mlm-translating::after {
        display: none;
    }
}

/* Print Styles */
@media print {
    .wp-mlm-translation-overlay,
    .wp-mlm-translation-notice {
        display: none !important;
    }
}