:root {
    --kv-orange: #FF6B00;
    --kv-dark: #ef6423;
    --kv-light-gray: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f4f4;
}

/* --- ATTENTION GRABBER --- */
@keyframes pulse-bot {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 107, 0, 0.4);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 35px rgba(255, 107, 0, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 107, 0, 0.4);
    }
}

@keyframes shake-bot {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30%,
    50% {
        transform: rotate(-8deg);
    }

    20%,
    40%,
    60% {
        transform: rotate(8deg);
    }
}

.shake-active {
    animation: shake-bot 0.8s ease-in-out;
}

#bot-tooltip {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--kv-dark);
    color: white;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(255, 111, 2, 0.2);
    z-index: 9998;
    border-left: 4px solid var(--kv-orange);
    display: none;
    animation: fadeInUp 0.6s ease forwards;
}

#bot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--kv-dark);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- UI COMPONENTS --- */
#kv-bot-launcher {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: var(--kv-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    animation: pulse-bot 3s infinite ease-in-out;
}

#kv-chat-box {
    display: none;
    position: fixed;
    bottom: 105px;
    right: 25px;
    width: 380px;
    height: 580px;
    background: white;
    border-radius: 24px;
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #eee;
    animation: chatOpen 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chatOpen {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-header {
    background: var(--kv-dark);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--kv-orange);
}

#kv-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.msg-bubble {
    max-width: 82%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.bot-msg {
    background: var(--kv-light-gray);
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #eee;
}

.user-msg {
    background: var(--kv-orange);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.2);
}

.input-container {
    padding: 18px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    align-items: center;
}

#kv-input {
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 14px;
    flex: 1;
    outline: none;
}

#kv-input:focus {
    border-color: var(--kv-orange);
}

#send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--kv-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#send-btn:hover:not(:disabled) {
    background: var(--kv-orange);
    transform: scale(1.1);
}

#send-btn:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
}

.loader-spin {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--kv-orange);
    border-top: 2.5px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#kv-chat-body::-webkit-scrollbar {
    width: 5px;
}

#kv-chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}