/* WP WhatsApp Support Frontend CSS */

#wws-widget-wrapper {
    position: fixed;
    bottom: 25px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

#wws-widget-wrapper * {
    box-sizing: border-box;
}

/* Positions */
#wws-widget-wrapper.wws-pos-right {
    right: 25px;
}

#wws-widget-wrapper.wws-pos-left {
    left: 25px;
}

/* Floating WhatsApp Trigger Button */
#wws-trigger-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wws-primary-color, #25D366);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    outline: none;
    position: relative;
    z-index: 1000000;
}

#wws-trigger-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

#wws-trigger-btn.wws-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: var(--wws-primary-color, #25D366);
    opacity: 0.6;
    animation: wws-pulse-glow 2s infinite ease-out;
    z-index: -1;
}

@keyframes wws-pulse-glow {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Chat Window Popup Card */
#wws-chat-window {
    position: absolute;
    bottom: 75px;
    width: 360px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 1000000;
}

#wws-widget-wrapper.wws-pos-right #wws-chat-window {
    right: 0;
    left: auto;
    transform-origin: bottom right;
}

#wws-widget-wrapper.wws-pos-left #wws-chat-window {
    left: 0;
    right: auto;
    transform-origin: bottom left;
}

#wws-chat-window.wws-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

/* Header */
.wws-header {
    background: var(--wws-header-bg, #075E54);
    color: var(--wws-text-color, #FFFFFF);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wws-header-info {
    display: flex;
    flex-direction: column;
}

.wws-header-info .wws-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.wws-header-info .wws-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}

#wws-close-btn {
    background: transparent;
    border: none;
    color: var(--wws-text-color, #FFFFFF);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

#wws-close-btn:hover {
    opacity: 1;
}

/* Agent Details Bar */
.wws-agent-card {
    background: #f4f6f8;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eaeaea;
}

.wws-avatar-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.wws-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wws-online-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background: #25D366;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.wws-agent-details {
    display: flex;
    flex-direction: column;
}

.wws-agent-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.wws-agent-title {
    font-size: 12px;
    color: #666666;
}

/* Chat Body */
.wws-body {
    padding: 20px;
    background: #efeae2;
    background-image: radial-gradient(#d5cecd 1px, transparent 1px);
    background-size: 16px 16px;
    min-height: 120px;
    max-height: 320px;
    overflow-y: auto;
    flex: 1;
}

.wws-message-bubble {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: 0 12px 12px 12px;
    max-width: 90%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.wws-message-bubble p {
    margin: 0;
    font-size: 13.5px;
    color: #303030;
    line-height: 1.45;
}

.wws-message-bubble .wws-time {
    display: block;
    text-align: right;
    font-size: 10px;
    color: #888888;
    margin-top: 4px;
}

/* Chat Footer / Form */
.wws-footer {
    padding: 14px 16px;
    background: #ffffff;
    border-top: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wws-input-container textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.wws-input-container textarea:focus {
    border-color: var(--wws-primary-color, #25D366);
}

#wws-send-btn {
    background: var(--wws-primary-color, #25D366);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.2s ease, transform 0.1s ease;
}

#wws-send-btn:hover {
    filter: brightness(0.92);
}

#wws-send-btn:active {
    transform: scale(0.98);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #wws-widget-wrapper.wws-pos-right {
        right: 15px;
        bottom: 15px;
    }

    #wws-widget-wrapper.wws-pos-left {
        left: 15px;
        bottom: 15px;
    }

    #wws-chat-window {
        width: calc(100vw - 30px);
        bottom: 70px;
    }
}
