/* Chat Widget Styles */
.chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease;
    padding: 0;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-toggle-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.chat-widget-container.open {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header-widget {
    background: linear-gradient(135deg, #00ae98, #a3fafe);
    padding: 15px;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 2px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chat-history-widget {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-area-widget {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

#widget-user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    width: 100%;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.icon-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.icon-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

#widget-send-btn {
    background: #00ae98;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

/* Reuse message styles but adjust for widget */
.message {
    display: flex;
    margin-bottom: 5px;
}

.message-content {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.user-message {
    justify-content: flex-end;
}

.ai-message {
    justify-content: flex-start;
}

.user-message .message-content {
    background: #00ae98;
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-message .message-content {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
}

.debug-message .message-content {
    background: #fff3cd;
    color: #856404;
    font-size: 0.8rem;
    border: 1px solid #ffeeba;
    font-family: monospace;
}