/* Retell AI Chat Interface Styles */

.retell-chat-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.retell-chat-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.retell-chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.retell-chat-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.retell-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
}

.retell-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: retellFadeIn 0.3s ease-in;
}

@keyframes retellFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.retell-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.retell-message.agent {
    align-self: flex-start;
}

.retell-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.retell-message.user .retell-message-avatar {
    background: #007bff;
    color: white;
}

.retell-message.agent .retell-message-avatar {
    background: #6c757d;
    color: white;
}

.retell-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.retell-message.user .retell-message-content {
    background: #007bff;
    color: white;
}

.retell-message.agent .retell-message-content {
    background: #f0f0f0;
    color: #333;
}

.retell-typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f0f0f0;
    border-radius: 18px;
    max-width: fit-content;
}

.retell-typing-indicator.active {
    display: flex;
}

.retell-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: retellBounce 1.4s infinite;
}

.retell-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.retell-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes retellBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.retell-input-area {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 12px;
    background: white;
}

#retell-user-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#retell-user-input:focus {
    border-color: #007bff;
}

#retell-send-button {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#retell-send-button:hover:not(:disabled) {
    background: #0056b3;
}

#retell-send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.retell-error-message {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    margin: 12px 0;
}

/* Scrollbar styling */
.retell-messages-area::-webkit-scrollbar {
    width: 6px;
}

.retell-messages-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.retell-messages-area::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.retell-messages-area::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .retell-message {
        max-width: 90%;
    }
    
    .retell-input-area {
        padding: 15px;
    }
    
    #retell-user-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
