/* ER WA Pro - Frontend Styles */
.er-wa-float { pointer-events: none; }
.er-wa-float > * { pointer-events: all; }

/* Pill label */
.er-wa-pill {
    display: flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .05em;
    padding: 11px 18px;
    border-radius: 50px;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
    transition: transform .15s ease, box-shadow .15s ease;
    line-height: 1;
}
.er-wa-pill:hover { transform: scale(1.04); box-shadow: 0 5px 18px rgba(0,0,0,.25); }

/* Icon button */
.er-wa-icon-wrap { position: relative; }
.er-wa-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    text-decoration: none !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
    transition: transform .15s ease, box-shadow .15s ease;
}
.er-wa-icon-btn:hover { transform: scale(1.08); box-shadow: 0 5px 18px rgba(0,0,0,.25); }
.er-wa-icon-btn svg { display: block; }

/* ── Style: Chip (label + icon menyatu, icon overlap di ujung pill) ── */
.er-wa-style-chip { gap: 0 !important; }
.er-wa-style-chip .er-wa-pill {
    padding-right: 34px;
    box-shadow: none;
}
.er-wa-style-chip.er-wa-side-left .er-wa-pill { padding-right: 18px; padding-left: 34px; }
.er-wa-style-chip .er-wa-icon-wrap { margin-left: -32px; }
.er-wa-style-chip.er-wa-side-left .er-wa-icon-wrap { margin-left: 0; margin-right: -32px; }
.er-wa-style-chip .er-wa-icon-btn {
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.er-wa-style-chip .er-wa-icon-btn svg { width: 20px; height: 20px; }

/* ── Style: Button (kotak/rounded-rect, bukan pill penuh) ── */
.er-wa-style-button .er-wa-pill {
    border-radius: 10px;
    padding: 12px 20px;
}
.er-wa-style-button .er-wa-icon-btn { border-radius: 10px; }

/* Notification badge */
.er-wa-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53e3e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border: 2px solid #fff;
    animation: er-wa-notif-pop .3s ease;
}
@keyframes er-wa-notif-pop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Animations */
.er-wa-anim-pulse { animation: er-wa-pulse 2.2s ease-in-out infinite; }
@keyframes er-wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.65); }
    60%  { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.er-wa-anim-bounce { animation: er-wa-bounce 2s infinite; }
@keyframes er-wa-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}
.er-wa-anim-shake { animation: er-wa-shake 3s infinite; }
@keyframes er-wa-shake {
    0%, 85%, 100% { transform: rotate(0deg); }
    87% { transform: rotate(-10deg); }
    89% { transform: rotate(10deg); }
    91% { transform: rotate(-10deg); }
    93% { transform: rotate(10deg); }
    95% { transform: rotate(0deg); }
}
.er-wa-anim-none {}

/* Entry effects */
.er-wa-entry-slide-up  { animation: er-wa-slide-up .5s ease forwards; }
.er-wa-entry-slide-right { animation: er-wa-slide-right .5s ease forwards; }
.er-wa-entry-fade      { animation: er-wa-fade .5s ease forwards; }
.er-wa-entry-zoom      { animation: er-wa-zoom .5s ease forwards; }
.er-wa-entry-none {}
@keyframes er-wa-slide-up    { from { transform: translateY(60px); opacity:0; } to { transform: translateY(0); opacity:1; } }
@keyframes er-wa-slide-right { from { transform: translateX(60px); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes er-wa-fade        { from { opacity:0; } to { opacity:1; } }
@keyframes er-wa-zoom        { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }

/* Hidden state */
.er-wa-float.er-wa-hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .3s, visibility .3s; }
.er-wa-float.er-wa-visible { opacity: 1; visibility: visible; transition: opacity .3s, visibility .3s; }

/* Offline tooltip */
.er-wa-offline-tooltip {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: #1a202c;
    color: #fff;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 10px 14px;
    border-radius: 8px;
    width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 10;
}
.er-wa-offline-tooltip p { margin: 0; }
.er-wa-offline-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: #1a202c;
    transform: rotate(45deg);
}
.er-wa-offline .er-wa-icon-btn { filter: grayscale(60%); opacity: .75; }

/* Greetings popup */
.er-wa-greetings {
    position: fixed;
    z-index: 99998;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    width: 300px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: er-wa-gr-in .3s ease;
}
@keyframes er-wa-gr-in { from { opacity:0; transform: translateY(12px) scale(.96); } to { opacity:1; transform: translateY(0) scale(1); } }
.er-wa-gr-close {
    position: absolute;
    top: 8px; right: 10px;
    background: none; border: none;
    font-size: 20px; color: rgba(255,255,255,.8);
    cursor: pointer; line-height: 1;
}
.er-wa-gr-close:hover { color: #fff; }
.er-wa-gr-body { padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.er-wa-gr-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.er-wa-gr-avatar-placeholder {
    width: 44px; height: 44px; border-radius: 50%;
    background: #e8fdf2; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.er-wa-gr-content { flex: 1; }
.er-wa-gr-agent { font-size: 11px; color: #718096; font-weight: 500; display: block; margin-bottom: 2px; }
.er-wa-gr-title { font-size: 15px; font-weight: 700; color: #1a202c; margin: 0 0 4px; }
.er-wa-gr-msg   { font-size: 13px; color: #4a5568; margin: 0 0 12px; line-height: 1.5; }
.er-wa-gr-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 50px;
    font-size: 13px; font-weight: 700;
    text-decoration: none !important;
    transition: filter .15s;
}
.er-wa-gr-cta:hover { filter: brightness(1.1); }
