#wmac-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 9999;
}

.wmac-btn-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

#wmac-button {
    cursor: pointer;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    object-fit: cover;
    display: flex;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    background-color: #43C252;
    padding: 12px;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#wmac-popup {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 320px;
    min-width: 280px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    z-index: 9400;
}

.wmac-right #wmac-button {
    right: 24px !important;
    left: auto !important;
}

.wmac-right #wmac-popup {
    right: 24px !important;
    left: auto !important;
}

/* --- Position LEFT --- */
.wmac-left #wmac-button {
    left: 24px !important;
    right: auto !important;
}

.wmac-left #wmac-popup {
    left: 24px !important;
    right: auto !important;
}

/* --- Position TOP RIGHT --- */
.wmac-top-right #wmac-button {
    top: 24px !important;
    right: 24px !important;
    bottom: auto !important;
    left: auto !important;
}

.wmac-top-right #wmac-popup {
    top: 90px !important;
    right: 24px !important;
    bottom: auto !important;
    left: auto !important;
}

/* --- Position TOP LEFT --- */
.wmac-top-left #wmac-button {
    top: 24px !important;
    left: 24px !important;
    bottom: auto !important;
    right: auto !important;
}

.wmac-top-left #wmac-popup {
    top: 90px !important;
    left: 24px !important;
    bottom: auto !important;
    right: auto !important;
}

.wmac-header {
    background: #43C252;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 14px;
}

.wmac-intro {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-top: 8px;
    margin-bottom: 2px;
    text-align: center;
}

.wmac-warning {
    margin-top: 4px;
    display: block;
}

.wmac-subtext {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
    margin-bottom: 20px;
    text-align: center;
}

.wmac-body {
    padding: 10px;
}

.wmac-agent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Each agent row */
.wmac-agent-item {
    margin: 12px 0;
}

.wmac-agent-column {
    display: table-column;
}

.wmac-agent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f8f8;
    padding: 12px;
    border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
    .wmac-agent-row:hover {
        background: #e8f7ee;
    }
}

.wmac-agent-row.open {
    background-color: #C7EDCB;
}


/* Chat link (avatar + name + WA icon) */
.wmac-agent-link {
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

.wmac-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    margin-right: 8px;
    background-color: #fff;
    padding: 2px;
    border: 3px solid #43C252;
    object-fit: cover !important;
}

.wmac-name {
    display: block;
    font-weight: bold;
    font-size: 14px;
    color: #222;
}

.wmac-title {
    display: block;
    font-size: 12px;
    color: #666;
}

.wmac-agent-info {
    display: flex;
    flex-direction: column;
    padding-top: 6px;
    padding-bottom: 6px;
}

.wmac-chat-icon {
    width: 36px;
    height: 36px;
    margin-left: auto;
    /* force WhatsApp icon right */
}

/* QR toggle button */
.wmac-show-qr {
    margin-left: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

@media (hover: none) and (pointer: coarse) {
    .wmac-show-qr:active {
        background: #f1f1f1;
        transform: scale(0.95);
        /* tap feedback */
    }
}

.wmac-qr-icon {
    width: 24px;
    height: 24px;
}

/* QR code under row */
.wmac-qr {
    margin-top: 8px;
    text-align: center;
}

.wmac-qr img {
    width: 80%;
    max-width: 280px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wmac-image-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* keep image and upload button inline and compact inside WP table */
#wmac-agents-table .wmac-image-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


.wmac-preview {
    max-width: 50px;
    max-height: 50px;
}

@media (max-width: 480px) {
    #wmac-popup {
        width: 90%;
        right: 5% !important;
        left: 5% !important;
    }

    .wmac-agent-link {
        flex-wrap: wrap;
    }

    .wmac-chat-icon {
        margin-left: auto;
    }

}