/* ========================================
   WhatsApp Floating Chat Widget Styles
   ======================================== */

/* Floating Button */
.whatsapp-float-btn {
    position: fixed;
    bottom: 24px !important;
    right: 24px !important;
    width: 60px !important;
    height: 60px !important;
    background-color: #25D366 !important;
    border-radius: 50% !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    /* Max z-index */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 !important;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
}

.whatsapp-icon {
    width: 32px !important;
    height: 32px !important;
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
}

/* Tooltip */
.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    background-color: #1F2937;
    color: #FFFFFF;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.whatsapp-float-btn:hover .whatsapp-tooltip {
    opacity: 1;
}

/* Chat Popup Container */
.whatsapp-chat-popup {
    position: fixed;
    bottom: 100px !important;
    right: 24px !important;
    width: 380px !important;
    max-width: calc(100vw - 48px);
    max-height: 600px;
    background-color: #FFFFFF;
    border-radius: 12px !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 2147483647 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.whatsapp-chat-popup.show {
    opacity: 1;
    transform: translateY(0);
}

/* Chat Header */
.whatsapp-chat-header {
    background-color: #008069 !important;
    /* Authentic Dark Green */
    color: #FFFFFF !important;
    padding: 16px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.whatsapp-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-avatar {
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.whatsapp-avatar svg {
    width: 100%;
    height: 100%;
    fill: #dcf8c6;
}

.whatsapp-header-info {
    flex: 1;
}

.whatsapp-business-name {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.2 !important;
    color: #FFFFFF !important;
}

.whatsapp-phone {
    font-size: 0.85rem !important;
    margin: 0 !important;
    opacity: 0.9;
    line-height: 1.2 !important;
    color: #FFFFFF !important;
    font-weight: 400 !important;
}

.whatsapp-status {
    font-size: 0.75rem !important;
    margin: 0 !important;
    opacity: 0.8;
    line-height: 1.2 !important;
    color: #FFFFFF !important;
}

.whatsapp-close-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #FFFFFF !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    padding: 0 !important;
}

.whatsapp-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.whatsapp-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Chat Body */
.whatsapp-chat-body {
    flex: 1;
    padding: 20px !important;
    background-color: #E5DDD5 !important;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    overflow-y: auto;
    min-height: 250px;
    max-height: 450px;
}

.whatsapp-message {
    max-width: 85%;
    margin-bottom: 8px !important;
    padding: 6px 10px 8px 10px !important;
    border-radius: 8px !important;
    position: relative;
    animation: messageSlideIn 0.3s ease;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13) !important;
}

.whatsapp-message-received {
    background-color: #FFFFFF !important;
    align-self: flex-start;
    border-top-left-radius: 0 !important;
}

.whatsapp-message-sent {
    background-color: #D9FDD3 !important;
    align-self: flex-end;
    margin-left: auto;
    border-top-right-radius: 0 !important;
}

.whatsapp-message p {
    margin: 0 0 4px 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    color: #111b21 !important;
}

.whatsapp-message-time {
    font-size: 0.7rem !important;
    color: #667781 !important;
    display: block;
    text-align: right;
    margin-top: 2px !important;
}

/* Input Area */
.whatsapp-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px !important;
    background-color: #F0F2F5 !important;
    border-top: 1px solid #E5E7EB;
}

.whatsapp-input-field {
    flex: 1;
    padding: 9px 12px !important;
    border: 1px solid #ffffff !important;
    border-radius: 8px !important;
    background-color: #FFFFFF !important;
    font-size: 0.95rem !important;
    outline: none;
    color: #000000 !important;
}

.whatsapp-send-btn {
    width: 40px !important;
    height: 40px !important;
    background-color: transparent !important;
    border: none !important;
    color: #008069 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0 !important;
}

.whatsapp-send-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-chat-popup {
        width: calc(100vw - 32px) !important;
        bottom: 85px !important;
        right: 16px !important;
        left: auto;
    }

    .whatsapp-float-btn {
        bottom: 20px !important;
        right: 16px !important;
    }
}

/* Hide Theme Scroll to Top Button to prevent overlap */
#ast-scroll-top,
.ast-scroll-top-right {
    display: none !important;
}