/* =========================================================
   MUSTIKA WHATSAPP CUSTOMER SERVICE
   Global Widget
   ========================================================= */


/* =========================================================
   ROOT
   ========================================================= */

.mwa-widget {
    --mwa-green: #25d366;
    --mwa-green-dark: #128c7e;
    --mwa-navy: #083f56;
    --mwa-text: #17212b;
    --mwa-muted: #6d7882;
    --mwa-border: #e7ebee;
    --mwa-panel: #ffffff;
    --mwa-chat-bg: #efeae2;

    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 99999;

    font-family:
        "Poppins",
        Arial,
        sans-serif;
}


/* =========================================================
   FLOATING BUTTON
   ========================================================= */

.mwa-floating-button {
    position: relative;

    min-width: 58px;
    height: 58px;

    padding:
        0
        20px
        0
        16px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    color: #ffffff;

    background: var(--mwa-green);

    border: 0;
    border-radius: 999px;

    box-shadow:
        0 9px 28px rgba(0, 0, 0, 0.19),
        0 3px 8px rgba(0, 0, 0, 0.12);

    cursor: pointer;

    isolation: isolate;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.mwa-floating-button:hover,
.mwa-floating-button:focus-visible {
    background: #20bd5a;

    transform: translateY(-2px);

    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.22),
        0 4px 10px rgba(0, 0, 0, 0.13);

    outline: none;
}

.mwa-floating-icon {
    width: 29px;
    height: 29px;

    flex: 0 0 29px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mwa-floating-icon svg {
    display: block;

    width: 29px;
    height: 29px;

    fill: currentColor;
}

.mwa-floating-label {
    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}

.mwa-floating-pulse {
    position: absolute;

    inset: 0;

    z-index: -1;

    border-radius: inherit;

    background: rgba(37, 211, 102, 0.45);

    animation:
        mwaPulse 2.2s infinite;
}

@keyframes mwaPulse {

    0% {
        opacity: 0.55;

        transform: scale(1);
    }

    70% {
        opacity: 0;

        transform: scale(1.18);
    }

    100% {
        opacity: 0;

        transform: scale(1.18);
    }
}


/* =========================================================
   ADMIN PANEL
   ========================================================= */

.mwa-admin-panel {
    position: absolute;

    right: 0;
    bottom: 74px;

    width: 355px;

    overflow: hidden;

    color: var(--mwa-text);

    background: var(--mwa-panel);

    border:
        1px solid rgba(0, 0, 0, 0.06);

    border-radius: 17px;

    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.22),
        0 4px 16px rgba(0, 0, 0, 0.11);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(14px)
        scale(0.97);

    transform-origin:
        right bottom;

    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}

.mwa-widget.is-selector-open
.mwa-admin-panel {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   PANEL HEADER
   ========================================================= */

.mwa-panel-header {
    min-height: 78px;

    padding:
        16px
        15px;

    display: flex;
    align-items: center;

    gap: 11px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #128c7e,
            #0d776b
        );
}

.mwa-panel-header-icon {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(255, 255, 255, 0.14);

    border-radius: 50%;
}

.mwa-panel-header-icon svg {
    width: 25px;
    height: 25px;

    fill: currentColor;
}

.mwa-panel-header-copy {
    min-width: 0;

    display: flex;
    flex: 1;

    flex-direction: column;
}

.mwa-panel-header-copy strong {
    font-size: 14px;
    font-weight: 700;

    line-height: 1.25;
}

.mwa-panel-header-copy span {
    margin-top: 2px;

    color:
        rgba(255, 255, 255, 0.79);

    font-size: 10px;

    line-height: 1.35;
}

.mwa-panel-close,
.mwa-chat-close {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: inherit;

    background: transparent;

    border: 0;
    border-radius: 50%;

    font-family:
        Arial,
        sans-serif;

    font-size: 25px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.2s ease;
}

.mwa-panel-close:hover,
.mwa-panel-close:focus-visible,
.mwa-chat-close:hover,
.mwa-chat-close:focus-visible {
    background:
        rgba(255, 255, 255, 0.12);

    outline: none;
}


/* =========================================================
   PANEL INTRO
   ========================================================= */

.mwa-panel-intro {
    padding:
        18px
        18px
        13px;

    border-bottom:
        1px solid var(--mwa-border);
}

.mwa-panel-intro strong {
    display: block;

    color: var(--mwa-navy);

    font-size: 13px;
    font-weight: 700;
}

.mwa-panel-intro p {
    margin:
        5px
        0
        0;

    color: var(--mwa-muted);

    font-size: 11px;

    line-height: 1.55;
}


/* =========================================================
   ADMIN LIST
   ========================================================= */

.mwa-admin-list {
    padding:
        7px
        9px
        9px;
}

.mwa-admin-card {
    width: 100%;

    min-height: 76px;

    padding:
        10px
        9px;

    display: flex;
    align-items: center;

    gap: 11px;

    color: var(--mwa-text);

    text-align: left;

    background: transparent;

    border: 0;
    border-radius: 11px;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        transform 0.18s ease;
}

