@keyframes pulse-glow {
    0%   { transform: scale(1);    box-shadow: 0 4px 12px rgba(0,0,0,.2); }
    50%  { transform: scale(1.12); box-shadow: 0 6px 24px rgba(37,211,102,.6), 0 0 30px rgba(37,211,102,.35); }
    100% { transform: scale(1);    box-shadow: 0 4px 12px rgba(0,0,0,.2); }
}
@keyframes badge-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }

.wa-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; }

.wa-button {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #1fa85a 100%);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: #fff; font-size: 28px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    transition: all .3s ease; border: none; position: relative;
}
.wa-button:hover { animation: pulse-glow .6s ease-in-out; filter: brightness(1.1); }

.wa-indicator {
    position: absolute; top: -8px; right: -8px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: #fff; width: 28px; height: 28px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 12px; font-weight: bold; border: 3px solid #fff;
    animation: badge-pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(255,71,87,.4);
}

.wa-box {
    width: 290px; background: #fff; border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    position: absolute; bottom: 75px; right: 0;
    opacity: 0; transform: translateY(20px) scale(.95); pointer-events: none;
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
    max-height: 500px; overflow-y: auto;
}
.wa-box.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.wa-header {
    background: linear-gradient(135deg, #25D366 0%, #1fa85a 100%);
    color: #fff; padding: 14px 16px; border-radius: 12px 12px 0 0;
    font-weight: 600; font-size: 14px;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 10;
}
.wa-status-info { font-size: 11px; opacity: .9; font-weight: 400; }

.wa-item {
    display: flex; align-items: center; padding: 12px 14px;
    text-decoration: none; color: #333; border-bottom: 1px solid #f0f0f0;
    transition: all .2s ease; position: relative;
}
.wa-item:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }
.wa-item:hover { background: #f9f9f9; padding-left: 16px; }

/* Offline: desabilitado (sem pointer-events:none para o tooltip funcionar) */
.wa-item.offline,
.wa-item-disabled { opacity: .5; cursor: not-allowed; background: #fafafa; }
.wa-item.offline:hover,
.wa-item-disabled:hover { background: #fafafa; padding-left: 14px; }

.wa-item[title]:hover::after {
    content: attr(title);
    position: absolute; background: #333; color: #fff;
    padding: 6px 12px; border-radius: 4px; font-size: 11px; white-space: nowrap;
    bottom: 100%; left: 50%; transform: translateX(-50%);
    margin-bottom: 8px; z-index: 100; pointer-events: none;
}
.wa-item[title]:hover::before {
    content: ''; position: absolute; background: #333; width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid #333;
    bottom: 88%; left: 50%; transform: translateX(-50%);
    z-index: 100; pointer-events: none;
}

.wa-photo-wrapper { position: relative; margin-right: 12px; flex-shrink: 0; }
.wa-photo-wrapper img {
    width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
    border: 2px solid #f0f0f0; transition: transform .2s ease;
}
.wa-photo-placeholder {
    width: 44px; height: 44px; border-radius: 50%; background: #f0f0f0;
    display: flex; justify-content: center; align-items: center;
    color: #999; font-size: 20px;
}
.wa-item:hover .wa-photo-wrapper img { transform: scale(1.1); }

.wa-online-badge {
    position: absolute; bottom: 0; right: 0;
    width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff;
}
.wa-online-badge.online { background: #25D366; box-shadow: 0 0 8px rgba(37,211,102,.8); }
.wa-online-badge.offline { background: #999; }

.wa-item .wa-info { flex: 1; min-width: 0; }
.wa-item strong {
    display: block; font-weight: 600; color: #333; margin-bottom: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-item .wa-info .online,
.wa-item .wa-info .offline { font-size: 12px; font-weight: 500; }
.wa-item .wa-info .online { color: #25D366; }
.wa-item .wa-info .offline { color: #999; }

@media (max-width: 768px) {
    .wa-container { bottom: 15px; right: 15px; }
    .wa-button { width: 56px; height: 56px; font-size: 26px; }
    .wa-box { width: 270px; }
    .wa-indicator { width: 24px; height: 24px; font-size: 11px; top: -6px; right: -6px; }
}
@media (max-width: 480px) {
    .wa-box { width: calc(100vw - 50px); max-width: 300px; }
}
