/* Chat Widget Container */
#nd-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Chat Button */
#nd-chat-btn {
    width: 60px;
    height: 60px;
    background-color: #8D7B68;
    /* Earthy ceramic tone */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s;
}

#nd-chat-btn:hover {
    transform: scale(1.05);
    background-color: #A4907C;
}

/* Chat Window */
#nd-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: #F8F5F1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

#nd-chat-window.open {
    transform: scale(1);
    opacity: 1;
}

/* Chat Header */
#nd-chat-header {
    background-color: #8D7B68;
    color: white;
    padding: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#nd-chat-header span {
    font-size: 16px;
    letter-spacing: 0.5px;
}

#nd-chat-close {
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    transition: color 0.2s;
}

#nd-chat-close:hover {
    color: #e0e0e0;
}

/* Messages Area */
#nd-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nd-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.nd-message.bot {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 13.5px;
}

.nd-message.user {
    background-color: #C8B6A6;
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    font-size: 14px;
}

.nd-message a {
    color: #8D7B68;
    font-weight: bold;
    text-decoration: underline;
}

/* Input Area */
#nd-chat-input-area {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #eaeaea;
}

#nd-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#nd-chat-input:focus {
    border-color: #8D7B68;
}

#nd-chat-send {
    background: #8D7B68;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#nd-chat-send:hover {
    background: #A4907C;
}

/* Typin Animation */
.nd-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    align-self: flex-start;
    width: max-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.nd-dot {
    width: 6px;
    height: 6px;
    background: #8D7B68;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.nd-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.nd-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

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

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

/* Markdown formatting inside bot bubble */
.nd-message.bot p {
    margin-top: 0;
    margin-bottom: 10px;
}

.nd-message.bot p:last-child {
    margin-bottom: 0;
}

.nd-message.bot ul {
    padding-left: 18px;
    margin: 8px 0;
}

.nd-message.bot li {
    margin-bottom: 4px;
}