/* =========================================================
   UltimatePOS AI Chatbot
========================================================= */

#chat-circle {
    position: fixed;

    right: 30px;
    bottom: 30px;

    width: 58px;
    height: 58px;

    border-radius: 50%;

    background: #3c8dbc;

    color: #fff;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 99999;

    box-shadow:
        0 4px 15px rgba(0,0,0,.25);

    transition: .2s;
}


#chat-circle:hover {
    transform: scale(1.05);
}


#chat-circle i {
    font-size: 22px;
}


/* =========================================================
   Chat Box
========================================================= */

.chat-box {

    display: none;

    position: fixed;

    right: 30px;
    bottom: 100px;

    width: 380px;

    max-width: calc(100vw - 30px);

    background: #fff;

    border-radius: 8px;

    overflow: hidden;

    z-index: 100000;

    box-shadow:
        0 5px 30px rgba(0,0,0,.25);
}


/* =========================================================
   Header
========================================================= */

.chat-box-header {

    height: 65px;

    padding: 0 18px;

    background: #3c8dbc;

    color: #fff;

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.chat-title {

    font-size: 17px;

    font-weight: 600;
}


.chat-title i {
    margin-right: 7px;
}


.chat-box-toggle {

    cursor: pointer;

    font-size: 18px;
}


/* =========================================================
   Body
========================================================= */

.chat-box-body {

    position: relative;

    height: 430px;

    background: #f5f6f7;
}


.chat-logs {

    height: 100%;

    padding: 15px;

    overflow-y: auto;
}


/* Scrollbar */

.chat-logs::-webkit-scrollbar {

    width: 5px;

}


.chat-logs::-webkit-scrollbar-thumb {

    background: #ccc;

    border-radius: 10px;
}


/* =========================================================
   Messages
========================================================= */

.chat-msg {

    clear: both;

    margin-bottom: 10px;
}


.cm-msg-text {

    display: inline-block;

    padding: 10px 14px;

    border-radius: 12px;

    background: #fff;

    color: #444;

    max-width: 90%;

    font-size: 13px;

    box-shadow:
        0 1px 3px rgba(0,0,0,.08);
}


.chat-msg.self {

    text-align: right;
}


.chat-msg.self
.cm-msg-text {

    background: #3c8dbc;

    color: #fff;

    border-radius: 12px 12px 2px 12px;
}


/* =========================================================
   Result Count
========================================================= */

.result-count {

    font-size: 12px;

    color: #777;

    margin-bottom: 5px;
}


/* =========================================================
   Item Card
========================================================= */

.item-card {

    background: #fff;

    border: 1px solid #e5e5e5;

    border-radius: 8px;

    padding: 12px;

    margin-bottom: 8px;

    box-shadow:
        0 1px 3px rgba(0,0,0,.05);
}


.item-card-header {

    display: flex;

    gap: 10px;

    margin-bottom: 10px;
}


.item-icon {

    width: 38px;

    height: 38px;

    flex-shrink: 0;

    background: #eef6fb;

    color: #3c8dbc;

    border-radius: 6px;

    display: flex;

    align-items: center;

    justify-content: center;
}


.item-name {

    font-size: 14px;

    font-weight: 600;

    color: #333;

    line-height: 20px;
}


.item-row {

    display: flex;

    justify-content: space-between;

    padding: 5px 0;

    border-top: 1px solid #f1f1f1;

    font-size: 12px;
}


.item-row span {

    color: #888;
}


.item-row strong {

    color: #444;
}


/* =========================================================
   Stock
========================================================= */

.stock-available {

    color: #28a745 !important;

}


.stock-empty {

    color: #dc3545 !important;

}


/* =========================================================
   Price
========================================================= */

.item-price {

    margin-top: 8px;

    padding: 9px;

    background: #f8f9fa;

    border-radius: 6px;

    display: flex;

    justify-content: space-between;

    align-items: center;
}


.item-price span {

    font-size: 12px;

    color: #777;
}


.item-price strong {

    color: #3c8dbc;

    font-size: 15px;
}


/* =========================================================
   Not Found
========================================================= */

.not-found {

    text-align: center;

    padding: 5px;

}


.not-found i {

    display: block;

    font-size: 22px;

    color: #aaa;

    margin-bottom: 7px;
}


.not-found strong {

    display: block;

}


.not-found small {

    display: block;

    margin-top: 5px;

    color: #999;
}


/* =========================================================
   Error
========================================================= */

.chat-error {

    color: #dc3545;

}


.chat-error i {

    margin-right: 5px;

}


/* =========================================================
   Loading
========================================================= */

.chat-loading {

    display: flex;

    align-items: center;

    gap: 4px;
}


.chat-loading span {

    width: 6px;

    height: 6px;

    background: #999;

    border-radius: 50%;

    animation: chatLoading 1.4s infinite;
}


.chat-loading span:nth-child(2) {

    animation-delay: .2s;

}


.chat-loading span:nth-child(3) {

    animation-delay: .4s;

}


@keyframes chatLoading {

    0%,
    60%,
    100% {

        opacity: .3;

        transform: translateY(0);

    }

    30% {

        opacity: 1;

        transform: translateY(-3px);

    }

}


/* =========================================================
   Input
========================================================= */

.chat-input {

    position: relative;

    background: #fff;

    border-top: 1px solid #ddd;
}


#chat-form {

    margin: 0;
}


