/**
 * PURFEQU CS WhatsApp - Frontend Styles
 */

/* ===== Floating Widget Container ===== */
.purfequ-cs-widget {
    position: fixed;
    z-index: 99998;
    font-family: 'Poppins', -apple-system, sans-serif;
}
.purfequ-cs-bottom-right {
    bottom: 20px;
    right: 20px;
}
.purfequ-cs-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* ===== Floating Action Button (FAB) ===== */
.purfequ-cs-fab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px 14px 18px;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    font-family: inherit;
}
.purfequ-cs-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}
.purfequ-cs-fab svg {
    flex-shrink: 0;
}
.purfequ-cs-fab-text {
    white-space: nowrap;
}

/* Pulse animation */
.purfequ-cs-fab-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: #ff3b30;
    border: 2px solid white;
    border-radius: 50%;
    animation: purfequ-cs-pulse 2s infinite;
}
@keyframes purfequ-cs-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* Hide pulse after popup opened (set via JS) */
.purfequ-cs-widget.is-open .purfequ-cs-fab-badge {
    display: none;
}

/* ===== Popup ===== */
.purfequ-cs-popup {
    position: absolute;
    bottom: 75px;
    width: 340px;
    max-height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: purfequ-cs-slideUp 0.3s ease;
}

.purfequ-cs-bottom-right .purfequ-cs-popup {
    right: 0;
}
.purfequ-cs-bottom-left .purfequ-cs-popup {
    left: 0;
}

.purfequ-cs-widget.is-open .purfequ-cs-popup {
    display: flex;
}

@keyframes purfequ-cs-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Popup Header (green like WhatsApp) */
.purfequ-cs-popup-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.purfequ-cs-greeting h3 {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
}
.purfequ-cs-greeting p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}
.purfequ-cs-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    line-height: 1;
}
.purfequ-cs-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Popup Body (scrollable) */
.purfequ-cs-popup-body {
    overflow-y: auto;
    max-height: 400px;
    background: #f7f9fb;
}

/* Agent List */
.purfequ-cs-agents {
    display: flex;
    flex-direction: column;
}
.purfequ-cs-agent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #ebeef2;
    transition: background 0.2s;
    cursor: pointer;
}
.purfequ-cs-agent:last-child {
    border-bottom: none;
}
.purfequ-cs-agent:hover {
    background: white;
    color: #333;
}
.purfequ-cs-agent-photo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
}
.purfequ-cs-agent-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.purfequ-cs-photo-placeholder {
    color: white;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
}
.purfequ-cs-agent-info {
    flex: 1;
    min-width: 0;
}
.purfequ-cs-agent-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.2;
}
.purfequ-cs-agent-area {
    font-size: 12px;
    color: #667;
    line-height: 1.3;
}
.purfequ-cs-agent-action {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.purfequ-cs-agent:hover .purfequ-cs-agent-action {
    opacity: 1;
}

/* ===== Inline Shortcode (CS list in page) ===== */
.purfequ-cs-inline {
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f7f9fb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.purfequ-cs-inline .purfequ-cs-agents {
    background: white;
}
.purfequ-cs-inline .purfequ-cs-agent {
    padding: 16px 20px;
}

/* Grid layout for shortcode */
.purfequ-cs-layout-grid .purfequ-cs-agents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    padding: 16px;
    background: transparent;
}
.purfequ-cs-layout-grid .purfequ-cs-agent {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.purfequ-cs-layout-grid .purfequ-cs-agent:hover {
    border-color: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.15);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    .purfequ-cs-bottom-right {
        bottom: 16px;
        right: 16px;
    }
    .purfequ-cs-bottom-left {
        bottom: 16px;
        left: 16px;
    }
    .purfequ-cs-fab {
        padding: 12px 18px 12px 14px;
        font-size: 14px;
    }
    .purfequ-cs-fab-text {
        display: none; /* Icon-only on mobile */
    }
    .purfequ-cs-fab {
        padding: 14px;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
    }
    .purfequ-cs-popup {
        width: calc(100vw - 32px);
        max-width: 360px;
        bottom: 80px;
    }
    .purfequ-cs-bottom-right .purfequ-cs-popup {
        right: 0;
    }
    .purfequ-cs-bottom-left .purfequ-cs-popup {
        left: 0;
    }
}

/* Scrollbar styling */
.purfequ-cs-popup-body::-webkit-scrollbar {
    width: 6px;
}
.purfequ-cs-popup-body::-webkit-scrollbar-track {
    background: #ebeef2;
}
.purfequ-cs-popup-body::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 3px;
}
