/* =====================================================
   WHATSAPP WIDGET STYLES
===================================================== */

.whatsapp-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Toggle Button */
.whatsapp-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite, float 3s ease-in-out infinite;
    position: relative;
}

.whatsapp-toggle-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.2);
    animation: expand 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(37, 211, 102, 0.8);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

@keyframes expand {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.whatsapp-toggle-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.8);
}

.whatsapp-toggle-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
    position: relative;
    z-index: 1;
}

.whatsapp-toggle-btn.active svg {
    display: none;
}

/* Chat Window */
.whatsapp-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.whatsapp-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chat Header */
.whatsapp-chat-header {
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.whatsapp-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.whatsapp-chat-header p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.whatsapp-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messages Container */
.whatsapp-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Styles */
.whatsapp-message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-message.user {
    justify-content: flex-end;
}

.whatsapp-message-content {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.whatsapp-message.bot .whatsapp-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.whatsapp-message.user .whatsapp-message-content {
    background: #25D366;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Input Section */
.whatsapp-input-section {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.whatsapp-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.whatsapp-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.whatsapp-input:focus {
    border-color: #25D366;
}

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

.whatsapp-send-btn:hover:not(:disabled) {
    background: #20BA5A;
}

.whatsapp-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick Reply Buttons */
.whatsapp-quick-replies {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whatsapp-quick-reply-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all 0.2s;
}

.whatsapp-quick-reply-btn:hover {
    background: #e8e8e8;
    border-color: #25D366;
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-chat-window {
        width: calc(100vw - 32px);
        height: 70vh;
        max-height: 500px;
    }

    .whatsapp-widget-container {
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-toggle-btn {
        width: 56px;
        height: 56px;
    }

    .whatsapp-toggle-btn svg {
        width: 28px;
        height: 28px;
    }
}

/* Scrollbar Style */
.whatsapp-messages::-webkit-scrollbar {
    width: 6px;
}

.whatsapp-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.whatsapp-messages::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 3px;
}

.whatsapp-messages::-webkit-scrollbar-thumb:hover {
    background: #20BA5A;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Badge - Status */
.whatsapp-status-badge {
    display: inline-block;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
    opacity: 0.7;
}

/* Services Container */
.whatsapp-services-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.whatsapp-service-item {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
    transition: all 0.2s ease;
}

.whatsapp-service-item:hover {
    border-color: #25D366;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.1);
}

.whatsapp-service-icon {
    font-size: 24px;
    min-width: 28px;
    text-align: center;
}

.whatsapp-service-content {
    flex: 1;
}

.whatsapp-service-name {
    font-weight: 600;
    font-size: 14px;
    color: #25D366;
    margin: 0 0 4px 0;
}

.whatsapp-service-desc {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}