.mwa-admin-card:hover,
.mwa-admin-card:focus-visible {
    background: #f5f8f9;

    transform: translateX(2px);

    outline: none;
}


/* =========================================================
   ADMIN AVATAR
   ========================================================= */

.mwa-admin-avatar,
.mwa-chat-avatar {
    position: relative;

    width: 45px;
    height: 45px;

    flex: 0 0 45px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            #0d526c,
            #083f56
        );

    border-radius: 50%;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.02em;
}

.mwa-online-dot {
    position: absolute;

    right: 0;
    bottom: 1px;

    width: 12px;
    height: 12px;

    display: block;

    background: var(--mwa-green);

    border:
        2px solid #ffffff;

    border-radius: 50%;
}


/* =========================================================
   ADMIN COPY
   ========================================================= */

.mwa-admin-copy {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
}

.mwa-admin-copy strong {
    color: var(--mwa-navy);

    font-size: 12px;
    font-weight: 700;

    line-height: 1.3;
}

.mwa-admin-copy small {
    margin-top: 2px;

    color: var(--mwa-muted);

    font-size: 9px;

    line-height: 1.35;
}

.mwa-admin-status {
    margin-top: 5px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    color: #5a7566;

    font-size: 9px;
    font-weight: 500;
}

.mwa-admin-status i {
    width: 6px;
    height: 6px;

    display: block;

    background: var(--mwa-green);

    border-radius: 50%;
}

.mwa-admin-arrow {
    color: #9aa3a9;

    font-family:
        Arial,
        sans-serif;

    font-size: 24px;
    font-weight: 300;
}


/* =========================================================
   PANEL FOOTER
   ========================================================= */

.mwa-panel-footer {
    min-height: 45px;

    padding:
        10px
        17px;

    display: flex;
    align-items: center;

    gap: 8px;

    color: #869199;

    background: #f8fafb;

    border-top:
        1px solid var(--mwa-border);

    font-size: 8px;

    line-height: 1.4;
}

.mwa-panel-footer svg {
    width: 16px;
    height: 16px;

    flex: 0 0 16px;

    fill: none;

    stroke: #6e9b82;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   CHAT ROOM
   ========================================================= */

.mwa-chat-room {
    position: absolute;

    right: 0;
    bottom: 74px;

    width: 385px;

    overflow: hidden;

    color: var(--mwa-text);

    background: #ffffff;

    border:
        1px solid rgba(0, 0, 0, 0.06);

    border-radius: 17px;

    box-shadow:
        0 22px 65px rgba(0, 0, 0, 0.24),
        0 4px 16px rgba(0, 0, 0, 0.11);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(14px)
        scale(0.97);

    transform-origin:
        right bottom;

    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}

.mwa-widget.is-chat-open
.mwa-chat-room {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   CHAT HEADER
   ========================================================= */

.mwa-chat-header {
    min-height: 72px;

    padding:
        11px
        12px;

    display: flex;
    align-items: center;

    gap: 9px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #075e54,
            #0b786b
        );
}

.mwa-chat-back {
    width: 31px;
    height: 31px;

    flex: 0 0 31px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: #ffffff;

    background: transparent;

    border: 0;
    border-radius: 50%;

    cursor: pointer;
}

.mwa-chat-back:hover,
.mwa-chat-back:focus-visible {
    background:
        rgba(255, 255, 255, 0.12);

    outline: none;
}

.mwa-chat-back svg {
    width: 20px;
    height: 20px;

    fill: none;

    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mwa-chat-avatar {
    width: 42px;
    height: 42px;

    flex-basis: 42px;

    background: #ffffff;

    color: var(--mwa-navy);
}

.mwa-chat-avatar .mwa-online-dot {
    border-color: #075e54;
}

.mwa-chat-admin-info {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
}

.mwa-chat-admin-info strong {
    font-size: 13px;
    font-weight: 700;

    line-height: 1.3;
}

.mwa-chat-admin-info > span {
    margin-top: 3px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    color:
        rgba(255, 255, 255, 0.79);

    font-size: 9px;
}

.mwa-chat-admin-info > span i {
    width: 6px;
    height: 6px;

    background: var(--mwa-green);

    border-radius: 50%;
}


/* =========================================================
   CHAT BODY
   ========================================================= */

.mwa-chat-body {
    position: relative;

    height: 345px;

    overflow-y: auto;

    overscroll-behavior: contain;

    padding:
        14px
        12px
        18px;

    background-color: var(--mwa-chat-bg);

    background-image:
        radial-gradient(
            circle at 15% 20%,
            rgba(0, 0, 0, 0.028) 0 1px,
            transparent 1.3px
        );

    background-size:
        19px
        19px;

    scrollbar-width: thin;

    scrollbar-color:
        rgba(0, 0, 0, 0.2)
        transparent;
}

.mwa-chat-day {
    width: max-content;

    margin:
        0
        auto
        13px;

    padding:
        4px
        10px;

    color: #647078;

    background:
        rgba(255, 255, 255, 0.78);

    border-radius: 999px;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05);

    font-size: 8px;
    font-weight: 500;
}


/* =========================================================
   MESSAGES
   ========================================================= */

.mwa-chat-messages {
    display: flex;

    flex-direction: column;

    gap: 7px;
}

.mwa-message {
    position: relative;

    width: fit-content;
    max-width: 83%;

    padding:
        9px
        10px
        17px;

    border-radius: 9px;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.09);

    font-size: 11px;

    line-height: 1.55;

    animation:
        mwaMessageIn 0.24s ease both;
}

