/* WhatsApp Bot Frontend Styles */

.wa-widget {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wa-widget-right { right: 20px; }
.wa-widget-left { left: 20px; }

.wa-widget-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
}

.wa-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.wa-widget-status {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff4444;
}

.wa-widget-status.online {
    background-color: #4CAF50;
}

.wa-widget-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.wa-widget-header {
    background-color: #25D366;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.wa-widget-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.wa-chat-messages {
    margin-bottom: 20px;
}

.wa-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.wa-message-bot .wa-message-content {
    background-color: #f1f1f1;
    padding: 12px 16px;
    border-radius: 18px;
    align-self: flex-start;
    max-width: 80%;
}

.wa-message-user .wa-message-content {
    background-color: #25D366;
    color: white;
    padding: 12px 16px;
    border-radius: 18px;
    align-self: flex-end;
    max-width: 80%;
}

.wa-message-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.wa-message-user .wa-message-time {
    text-align: left;
}

.wa-offline-message {
    text-align: center;
    color: #666;
    font-style: italic;
}

.wa-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.wa-quick-reply-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wa-quick-reply-btn:hover {
    background-color: #e9ecef;
}

.wa-message-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#wa-message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    outline: none;
}

#wa-send-message {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wa-widget-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    text-align: center;
}

.wa-start-whatsapp {
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wa-start-whatsapp:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .wa-widget-chat {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
}

/* Animation for widget appearance */
@keyframes wa-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.wa-widget-chat.show {
    display: flex;
    animation: wa-fadeIn 0.3s ease-out;
}

/* Phone Registration */
.wa-phone-registration {
    padding: 30px 20px;
    text-align: center;
}

.wa-registration-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.wa-registration-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wa-phone-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.wa-phone-input:focus {
    outline: none;
    border-color: #25D366;
}

.wa-phone-submit {
    width: 100%;
    padding: 12px 20px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.wa-phone-submit:hover {
    background: #128C7E;
}

.wa-registration-error {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    background: #ffebee;
    border-radius: 4px;
}

/* Typing indicator */
.wa-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background-color: #f1f1f1;
    border-radius: 18px;
    align-self: flex-start;
    max-width: 80%;
    margin-bottom: 15px;
}

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

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

@keyframes wa-typing {
    0%, 60%, 100% { transform: scale(1); opacity: 0.5; }
    30% { transform: scale(1.2); opacity: 1; }
}
