/**
 * Mevo Assistant Widget Styles
 */

.mevo-assistant-widget {
    display: flex;
    flex-direction: column;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-width: 100%;
}

.mevo-assistant-error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-size: 14px;
}

/* Header */
.mevo-assistant-header {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mevo-assistant-avatar {
    flex-shrink: 0;
}

.mevo-assistant-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mevo-assistant-info {
    flex: 1;
    min-width: 0;
}

.mevo-assistant-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.mevo-assistant-description {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

/* Messages Area */
.mevo-assistant-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100% - 120px);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mevo-assistant-message {
    display: flex;
    gap: 8px;
    animation: fadeInUp 0.3s ease-out;
}

.mevo-assistant-user-message {
    flex-direction: row-reverse;
}

.mevo-assistant-message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.mevo-assistant-message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.mevo-assistant-message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.mevo-assistant-bot-message .mevo-assistant-message-content {
    background: #f1f3f5;
    color: #495057;
    border-bottom-left-radius: 6px;
}

.mevo-assistant-user-message .mevo-assistant-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

/* Typing Indicator */
.mevo-assistant-typing .mevo-assistant-message-content {
    padding: 16px 18px;
}

.mevo-assistant-typing-dots {
    display: flex;
    gap: 4px;
}

.mevo-assistant-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6c757d;
    animation: typingPulse 1.4s infinite ease-in-out both;
}

.mevo-assistant-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.mevo-assistant-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Input Area */
.mevo-assistant-input {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.mevo-assistant-form {
    display: flex;
    flex-direction: column;
}

.mevo-assistant-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.mevo-assistant-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    background: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.mevo-assistant-input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mevo-assistant-input-field:disabled {
    background: #e9ecef;
    opacity: 0.6;
}

.mevo-assistant-send-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.mevo-assistant-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.mevo-assistant-send-btn:active {
    transform: translateY(0);
}

.mevo-assistant-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mevo-assistant-loading {
    font-size: 12px;
    animation: pulse 1s infinite;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mevo-assistant-widget {
        border-radius: 8px;
    }
    
    .mevo-assistant-header {
        padding: 12px;
    }
    
    .mevo-assistant-messages {
        padding: 12px;
    }
    
    .mevo-assistant-input {
        padding: 12px;
    }
    
    .mevo-assistant-message-content {
        max-width: 85%;
        font-size: 13px;
    }
    
    .mevo-assistant-input-field {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Theme Color Variations */
.mevo-assistant-widget[data-theme="blue"] .mevo-assistant-header,
.mevo-assistant-widget[data-theme="blue"] .mevo-assistant-user-message .mevo-assistant-message-content,
.mevo-assistant-widget[data-theme="blue"] .mevo-assistant-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mevo-assistant-widget[data-theme="green"] .mevo-assistant-header,
.mevo-assistant-widget[data-theme="green"] .mevo-assistant-user-message .mevo-assistant-message-content,
.mevo-assistant-widget[data-theme="green"] .mevo-assistant-send-btn {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.mevo-assistant-widget[data-theme="purple"] .mevo-assistant-header,
.mevo-assistant-widget[data-theme="purple"] .mevo-assistant-user-message .mevo-assistant-message-content,
.mevo-assistant-widget[data-theme="purple"] .mevo-assistant-send-btn {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
}

.mevo-assistant-widget[data-theme="red"] .mevo-assistant-header,
.mevo-assistant-widget[data-theme="red"] .mevo-assistant-user-message .mevo-assistant-message-content,
.mevo-assistant-widget[data-theme="red"] .mevo-assistant-send-btn {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.mevo-assistant-widget[data-theme="orange"] .mevo-assistant-header,
.mevo-assistant-widget[data-theme="orange"] .mevo-assistant-user-message .mevo-assistant-message-content,
.mevo-assistant-widget[data-theme="orange"] .mevo-assistant-send-btn {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mevo-assistant-widget {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .mevo-assistant-messages {
        background: #2d3748;
    }
    
    .mevo-assistant-bot-message .mevo-assistant-message-content {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .mevo-assistant-input {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .mevo-assistant-input-field {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .mevo-assistant-input-field:focus {
        border-color: #667eea;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .mevo-assistant-widget {
        border-width: 2px;
    }
    
    .mevo-assistant-message-content {
        border: 1px solid;
    }
    
    .mevo-assistant-input-field {
        border-width: 2px;
    }
}
