/* Diam247 WhatsApp Support Pro - Frontend Styles */
:root {
    --wsp-green: #25D366;
    --wsp-dark-green: #128C7E;
    --wsp-accent: #25D366;
    --wsp-dark-bg: #075E54;
    --wsp-chat-bg: #efeae2;
    --wsp-white: #ffffff;
    --wsp-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

#wsp-whatsapp-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Positions */
#wsp-whatsapp-container.wsp-position-bottom-right {
    bottom: 24px;
    right: 24px;
}

#wsp-whatsapp-container.wsp-position-bottom-left {
    bottom: 24px;
    left: 24px;
}

#wsp-whatsapp-container.wsp-position-sticky-bar {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}

/* Launcher Pill Button */
.wsp-launcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--wsp-accent, var(--wsp-green));
    color: var(--wsp-white);
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    user-select: none;
}

.wsp-launcher-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
    background: #1ebc59;
}

.wsp-launcher-btn:active {
    transform: translateY(0) scale(0.98);
}

.wsp-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.wsp-launcher-label {
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.wsp-badge-count {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    margin-left: 2px;
    animation: wsp-bounce 2s infinite;
}

/* Pulse animation */
.has-pulse .wsp-pulse-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--wsp-accent, var(--wsp-green));
    border-radius: 50px;
    animation: wsp-pulse 2s infinite;
    pointer-events: none;
}

@keyframes wsp-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.15);
        opacity: 0;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes wsp-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    60% { transform: translateY(-2px); }
}

/* Sticky Footer Bar Mode */
#wsp-whatsapp-container.wsp-position-sticky-bar .wsp-launcher-btn {
    border-radius: 0;
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 16px;
}

/* Chat Card Popup */
.wsp-chat-card {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--wsp-white);
    border-radius: 16px;
    box-shadow: var(--wsp-shadow);
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#wsp-whatsapp-container.wsp-position-bottom-left .wsp-chat-card {
    right: auto;
    left: 0;
}

.wsp-chat-card.wsp-open {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Header */
.wsp-chat-header {
    background: var(--wsp-accent, var(--wsp-dark-bg));
    color: var(--wsp-white);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.wsp-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.wsp-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsp-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid var(--wsp-white);
    border-radius: 50%;
}

.wsp-header-info {
    flex: 1;
}

.wsp-agent-name {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wsp-verified-badge {
    background: #3b82f6;
    color: #fff;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.wsp-agent-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.wsp-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wsp-close-btn:hover {
    opacity: 1;
}

/* Body */
.wsp-chat-body {
    background: var(--wsp-chat-bg);
    background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 0);
    background-size: 16px 16px;
    padding: 20px;
    min-height: 140px;
}

.wsp-msg-bubble {
    background: var(--wsp-white);
    border-radius: 0 12px 12px 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    position: relative;
    max-width: 90%;
}

.wsp-msg-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid var(--wsp-white);
    border-left: 8px solid transparent;
}

.wsp-msg-sender {
    font-size: 11px;
    font-weight: 700;
    color: var(--wsp-dark-green);
    margin-bottom: 4px;
}

.wsp-msg-text {
    font-size: 13.5px;
    line-height: 1.45;
    color: #1f2937;
}

.wsp-msg-time {
    font-size: 10px;
    color: #9ca3af;
    text-align: right;
    margin-top: 6px;
}

/* Footer & CTA */
.wsp-chat-footer {
    padding: 16px 20px;
    background: var(--wsp-white);
    border-top: 1px solid #f3f4f6;
}

.wsp-start-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--wsp-accent, var(--wsp-green));
    color: var(--wsp-white) !important;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
    transition: all 0.2s ease;
}

.wsp-start-chat-btn:hover {
    background: #1ebc59;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

/* Custom button style for shortcode [whatsapp_button] */
.wsp-custom-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wsp-accent, var(--wsp-green));
    color: #fff !important;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.wsp-custom-button:hover {
    background: #1ebc59;
    transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #wsp-whatsapp-container.wsp-position-bottom-right {
        bottom: 16px;
        right: 16px;
    }
    
    #wsp-whatsapp-container.wsp-position-bottom-left {
        bottom: 16px;
        left: 16px;
    }

    .wsp-chat-card {
        width: calc(100vw - 32px);
        bottom: 70px;
    }
}
