/* Chat widget container */
#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 9999;
    font-family: sans-serif;
}

/* Floating button */
#chat-toggle {
    background: linear-gradient(90deg, #E11D48, #F59E0B);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
}

#chat-toggle:hover {
    background: #F59E0B;
}

/* Chat window */
#chat-container {
    display: none;
    flex-direction: column;
    width: 320px;
    max-width: 90vw;
    height: 400px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-bottom: 10px;
}

/* Header */
#chat-header {
    background: linear-gradient(90deg, #E11D48, #F59E0B);
    color: white;
    font-weight: bold;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Messages */
#chat-box {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #F3F4F6;
}

.message {
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background: linear-gradient(90deg, #E11D48, #F59E0B);
    color: white;
    margin-left: auto;
}

.message.bot {
    background: #E5E7EB;
    color: black;
    margin-right: auto;
}

/* Input */
#chat-input-container {
    display: flex;
    border-top: 1px solid #D1D5DB;
    padding: 8px;
    gap: 6px;
}

#user-input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid black;
    outline: none;
    color: black;
}

#send-btn {
    background: linear-gradient(90deg, #E11D48, #F59E0B);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
}

#send-btn:hover {
    background: linear-gradient(90deg, #E11D48, #F59E0B);
}

/* Loading */
#loading {
    padding: 5px 10px;
    font-style: italic;
    color: #6B7280;
    display: none;
    font-size: 12px;
}

/* Mobile adjustments */
@media (max-width: 500px) {
    #chat-container {
        width: 90vw;
        height: 60vh;
    }

    #chat-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

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

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #555;
    border-radius: 50%;
    opacity: 0.4;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}