/**
 * PNL S.A.C. - WhatsApp Floating Widget & Modal Popup Styles
 * Estilo clássico WhatsApp / NinjaTeam / WP-Notif com alta fidelidade visual
 */

.pnl-whatsapp-widget {
    position: fixed;
    z-index: 9999999;
    bottom: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.pnl-whatsapp-widget.pnl-wa-bottom-right {
    right: 24px;
}

.pnl-whatsapp-widget.pnl-wa-bottom-left {
    left: 24px;
}

/* ==========================================================================
   1. MODAL POPUP CONTAINER (ESTILO NINJATEAM / WP-NOTIF)
   ========================================================================== */
.pnl-wa-popup-box {
    position: absolute;
    bottom: 74px;
    width: 350px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.28s;
    z-index: 9999998;
}

.pnl-wa-bottom-left .pnl-wa-popup-box {
    left: 0;
    right: auto;
    transform-origin: bottom left;
}

.pnl-wa-bottom-right .pnl-wa-popup-box {
    right: 0;
    left: auto;
    transform-origin: bottom right;
}

.pnl-wa-popup-box.pnl-wa-popup-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header do Modal (Verde WhatsApp Clássico #2db742) */
.pnl-wa-popup-header {
    background: #2db742;
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    position: relative;
}

.pnl-wa-popup-header-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.pnl-wa-popup-header-icon svg {
    width: 32px;
    height: 32px;
}

.pnl-wa-popup-header-text {
    flex: 1;
    min-width: 0;
}

.pnl-wa-popup-title {
    margin: 0 0 3px 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: #ffffff !important;
}

.pnl-wa-popup-subtitle {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    color: rgba(255, 255, 255, 0.92) !important;
}

.pnl-wa-popup-close-header {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pnl-wa-popup-close-header:hover {
    opacity: 1;
}

/* Corpo do Modal & Lista de Atendentes */
.pnl-wa-popup-body {
    padding: 14px 16px 16px;
    background: #f8fafc;
}

.pnl-wa-popup-notice {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.4;
    padding: 0 4px;
}

.pnl-wa-agent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.pnl-wa-agent-item {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3.5px solid #2db742;
    border-radius: 8px;
    padding: 10px 12px;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pnl-wa-agent-item:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.pnl-wa-agent-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    margin-right: 12px;
}

.pnl-wa-agent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.pnl-wa-agent-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.pnl-wa-agent-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.pnl-wa-agent-info {
    flex: 1;
    min-width: 0;
}

.pnl-wa-agent-name {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.25 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pnl-wa-agent-role {
    margin: 2px 0 0 0 !important;
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pnl-wa-agent-action {
    margin-left: 8px;
}

.pnl-wa-agent-wa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #2db742;
}

.pnl-wa-agent-wa-icon svg {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   2. BALÃO DE CHAMADA (CALLOUT BADGE)
   ========================================================================== */
.pnl-wa-callout-badge {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    background: #ffffff;
    color: #1e293b;
    padding: 10px 32px 10px 14px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    animation: pnlFadeInUp 0.3s ease;
    z-index: 9999996;
}

.pnl-wa-bottom-left .pnl-wa-callout-badge {
    right: auto;
    left: 0;
}

.pnl-wa-callout-close {
    position: absolute;
    right: 8px;
    top: 6px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
}

.pnl-wa-callout-close:hover {
    color: #475569;
}

/* ==========================================================================
   3. BOTÃO FLUTUANTE PRINCIPAL & TRANSIÇÃO DE ÍCONE
   ========================================================================== */
.pnl-wa-button {
    display: flex;
    align-items: center;
    background: #25D366;
    color: #ffffff !important;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px 10px 14px;
    border-radius: 35px;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    user-select: none;
    text-decoration: none !important;
}

/* Modo Simples: Apenas a Bolinha / Ícone Redondo */
.pnl-wa-button.pnl-wa-button-simple {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
}

.pnl-wa-button.pnl-wa-button-simple .pnl-wa-icon-wrapper {
    margin-right: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.pnl-wa-button.pnl-wa-button-simple .pnl-wa-svg-icon {
    width: 34px !important;
    height: 34px !important;
}

.pnl-wa-button.pnl-wa-button-simple .pnl-wa-status-pulse {
    bottom: 5px !important;
    right: 5px !important;
    width: 12px !important;
    height: 12px !important;
}

.pnl-wa-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.6);
}

.pnl-wa-icon-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.pnl-wa-svg-icon {
    width: 30px;
    height: 30px;
}

.pnl-wa-icon-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
}

.pnl-wa-icon-close {
    position: absolute;
    font-size: 30px;
    line-height: 1;
    font-weight: 300;
    color: #ffffff;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
}

/* Estado Ativo: Ícone WhatsApp vira X */
.pnl-whatsapp-widget.pnl-wa-opened .pnl-wa-icon-wa {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.pnl-whatsapp-widget.pnl-wa-opened .pnl-wa-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.pnl-wa-status-pulse {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.pnl-wa-text-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.pnl-wa-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.pnl-wa-subtitle {
    font-size: 11px;
    opacity: 0.92;
    line-height: 1.2;
}

@keyframes pnlFadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. RESPONSIVIDADE MOBILE
   ========================================================================== */
@media (max-width: 600px) {
    .pnl-whatsapp-widget {
        bottom: 16px;
    }
    .pnl-whatsapp-widget.pnl-wa-bottom-right {
        right: 16px;
    }
    .pnl-whatsapp-widget.pnl-wa-bottom-left {
        left: 16px;
    }
    .pnl-wa-popup-box {
        bottom: 68px;
        width: calc(100vw - 32px);
    }
    .pnl-wa-text-content {
        display: none;
    }
    .pnl-wa-button {
        padding: 12px;
        border-radius: 50%;
        width: 54px;
        height: 54px;
        justify-content: center;
    }
    .pnl-wa-icon-wrapper {
        margin-right: 0;
    }
}

