/* ============================================
   WA Chat Multi - Frontend CSS
   ============================================ */

/* Widget Container */
.wa-chat-multi-widget {
    position: fixed;
    bottom: 90px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Floating Button */
.wa-chat-multi-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.wa-chat-multi-btn:hover {
    transform: scale(1.1) !important;
}

.wa-chat-multi-btn:active {
    transform: scale(0.95) !important;
}

.wa-chat-multi-btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.wa-chat-multi-btn-icon svg {
    width: 100%;
    height: 100%;
}

/* Badge */
.wa-chat-multi-btn-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    animation: wa-chat-multi-badge-pop 0.3s ease;
}

/* Pulse Animation */
.wa-chat-multi-pulse {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #ff3b30;
    border-radius: 50%;
    border: 2px solid #fff;
}

.wa-chat-multi-pulse::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.4);
    animation: wa-chat-multi-pulse-anim 2s infinite;
}

.wa-chat-multi-widget.open .wa-chat-multi-pulse {
    display: none;
}

/* Popup - positioning handled by JS + inline CSS */
.wa-chat-multi-popup {
    position: absolute;
    bottom: 76px;
    width: 360px;
    max-height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-chat-multi-popup.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Popup Header */
.wa-chat-multi-popup-header {
    padding: 20px;
    color: #fff;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wa-chat-multi-popup-header-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.wa-chat-multi-popup-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wa-chat-multi-popup-wa-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.wa-chat-multi-popup-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.wa-chat-multi-popup-greeting {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.wa-chat-multi-popup-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.wa-chat-multi-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Popup Body */
.wa-chat-multi-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 320px;
}

.wa-chat-multi-popup-body::-webkit-scrollbar {
    width: 4px;
}

.wa-chat-multi-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.wa-chat-multi-popup-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Agent Card */
.wa-chat-multi-agent-card {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    gap: 12px;
    opacity: 0;
    animation: wa-chat-multi-card-in 0.4s ease forwards;
}

.wa-chat-multi-agent-card:hover {
    background: #f0fdf4;
    border-color: rgba(37, 211, 102, 0.2);
    box-shadow: 0 2px 12px rgba(37, 211, 102, 0.1);
    transform: translateX(-2px);
}

.wa-chat-multi-agent-card:active {
    transform: scale(0.98);
}

/* Card Avatar */
.wa-chat-multi-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0fdf4;
}

.wa-chat-multi-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wa-chat-multi-card-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #25D366;
    background: linear-gradient(135deg, #e8f5e9, #f0fdf4);
}

/* Card Info */
.wa-chat-multi-card-info {
    flex: 1;
    min-width: 0;
}

.wa-chat-multi-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-chat-multi-card-subname {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card WA Icon */
.wa-chat-multi-card-wa-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.wa-chat-multi-card-wa-icon:hover {
    transform: scale(1.1);
}

/* Popup Footer */
.wa-chat-multi-popup-footer {
    padding: 10px 20px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes wa-chat-multi-badge-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes wa-chat-multi-pulse-anim {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes wa-chat-multi-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wa-chat-multi-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.wa-chat-multi-widget:not(.open) .wa-chat-multi-btn {
    animation: wa-chat-multi-float 3s ease-in-out infinite;
}

.wa-chat-multi-widget.open .wa-chat-multi-btn {
    animation: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet kecil */
@media (max-width: 520px) {
    .wa-chat-multi-popup {
        max-height: 420px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .wa-chat-multi-popup {
        max-height: 400px;
    }

    .wa-chat-multi-btn {
        width: 56px;
        height: 56px;
    }

    .wa-chat-multi-btn-icon {
        width: 28px;
        height: 28px;
    }

    .wa-chat-multi-popup-body {
        max-height: 260px;
    }
}

/* Mobile kecil */
@media (max-width: 360px) {
    .wa-chat-multi-popup {
        max-height: 380px;
    }

    .wa-chat-multi-popup-body {
        max-height: 220px;
    }

    .wa-chat-multi-popup-header {
        padding: 14px;
    }

    .wa-chat-multi-card-avatar {
        width: 40px;
        height: 40px;
    }

    .wa-chat-multi-card-info .wa-chat-multi-card-name {
        font-size: 14px;
    }

    .wa-chat-multi-popup-footer {
        padding: 8px 14px;
    }
}