#chat-input {

    width: 100%;

    height: 50px;

    border: none;

    outline: none;

    padding: 0 50px 0 15px;

    font-size: 13px;

    background: #fff;
}


.chat-submit {

    position: absolute;

    right: 8px;

    top: 7px;

    width: 36px;

    height: 36px;

    border: none;

    background: transparent;

    color: #3c8dbc;

    font-size: 16px;

    cursor: pointer;
}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 500px) {

    #chat-circle {

        right: 20px;

        bottom: 20px;

    }

    .chat-box {

        right: 15px;

        bottom: 85px;

        width: calc(100vw - 30px);

    }

    .chat-box-body {

        height: 60vh;

    }

}



/* Product selection container */
.chat-product-selection {
    width: 100%;
    margin-top: 5px;
}


/* Heading */
.chat-product-heading {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}


/* Buttons container */
.chat-product-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* Individual product button */
.chat-product-button {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 11px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    cursor: pointer;

    background: #fcb800;
    color: #000;

    text-align: left;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}


/* Hover */
.chat-product-button:hover {
    background: #e5a600;

    transform: translateY(-1px);

    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}


/* Click */
.chat-product-button:active {
    transform: scale(0.98);
}


/* Product button content */
.chat-product-button-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


/* Product name */
.chat-product-button-name {
    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* SKU */
.chat-product-button-sku {
    margin-top: 3px;

    font-size: 11px;

    opacity: 0.75;
}


/* Arrow */
.chat-product-arrow {
    min-width: 25px;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* Arrow icon */
.chat-product-arrow i {
    font-size: 12px;
}


/* Product details */
.chat-product-details {
    margin: 0 5px 8px 5px;

    padding: 12px;

    background: #ffffff;

    border: 1px solid #e5e5e5;

    border-top: none;

    border-radius: 0 0 8px 8px;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}


/* Product detail title */
.chat-detail-title {
    font-size: 14px;
    font-weight: 700;

    margin-bottom: 10px;

    color: #222;
}


/* Detail row */
.chat-detail-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 6px 0;

    border-bottom: 1px solid #f1f1f1;
}


/* Last row */
.chat-detail-row:last-child {
    border-bottom: none;
}


/* Detail label */
.chat-detail-row span {
    color: #777;

    font-size: 12px;
}


/* Detail value */
.chat-detail-row strong {
    color: #222;

    font-size: 12px;

    text-align: right;
}


/* Price */
.chatbot-price {
    color: #008000 !important;

    font-size: 14px !important;
}


/* Stock available */
.stock-available {
    color: #008000 !important;
}


/* Low stock */
.stock-low {
    color: #f39c12 !important;
}


/* Out of stock */
.stock-out {
    color: #e74c3c !important;
}


/* Loading */
.chat-loading {
    display: flex;
    align-items: center;
    gap: 4px;

    font-size: 12px;
}


.chat-loading span {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #999;

    animation: chatbotLoading 1.2s infinite;
}


.chat-loading span:nth-child(2) {
    animation-delay: 0.15s;
}


.chat-loading span:nth-child(3) {
    animation-delay: 0.3s;
}


@keyframes chatbotLoading {

    0%,
    60%,
    100% {
        opacity: 0.3;
    }

    30% {
        opacity: 1;
    }

}