/* ==========================================================================
   WhatsApp Chat Widget - Frontend Styles
   ========================================================================== */

:root {
    --mpf-wa-z: 99999;
    --mpf-wa-radius: 12px;
    --mpf-wa-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    --mpf-wa-transition: 0.25s ease;
    --mpf-wa-color: #25d366;
}

.mpf-wa-wrap {
    position: fixed;
    bottom: 24px;
    z-index: var(--mpf-wa-z);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.mpf-wa-right {
    right: 24px;
}

.mpf-wa-left {
    left: 24px;
}

/* ==========================================================================
   Floating Action Button
   ========================================================================== */

.mpf-wa-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--mpf-wa-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(37, 211, 102, 0.4);
    transition: transform var(--mpf-wa-transition), box-shadow var(--mpf-wa-transition);
    position: relative;
    padding: 0;
}

.mpf-wa-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.5);
}

.mpf-wa-fab:active {
    transform: scale(0.95);
}

.mpf-wa-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.mpf-wa-fab .mpf-wa-icon {
    width: 28px;
    height: 28px;
}

/* Pulse animation */
.mpf-wa-fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--mpf-wa-color);
    opacity: 0;
    animation: mpf-wa-pulse 2s infinite;
    z-index: -1;
}

@keyframes mpf-wa-pulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ==========================================================================
   Popup
   ========================================================================== */

.mpf-wa-popup {
    position: absolute;
    bottom: 68px;
    width: 320px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: var(--mpf-wa-radius);
    box-shadow: var(--mpf-wa-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: opacity var(--mpf-wa-transition), transform var(--mpf-wa-transition), visibility var(--mpf-wa-transition);
    overflow: hidden;
}

.mpf-wa-right .mpf-wa-popup {
    right: 0;
}

.mpf-wa-left .mpf-wa-popup {
    left: 0;
}

.mpf-wa-popup.mpf-wa-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   Popup Header
   ========================================================================== */

.mpf-wa-popup-header {
    background: var(--mpf-wa-color);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mpf-wa-popup-title {
    font-size: 15px;
    font-weight: 600;
}

.mpf-wa-popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.8;
    transition: opacity var(--mpf-wa-transition);
}

.mpf-wa-popup-close:hover {
    opacity: 1;
}

/* ==========================================================================
   Popup Body
   ========================================================================== */

.mpf-wa-popup-body {
    padding: 12px 16px 16px;
    max-height: 360px;
    overflow-y: auto;
}

.mpf-wa-popup-greeting {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* ==========================================================================
   Agent Card
   ========================================================================== */

.mpf-wa-agent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--mpf-wa-transition);
    text-decoration: none;
    color: inherit;
    margin-bottom: 6px;
}

.mpf-wa-agent:last-child {
    margin-bottom: 0;
}

.mpf-wa-agent:hover {
    background: #f3f4f6;
}

.mpf-wa-agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--mpf-wa-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.mpf-wa-agent-info {
    flex: 1;
    min-width: 0;
}

.mpf-wa-agent-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.mpf-wa-agent-title {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}

.mpf-wa-agent-greeting {
    font-size: 13px;
    color: #4b5563;
    margin-top: 4px;
    line-height: 1.4;
}

/* ==========================================================================
   Agent Status (Online / Offline)
   ========================================================================== */

.mpf-wa-agent-status {
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.mpf-wa-agent-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.mpf-wa-agent-status.mpf-wa-online::before {
    background: #22c55e;
}

.mpf-wa-agent-status.mpf-wa-online {
    color: #16a34a;
}

.mpf-wa-agent-status.mpf-wa-offline::before {
    background: #ef4444;
}

.mpf-wa-agent-status.mpf-wa-offline {
    color: #dc2626;
}

/* ==========================================================================
   GDPR Checkbox
   ========================================================================== */

.mpf-wa-gdpr {
    display: none;
    padding: 8px 16px 12px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.mpf-wa-gdpr.mpf-wa-gdpr-show {
    display: block;
}

.mpf-wa-gdpr label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1.4;
}

.mpf-wa-gdpr input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ==========================================================================
   WooCommerce Button
   ========================================================================== */

.mpf-wa-woo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--mpf-wa-color);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: opacity var(--mpf-wa-transition), transform var(--mpf-wa-transition);
    margin-top: 10px;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
}

.mpf-wa-woo-btn:hover {
    opacity: 0.9;
    color: #fff !important;
    transform: translateY(-1px);
}

.mpf-wa-icon-sm {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   Shortcode Button
   ========================================================================== */

.mpf-wa-shortcode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mpf-wa-color);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: opacity var(--mpf-wa-transition);
    line-height: 1.5;
}

.mpf-wa-shortcode-btn:hover {
    opacity: 0.9;
    color: #fff !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .mpf-wa-wrap {
        bottom: 16px;
    }

    .mpf-wa-right {
        right: 16px;
    }

    .mpf-wa-left {
        left: 16px;
    }

    .mpf-wa-fab {
        width: 50px;
        height: 50px;
    }

    .mpf-wa-fab .mpf-wa-icon {
        width: 24px;
        height: 24px;
    }

    .mpf-wa-popup {
        width: 290px;
        bottom: 60px;
    }

    .mpf-wa-popup-body {
        max-height: 300px;
    }
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .mpf-wa-fab,
    .mpf-wa-fab::before,
    .mpf-wa-popup,
    .mpf-wa-woo-btn,
    .mpf-wa-shortcode-btn {
        transition: none;
        animation: none;
    }
}