/* === Kalra Chatbot Scoped Styles === */
.kalra-chat-icon {
    position: fixed;
    bottom: 100px;
    right: 0;
    cursor: pointer;
    z-index: 9999;
}

.kalra-chat-icon img {
    width: 110px;
    height: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 0 10px #a36bff);
}

.kalra-chat-icon img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px #b380ff);
}

.kalra-chatbox {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 550px;
    background-color: #1b0030;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(163, 107, 255, 0.3);
    z-index: 9999;
    overflow: hidden;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
}

.kalra-chatbox-header {
    background: linear-gradient(90deg, #7a00ff, #b066ff);
    color: white;
    padding: 12px 15px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kalra-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.kalra-close-btn:hover {
    color: #ffd6ff;
}

.kalra-chatbox-messages {
    padding: 12px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #140026;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kalra-chatbox-footer {
    padding: 10px;
    display: flex;
    border-top: 1px solid #4d007a;
    background-color: #1e0033;
}

.kalra-input {
    flex-grow: 1;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid #7a00ff;
    background-color: #2a0047;
    color: white;
    font-size: 14px;
}

.kalra-input::placeholder {
    color: #bda4d7;
}

.kalra-send-btn {
    padding: 8px 14px;
    background-color: #7a00ff;
    color: white;
    border: none;
    border-radius: 20px;
    margin-left: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.kalra-send-btn:hover {
    background-color: #a54dff;
}

/* ====== Message Styles ====== */
.kalra-message {
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    animation: kalraFadeIn 0.4s ease-in;
}

.kalra-user-message {
    background: #8e3cff;
    color: white;
    align-self: flex-end;
    text-align: left;
    border-bottom-right-radius: 4px;
    box-shadow: 0 0 6px rgba(142, 60, 255, 0.5);
}

.kalra-bot-message {
    background: #2f1147;
    color: #e6e6e6;
    align-self: flex-start;
    text-align: left;
    border-bottom-left-radius: 4px;
    box-shadow: 0 0 4px rgba(160, 100, 255, 0.2);
}

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

.kalra-chatbox-messages::-webkit-scrollbar {
    width: 6px;
}

.kalra-chatbox-messages::-webkit-scrollbar-thumb {
    background-color: #6e2fff;
    border-radius: 3px;
}

.kalra-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 16px;
    background: #2f1147;
    box-shadow: 0 0 4px rgba(160, 100, 255, 0.2);
}

.kalra-dot {
    width: 6px;
    height: 6px;
    background-color: #cda6ff;
    border-radius: 50%;
    animation: kalraTyping 1.2s infinite ease-in-out;
}

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

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

@keyframes kalraTyping {
    0%, 80%, 100% { opacity: 0.4; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}