/* =========================================
   CHAT WIDGET
   CAMUNG.VN
========================================= */

#chat-widget {
    position: fixed;
    right: 4px;
    bottom: 130px;
    z-index: 99999;
    font-family: Arial, Helvetica, sans-serif;
}


/* =========================================
   BUTTON
========================================= */

.chat-toggle {
    width: 62px;
    height: 62px;

    border: none;
    border-radius: 50%;

    background: #f7931e;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.chat-toggle:hover {
    transform: translateY(-3px);

    box-shadow:
        0 9px 25px rgba(0, 0, 0, 0.22);
}

.chat-icon {
    font-size: 27px;
    line-height: 1;
}


/* =========================================
   NOTIFICATION
========================================= */

.chat-notification {
    position: absolute;

    top: -3px;
    right: -3px;

    width: 21px;
    height: 21px;

    border-radius: 50%;

    background: #e53935;
    color: #fff;

    font-size: 12px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #fff;
}


/* =========================================
   CHAT BOX
========================================= */

.chat-box {
    position: absolute;

    right: 0;
    bottom: 76px;

    width: 300px;
    height: 450px;

    background: #fff;

    border-radius: 16px;

    overflow: hidden;

    box-shadow:
        0 12px 45px rgba(0, 0, 0, 0.18);

    display: none;

    flex-direction: column;
}

.chat-box.active {
    display: flex;
}


/* =========================================
   HEADER
========================================= */

.chat-header {
    min-height: 76px;

    padding: 14px 16px;

    background: #f7931e;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.chat-avatar {
    width: 43px;
    height: 43px;

    border-radius: 50%;

    background: #fff;
    color: #f7931e;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    font-weight: 700;
}

.chat-title {
    font-size: 16px;
    font-weight: 700;
}

.chat-status {
    margin-top: 4px;

    font-size: 12px;

    opacity: 0.95;

    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #42d66b;
}

.chat-close {
    border: none;
    background: transparent;

    color: #fff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    opacity: 0.9;
}

.chat-close:hover {
    opacity: 1;
}


/* =========================================
   MESSAGES
========================================= */

.chat-messages {
    flex: 1;

    padding: 18px 15px;

    overflow-y: auto;

    background: #f7f7f7;
}

.chat-message {
    display: flex;

    gap: 8px;

    margin-bottom: 16px;
}

.message-avatar {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content {
    max-width: 78%;
}

.message-name {
    margin-bottom: 4px;

    color: #666;

    font-size: 11px;
}

.message-bubble {
    padding: 10px 13px;

    border-radius: 4px 14px 14px 14px;

    background: #fff;

    color: #333;

    font-size: 14px;
    line-height: 1.5;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.message-time {
    margin-top: 4px;

    color: #999;

    font-size: 10px;
}


/* =========================================
   CUSTOMER MESSAGE
========================================= */

.customer-message {
    justify-content: flex-end;
}

.customer-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.customer-message .message-bubble {
    background: #f7931e;
    color: #fff;

    border-radius: 14px 4px 14px 14px;
}

.customer-message .message-name {
    display: none;
}


/* =========================================
   QUICK REPLIES
========================================= */

.chat-quick-replies {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 12px;
}

.quick-reply {
    border: 1px solid #f7931e;

    background: #fff;

    color: #e9820c;

    border-radius: 20px;

    padding: 7px 11px;

    font-size: 12px;

    cursor: pointer;

    transition: all 0.2s ease;
}

.quick-reply:hover {
    background: #f7931e;
    color: #fff;
}


/* =========================================
   INPUT
========================================= */

.chat-input-area {
    padding: 11px;

    background: #fff;

    border-top: 1px solid #eee;
}

#chat-form {
    display: flex;

    align-items: center;

    gap: 8px;
}

.chat-input {
    flex: 1;

    height: 43px;

    padding: 0 13px;

    border: 1px solid #ddd;

    border-radius: 22px;

    outline: none;

    font-size: 13px;
}

.chat-input:focus {
    border-color: #f7931e;
}

.chat-send {
    width: 43px;
    height: 43px;

    border: none;

    border-radius: 50%;

    background: #f7931e;
    color: #fff;

    font-size: 18px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send:hover {
    background: #e9820c;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 576px) {

    #chat-widget {
        right: 14px;
        bottom: 14px;
    }

    .chat-box {
        position: fixed;

        left: 10px;
        right: 10px;

        bottom: 84px;

        width: auto;
        height: calc(100vh - 110px);

        max-height: 620px;

        border-radius: 14px;
    }

    .chat-toggle {
        width: 58px;
        height: 58px;
    }
}