/**
 * MLAF Translation Simple - Frontend Styles
 * Weglot-style language switcher
 */

/* Language Switcher Container */
#mlaf-language-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Language Button */
.mlaf-lang-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mlaf-lang-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.mlaf-lang-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Language Menu */
.mlaf-lang-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.mlaf-lang-menu li {
    margin: 0;
    padding: 0;
}

.mlaf-lang-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.mlaf-lang-link:hover {
    background: #f8f9fa;
}

.mlaf-lang-link:active {
    background: #e9ecef;
}

/* Checkmark */
.mlaf-checkmark {
    color: #28a745;
    font-weight: bold;
    margin-left: 8px;
}

/* Loading Overlay */
#mlaf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Spinner */
.mlaf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mlaf-spin 0.8s linear infinite;
}

@keyframes mlaf-spin {
    to { transform: rotate(360deg); }
}

/* Progress Text */
.mlaf-progress {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin-top: 16px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #mlaf-language-switcher {
        bottom: 15px;
        right: 15px;
    }

    .mlaf-lang-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .mlaf-lang-menu {
        min-width: 150px;
    }

    .mlaf-lang-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mlaf-lang-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .mlaf-lang-btn:hover {
        background: #374151;
    }

    .mlaf-lang-menu {
        background: #2d3748;
        border-color: #4a5568;
    }

    .mlaf-lang-link {
        color: #e2e8f0;
    }

    .mlaf-lang-link:hover {
        background: #374151;
    }

    .mlaf-lang-link:active {
        background: #4a5568;
    }
}

/* Smooth scroll during translation */
html.mlaf-translating {
    scroll-behavior: smooth;
}

/* Hide content briefly during initial translation to prevent flash */
body.mlaf-translation-loading {
    opacity: 0.95;
}

/* Accessibility */
.mlaf-lang-btn:focus,
.mlaf-lang-link:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Custom scrollbar for language menu */
.mlaf-lang-menu::-webkit-scrollbar {
    width: 6px;
}

.mlaf-lang-menu::-webkit-scrollbar-track {
    background: transparent;
}

.mlaf-lang-menu::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.mlaf-lang-menu::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}
