/* WhatsApp AI Chat Widget Styles */
.wa-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.wa-widget[data-position="bottom-right"] {
    bottom: 20px;
    right: 20px;
}

.wa-widget[data-position="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

.wa-widget[data-position="top-right"] {
    top: 20px;
    right: 20px;
}

.wa-widget[data-position="top-left"] {
    top: 20px;
    left: 20px;
}

/* Chat Button */
.wa-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.wa-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.wa-chat-button:active {
    transform: scale(0.95);
}

.wa-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Lead Form */
.wa-lead-form {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.wa-form-body {
    padding: 20px;
    background: white;
}

.wa-form-group {
    margin-bottom: 16px;
}

.wa-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #111;
}

.wa-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e9edef;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wa-form-group input:focus {
    border-color: #25D366;
}

.wa-form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #667781;
}

.wa-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wa-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wa-submit-btn:active {
    transform: translateY(0);
}

.wa-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Chat Window */
.wa-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

/* Header */
.wa-chat-header {
    padding: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.wa-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wa-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
}

.wa-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.wa-status.online .wa-status-dot {
    background: #4ade80;
    animation: blink 2s infinite;
}

.wa-status.offline .wa-status-dot {
    background: #94a3b8;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.wa-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

/* Chat Body */
.wa-chat-body {
    flex: 1;
    padding: 16px;
    background: #f0f2f5;
    overflow-y: auto;
    max-height: 400px;
    min-height: 300px;
}

.wa-message {
    margin-bottom: 12px;
    display: flex;
}

.wa-message-received {
    justify-content: flex-start;
}

.wa-message-sent {
    justify-content: flex-end;
}

.wa-message-content {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
}

.wa-message-received .wa-message-content {
    background: white;
    border-bottom-left-radius: 2px;
}

.wa-message-sent .wa-message-content {
    background: #dcf8c6;
    border-bottom-right-radius: 2px;
}

.wa-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #111;
}

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

/* Chat Footer */
.wa-chat-footer {
    padding: 12px;
    background: white;
    border-top: 1px solid #e9edef;
    display: flex;
    gap: 8px;
}

.wa-chat-footer input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e9edef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wa-chat-footer input:focus {
    border-color: #25D366;
}

.wa-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wa-send-btn:hover {
    transform: scale(1.05);
}

.wa-send-btn:active {
    transform: scale(0.95);
}

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

/* Powered by */
.wa-powered-by {
    padding: 8px 12px;
    text-align: center;
    font-size: 11px;
    color: #667781;
    background: #f0f2f5;
    border-top: 1px solid #e9edef;
}

.wa-powered-by strong {
    color: #25D366;
}

/* Typing Indicator */
.wa-typing {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

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

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

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

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .wa-chat-window {
        width: calc(100vw - 40px);
        bottom: 70px;
    }
    
    .wa-chat-button {
        width: 56px;
        height: 56px;
    }
}

/* Scrollbar */
.wa-chat-body::-webkit-scrollbar {
    width: 6px;
}

.wa-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.wa-chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.wa-chat-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Hybrid Mode Styles */
.wa-hybrid-contact {
    animation: fadeIn 0.5s ease forwards;
}

.wa-hybrid-btn {
    transition: all 0.3s ease;
}

.wa-hybrid-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3) !important;
}

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

/* Ensure link button has no underline */
a.wa-chat-button {
    text-decoration: none;
}
