/* Shengli WhatsApp Smart CS - Frontend Widget Styles */

.slwcs-widget {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: ltr;
}

.slwcs-position-right {
    right: 24px;
}

.slwcs-position-left {
    left: 24px;
}

/* Floating Button */
.slwcs-float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.slwcs-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.slwcs-float-btn:active {
    transform: scale(0.95);
}

.slwcs-icon-wa {
    pointer-events: none;
}

/* Notification Badge */
.slwcs-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f44336;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    z-index: 3;
    animation: slwcs-pulse 2s infinite;
}

@keyframes slwcs-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Popup Panel */
.slwcs-popup {
    position: absolute;
    bottom: 76px;
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slwcs-slideUp 0.3s ease;
}

.slwcs-position-left .slwcs-popup {
    left: 0;
}

.slwcs-position-right .slwcs-popup {
    right: 0;
}

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

/* Popup Header */
.slwcs-popup-header {
    display: flex;
    align-items: center;
    padding: 16px;
    color: #fff;
    gap: 12px;
}

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

.slwcs-header-info {
    flex: 1;
    min-width: 0;
}

.slwcs-header-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slwcs-header-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.slwcs-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

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

/* Popup Body */
.slwcs-popup-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cfc6' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Chat Bubble */
.slwcs-chat-bubble {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.slwcs-bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.slwcs-bubble-text {
    background: #fff;
    padding: 10px 14px;
    border-radius: 0 8px 8px 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    max-width: 280px;
    word-break: break-word;
}

/* Encryption notice */
.slwcs-popup-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: #666;
}

/* Popup Footer */
.slwcs-popup-footer {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
}

.slwcs-start-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.slwcs-start-chat-btn:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

/* Product Inquiry Buttons */
.slwcs-product-inquiry {
    margin-top: 12px;
    margin-bottom: 12px;
}

.slwcs-inquiry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #25D366;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.slwcs-inquiry-btn:hover {
    background: #1ebc59;
    color: #fff;
    text-decoration: none;
}

.slwcs-inquiry-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.slwcs-sticky-inquiry {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 999998;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .slwcs-popup {
        width: calc(100vw - 32px);
        max-height: 60vh;
        bottom: 76px;
    }

    .slwcs-position-right .slwcs-popup {
        right: -8px;
    }

    .slwcs-position-left .slwcs-popup {
        left: -8px;
    }

    .slwcs-float-btn {
        width: 52px;
        height: 52px;
    }

    .slwcs-bubble-text {
        max-width: 220px;
    }
}
