/* Floating support chat widget - see Pages/Shared/_ChatWidget.cshtml and js/chat.js. */
.kp-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1050;
}

.kp-chat-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .2);
    position: relative;
}

.kp-chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    border-radius: 999px;
    font-size: .7rem;
    padding: .15rem .4rem;
    min-width: 20px;
}

.kp-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 350px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kp-chat-header {
    background: linear-gradient(135deg, #0d6efd, #174ea6);
    color: #fff;
    padding: .9rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kp-chat-header-sub {
    font-size: .78rem;
    opacity: .9;
}

.kp-chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #20b26b;
    display: inline-block;
    margin-right: 4px;
}

.kp-chat-name-prompt {
    padding: 1rem;
}

.kp-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kp-chat-product {
    padding: .6rem 1rem;
    border-bottom: 1px solid #eef0f5;
    background: #f7f8fb;
}

.kp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f7f8fb;
}

.kp-chat-msg {
    max-width: 78%;
    margin-bottom: .6rem;
}

.kp-chat-msg.admin {
    margin-right: auto;
}

.kp-chat-msg.customer {
    margin-left: auto;
}

.kp-chat-bubble {
    padding: .5rem .8rem;
    border-radius: 15px;
    font-size: .9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
    white-space: pre-wrap;
    word-break: break-word;
}

.kp-chat-msg.admin .kp-chat-bubble {
    background: #fff;
    border-bottom-left-radius: 4px;
}

.kp-chat-msg.customer .kp-chat-bubble {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.kp-chat-msg-time {
    font-size: .68rem;
    color: #8a929e;
    margin-top: 2px;
}

.kp-chat-msg.customer .kp-chat-msg-time {
    text-align: right;
}

.kp-chat-input-row {
    display: flex;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid #eef0f5;
    background: #fff;
}

@media (max-width: 420px) {
    .kp-chat-panel {
        right: -4px;
        width: calc(100vw - 16px);
    }
}
