/* CSS Variables for easy customization */
:root {
    --wa-green: #25D366;
    --wa-dark-green: #128C7E;
    --wa-light-green: #DCF8C6;
    --chat-bg: #f0f2f5;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --primary-text: #333;
    --secondary-text: #666;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Floating Button */
.wa-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--wa-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-floating-btn:hover {
    transform: scale(1.1);
}

.wa-floating-btn svg {
    width: 35px;
    height: 35px;
    fill: white;
}

/* Pulse Animation */
.wa-floating-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--wa-green);
    border-radius: 50%;
    opacity: 0.6;
    z-index: -1;
    animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Chat Window */
.wa-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.wa-chat-window.active {
    transform: scale(1);
    opacity: 1;
}

/* Chat Header */
.wa-chat-header {
    background: var(--wa-dark-green);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wa-chat-header .bot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--wa-dark-green);
    position: relative;
    overflow: hidden;
}

.wa-chat-header .bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wa-chat-header .bot-info h4 {
    margin: 0;
    font-size: 1.1rem;
}

.wa-chat-header .bot-info p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.wa-chat-header .status-dot {
    width: 10px;
    height: 10px;
    background: var(--wa-green);
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 2px solid white;
}

/* Chat Body */
.wa-chat-body {
    flex: 1;
    background: var(--chat-bg);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Classic WA pattern */
    background-size: contain;
}

.message {
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.message.bot {
    background: white;
    align-self: flex-start;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.message.user {
    background: var(--wa-light-green);
    align-self: flex-end;
    border-top-right-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.message .time {
    font-size: 0.7rem;
    color: #999;
    display: block;
    text-align: right;
    margin-top: 5px;
}

/* Chat Input Area */
.wa-chat-footer {
    padding: 15px;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
}

.wa-chat-footer input {
    flex: 1;
    border: 1px solid #eee;
    padding: 12px 15px;
    border-radius: 25px;
    outline: none;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: background 0.3s;
}

.wa-chat-footer input:focus {
    background: #fff;
    border-color: var(--wa-green);
}

.wa-chat-footer .send-btn {
    width: 45px;
    height: 45px;
    background: var(--wa-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.wa-chat-footer .send-btn:hover {
    transform: scale(1.05);
}

.wa-chat-footer .send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Typing Indicator */
.typing {
    display: inline-flex;
    gap: 3px;
    padding: 5px 10px;
}

.typing span {
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Close Button in header */
.close-chat {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-chat:hover {
    opacity: 1;
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .wa-chat-window {
        width: calc(100% - 40px);
        bottom: 100px;
        right: 20px;
        left: 20px;
    }
    .wa-floating-btn {
        right: 20px;
        bottom: 20px;
    }
}
