/* WhatsApp Floating Button Styles */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px; /* Increased from 20px to position above AI button */
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

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

.whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Pulse animation */
.whatsapp-float::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: pulse 2s infinite;
    opacity: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Chat Widget Styles */
.whatsapp-chat {
    position: fixed;
    bottom: 160px; /* Increased from 90px to account for button position */
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.whatsapp-chat.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.chat-header {
    background: #075e54;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chat-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin: 2px 0 0 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-body {
    padding: 20px;
    background: #e5ddd5;
    min-height: 200px;
    position: relative;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></svg>');
}

.chat-time {
    text-align: center;
    color: #667781;
    font-size: 12px;
    margin-bottom: 16px;
}

.message {
    margin-bottom: 12px;
    max-width: 80%;
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
    margin-left: auto;
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
    word-wrap: break-word;
}

.message.received .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #667781;
    text-align: right;
    margin-top: 4px;
}

.chat-footer {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.message-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 80px;
    overflow-y: auto;
}

.message-input:focus {
    border-color: #25d366;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #128c7e;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.start-chat-btn {
    width: 100%;
    background: #25d366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.start-chat-btn:hover {
    background: #128c7e;
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-chat {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 150px; /* Adjusted from 80px */
    }
    
    .whatsapp-float {
        right: 10px;
        bottom: 80px; /* Adjusted from 10px */
    }
}