/* ReluAI Chat Widget Styles */

#reluai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#reluai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

#reluai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

#reluai-chat-button svg {
    width: 28px;
    height: 28px;
}

#reluai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#reluai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#reluai-chat-header strong {
    display: block;
    font-size: 18px;
    margin-bottom: 2px;
}

#reluai-chat-header span {
    font-size: 12px;
    opacity: 0.9;
}

#reluai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

#reluai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#reluai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.reluai-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reluai-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.reluai-bot-message .reluai-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.reluai-user-message {
    text-align: right;
}

.reluai-user-message .reluai-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.reluai-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.reluai-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

#reluai-chat-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

#reluai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#reluai-chat-input:focus {
    border-color: #667eea;
}

#reluai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#reluai-send-btn:hover {
    transform: scale(1.05);
}

#reluai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reluai-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 13px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #reluai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 20px;
    }

    #reluai-chat-button {
        width: 56px;
        height: 56px;
    }
}

/* Scrollbar Styling */
#reluai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#reluai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#reluai-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#reluai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Product Links */
.reluai-message-content a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 500;
}

.reluai-user-message .reluai-message-content a {
    color: white;
}

/* Avatar Styles */
.reluai-avatar-container {
    float: left;
    margin-right: 8px;
    margin-top: 2px;
}

.reluai-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.reluai-bot-message {
    display: flex;
    align-items: flex-start;
}

.reluai-bot-message .reluai-message-content {
    margin-left: 0;
    max-width: 80%;
}