@keyframes mwaMessageIn {

    from {
        opacity: 0;

        transform: translateY(7px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }
}

.mwa-message-admin {
    align-self: flex-start;

    color: #20262a;

    background: #ffffff;

    border-top-left-radius: 3px;
}

.mwa-message-user {
    align-self: flex-end;

    color: #17211b;

    background: #d9fdd3;

    border-top-right-radius: 3px;
}

.mwa-message-time {
    position: absolute;

    right: 8px;
    bottom: 4px;

    color: #8a949a;

    font-size: 7px;

    line-height: 1;
}

.mwa-message-user
.mwa-message-time {
    color: #718274;
}


/* =========================================================
   TYPING
   ========================================================= */

.mwa-typing {
    width: max-content;

    padding:
        9px
        12px;

    display: flex;
    align-items: center;

    gap: 4px;

    align-self: flex-start;

    background: #ffffff;

    border-radius:
        4px
        10px
        10px
        10px;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.09);
}

.mwa-typing i {
    width: 5px;
    height: 5px;

    display: block;

    background: #a7afb4;

    border-radius: 50%;

    animation:
        mwaTyping 1.15s infinite ease-in-out;
}

.mwa-typing i:nth-child(2) {
    animation-delay: 0.14s;
}

.mwa-typing i:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes mwaTyping {

    0%,
    60%,
    100% {
        opacity: 0.35;

        transform: translateY(0);
    }

    30% {
        opacity: 1;

        transform: translateY(-3px);
    }
}


/* =========================================================
   CHAT FORM
   ========================================================= */

.mwa-chat-form {
    padding:
        10px
        10px
        8px;

    display: flex;
    align-items: flex-end;

    gap: 8px;

    background: #f5f6f6;

    border-top:
        1px solid #e2e5e6;
}

.mwa-chat-field {
    min-width: 0;

    flex: 1;

    background: #ffffff;

    border:
        1px solid #e1e5e7;

    border-radius: 19px;
}

.mwa-chat-field textarea {
    width: 100%;
    min-height: 39px;
    max-height: 100px;

    padding:
        10px
        13px;

    display: block;

    resize: none;

    overflow-y: auto;

    color: #263038;

    background: transparent;

    border: 0;
    outline: 0;

    font-family:
        "Poppins",
        Arial,
        sans-serif;

    font-size: 11px;

    line-height: 1.5;
}

.mwa-chat-field textarea::placeholder {
    color: #a1a9ae;
}

.mwa-chat-send {
    width: 41px;
    height: 41px;

    flex: 0 0 41px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: #ffffff;

    background: var(--mwa-green);

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background-color 0.18s ease;
}

.mwa-chat-send:hover,
.mwa-chat-send:focus-visible {
    background: #20bd5a;

    transform: scale(1.04);

    outline: none;
}

.mwa-chat-send svg {
    width: 19px;
    height: 19px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   CHAT NOTE
   ========================================================= */

.mwa-chat-note {
    padding:
        0
        13px
        10px;

    color: #8b949a;

    background: #f5f6f6;

    text-align: center;

    font-size: 7px;

    line-height: 1.45;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {

    .mwa-widget {
        right: 12px;
        bottom: 14px;
    }

    .mwa-floating-button {
        min-width: 56px;
        height: 56px;

        padding:
            0
            14px;
    }

    .mwa-floating-icon {
        width: 28px;
        height: 28px;

        flex-basis: 28px;
    }

    .mwa-floating-label {
        display: none;
    }

    .mwa-admin-panel,
    .mwa-chat-room {
        right: 0;
        bottom: 68px;

        width:
            min(
                calc(100vw - 24px),
                385px
            );
    }

    .mwa-chat-body {
        height:
            min(
                360px,
                calc(100vh - 300px)
            );
    }
}


/* =========================================================
   MOBILE PENDEK
   ========================================================= */

@media (
    max-width: 680px
)
and (
    max-height: 650px
) {

    .mwa-chat-body {
        height: 245px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .mwa-floating-pulse {
        display: none;
    }

    .mwa-admin-panel,
    .mwa-chat-room,
    .mwa-floating-button,
    .mwa-message,
    .mwa-admin-card,
    .mwa-chat-send {
        transition: none;

        animation: none;
    }
}