/**
 * Multilingual Live Chat - Frontend Styles
 */

/* Widget Container */
.mlc-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: fixed;
    z-index: 999999;
}

.mlc-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

.mlc-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

.mlc-widget-top-right {
    top: 20px;
    right: 20px;
}

.mlc-widget-top-left {
    top: 20px;
    left: 20px;
}

/* Chat Button */
.mlc-chat-button {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.mlc-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
}

.mlc-question-mark {
    font-size: 32px;
    font-weight: bold;
    color: white;
    line-height: 1;
    display: block;
    text-align: center;
    font-family: Arial, sans-serif;
}

.mlc-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Window */
.mlc-chat-window {
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    overflow: hidden;
    animation: mlc-slide-up 0.3s ease-out;
}

@keyframes mlc-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.mlc-chat-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 16px;
    border-radius: 16px 16px 0 0;
}

.mlc-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mlc-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.mlc-status-indicator {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    animation: mlc-pulse 2s infinite;
}

@keyframes mlc-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.mlc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mlc-language-selector {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.mlc-language-selector:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mlc-language-selector option {
    color: #333;
    background: white;
}

.mlc-icon-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.mlc-icon-button:hover {
    opacity: 0.8;
}

.mlc-icon-button svg {
    width: 24px;
    height: 24px;
}

/* Messages Container */
.mlc-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.mlc-messages-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mlc-message {
    display: flex;
    max-width: 80%;
}

.mlc-message-visitor {
    align-self: flex-end;
}

.mlc-message-admin {
    align-self: flex-start;
}

.mlc-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.mlc-message-visitor .mlc-message-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.mlc-message-admin .mlc-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mlc-auto-reply-label {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    font-style: italic;
}

.mlc-message-animate {
    animation: mlc-message-in 0.3s ease-out;
}

@keyframes mlc-message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator */
.mlc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mlc-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: mlc-typing 1.4s infinite;
}

.mlc-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.mlc-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes mlc-typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Input Area */
.mlc-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
}

.mlc-input-area form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.mlc-message-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

.mlc-message-input:focus {
    border-color: #007bff;
}

.mlc-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.mlc-send-button:hover {
    background: #0056b3;
}

.mlc-send-button svg {
    width: 20px;
    height: 20px;
}

/* Welcome Form */
.mlc-welcome-form {
    padding: 24px;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mlc-welcome-content h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    color: #333;
}

.mlc-welcome-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.mlc-form-group {
    margin-bottom: 16px;
}

.mlc-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.mlc-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.mlc-form-input:focus {
    outline: none;
    border-color: #007bff;
}

.mlc-submit-button {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.mlc-submit-button:hover {
    background: #0056b3;
}

/* Responsive */
@media (max-width: 480px) {
    .mlc-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 80px;
    }

    .mlc-widget-bottom-left .mlc-chat-window,
    .mlc-widget-top-left .mlc-chat-window {
        right: auto;
        left: 0;
    }
}

/* Scrollbar */
.mlc-messages-container::-webkit-scrollbar {
    width: 6px;
}

.mlc-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.mlc-messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.mlc-messages-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Dark Theme */
.mlc-theme-dark .mlc-chat-window {
    background: #1e1e1e;
}

.mlc-theme-dark .mlc-messages-container {
    background: #2d2d2d;
}

.mlc-theme-dark .mlc-message-admin .mlc-message-bubble {
    background: #3d3d3d;
    color: #fff;
}

.mlc-theme-dark .mlc-input-area {
    background: #1e1e1e;
    border-top-color: #3d3d3d;
}

.mlc-theme-dark .mlc-message-input {
    background: #2d2d2d;
    border-color: #3d3d3d;
    color: #fff;
}

.mlc-theme-dark .mlc-welcome-form {
    background: #1e1e1e;
}

.mlc-theme-dark .mlc-welcome-content h3 {
    color: #fff;
}

.mlc-theme-dark .mlc-welcome-content p {
    color: #aaa;
}

.mlc-theme-dark .mlc-form-input {
    background: #2d2d2d;
    border-color: #3d3d3d;
    color: #fff;
}
