
/* Main Widget Container */

.wewc-widget {
    position: fixed;
    bottom: 25px;
    z-index: 99999;
    font-family: Arial, sans-serif;
    --wewc-color: #25D366;
}

.wewc-widget,
.wewc-widget * {
    box-sizing: border-box;
}

/* Position Settings */

.wewc-position-right {
    right: 25px;
}

.wewc-position-left {
    left: 25px;
}

/* Floating Button */

.wewc-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: var(--wewc-color);
    color: #ffffff;

    border: none;
    border-radius: 50px;

    padding: 15px 22px;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;

    cursor: pointer;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);

    transition: transform 0.2s ease,
                filter 0.2s ease;
}

.wewc-trigger:hover {
    transform: translateY(-3px);
    filter: brightness(0.9);
    color: #ffffff;
}

.wewc-trigger:focus-visible,
.wewc-close:focus-visible,
.wewc-start-chat:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 3px;
}

.wewc-trigger svg {
    flex-shrink: 0;
}

/* Chat Popup */

.wewc-panel {
    position: absolute;
    bottom: calc(100% + 15px);

    width: min(350px, calc(100vw - 32px));

    background: #ffffff;

    border-radius: 16px;

    overflow: hidden;

    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.2);
}

.wewc-panel[hidden] {
    display: none !important;
}

/* Popup Position */

.wewc-position-right .wewc-panel {
    right: 0;
}

.wewc-position-left .wewc-panel {
    left: 0;
}

/* Popup Header */

.wewc-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;

    background: #075E54;
    color: #ffffff;

    padding: 18px;
}

.wewc-avatar {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #ffffff;
    color: #075E54;

    font-size: 20px;
    font-weight: bold;
}


/* Agent Profile Photo */

.wewc-avatar img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 50%;
}

.wewc-agent-info {
    display: flex;
    flex-direction: column;
    gap: 4px;

    flex: 1;
}

.wewc-agent-info strong {
    color: #ffffff;
    font-size: 15px;
}

.wewc-agent-info span {
    color: #DCFCE7;
    font-size: 12px;
}

/* Close Button */

.wewc-close {
    background: transparent;
    border: none;

    color: #ffffff;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    padding: 4px;
}

/* Popup Body */

.wewc-panel-body {
    display: flex;
    flex-direction: column;
    gap: 35px;

    padding: 20px;

    background: #EDE5DB;
}

/* Chat Message */

.wewc-message {
    align-self: flex-start;

    background: #ffffff;
    color: #222222;

    padding: 14px;

    border-radius: 10px;

    font-size: 14px;
    line-height: 1.6;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

/* Start Chat Button */

.wewc-start-chat {
    display: block;

    background: #25D366;
    color: #ffffff;

    padding: 13px;

    border-radius: 8px;

    text-align: center;
    text-decoration: none;

    font-size: 14px;
    font-weight: bold;

    transition: background 0.2s ease;
}

.wewc-start-chat:hover {
    background: #128C7E;
    color: #ffffff;
}

/* Device Visibility */

@media screen and (min-width: 768px) {

    .wewc-widget.wewc-device-mobile {
        display: none !important;
    }

}

@media screen and (max-width: 767px) {

    .wewc-widget.wewc-device-desktop {
        display: none !important;
    }

    .wewc-position-right {
        right: 16px;
    }

    .wewc-position-left {
        left: 16px;
    }

    .wewc-widget {
        bottom: 16px;
    }

    .wewc-trigger {
        padding: 12px 16px;
        font-size: 13px;
    }

}

/* Business Hours Status */

.wewc-agent-info .wewc-business-status {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 12px;
    color: #ffffff;
}

/* Status Dot */

.wewc-status-dot {
    display: inline-block;

    width: 8px;
    height: 8px;

    min-width: 8px;

    border-radius: 50%;
}

/* Within Business Hours */

.wewc-business-status.wewc-open .wewc-status-dot {
    background-color: #4ADE80;
}

/* Outside Business Hours */

.wewc-business-status.wewc-closed .wewc-status-dot {
    background-color: #FBBF24;
}


/* ===================================
   WEBSITE LIVE CHAT
=================================== */

.wewc-panel-body {
    gap: 12px;
}

/* Message Container */

.wewc-chat-messages {
    display: flex;
    flex-direction: column;

    gap: 10px;

    height: 200px;
    min-height: 120px;

    overflow-y: auto;

    padding: 8px 2px;

    scrollbar-width: thin;
}

/* Common Message Bubble */

.wewc-chat-bubble {
    max-width: 85%;

    padding: 10px 13px;

    border-radius: 12px;

    font-size: 13px;
    line-height: 1.5;

    color: #222222;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Visitor Message */

.wewc-chat-visitor {
    align-self: flex-end;

    background: #D9FDD3;

    border-bottom-right-radius: 3px;
}

/* Support Reply */

.wewc-chat-agent {
    align-self: flex-start;

    background: #ffffff;

    border-bottom-left-radius: 3px;
}

/* Chat Status */

.wewc-chat-status {
    font-size: 11px;

    color: #555555;

    text-align: center;
}

/* Message Input Form */

.wewc-chat-form {
    display: flex;

    align-items: center;

    gap: 8px;

    width: 100%;
}

/* Input Field */

.wewc-chat-input {
    flex: 1;

    min-width: 0;

    padding: 12px;

    border: 1px solid #cccccc;
    border-radius: 8px;

    background: #ffffff;
    color: #222222;

    font-size: 13px;
}

/* Send Button */

.wewc-chat-send {
    flex-shrink: 0;

    padding: 12px 16px;

    background: #25D366;
    color: #ffffff;

    border: none;
    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.wewc-chat-send:hover {
    background: #128C7E;
    color: #ffffff;
}

.wewc-chat-send:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}

.wewc-chat-input:focus-visible,
.wewc-chat-send:focus-visible {
    outline: 2px solid #128C7E;
    outline-offset: 2px;
}

/* Mobile */

@media screen and (max-width: 767px) {

    .wewc-chat-messages {
        height: 170px;
    }

    .wewc-chat-input {
        font-size: 16px;
    }

}