/* ==========================================================
   WhatsApp Chat Widget Styles
   Provides floating WhatsApp button + popup chat interface
   ========================================================== */

/* Floating WhatsApp Button */
#whatsapp-button {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

#whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

/* Popup Container */
#whatsapp-popup {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 340px;
    max-width: 92vw;
    height: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

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

#whatsapp-popup.show {
    display: flex;
}

/* Popup Header */
#whatsapp-popup header {
    background: #25D366;
    color: #fff;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: sans-serif;
}

#popup-header-icon {
    font-size: 30px;
    line-height: 1;
}

.popup-header-text h3 {
    margin: 0;
    font-weight: bold;
    font-size: 16px;
}

#connection-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    opacity: 0.8;
}

#status-dot {
    width: 8px;
    height: 8px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 50%;
    transition: background 0.3s ease;
}

#status-dot.connected {
    background: rgba(34, 197, 94, 0.9);
}

#status-dot.connecting {
    background: rgba(168, 85, 247, 0.9);
    animation: pulse 2s infinite;
}

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

#close-button {
    margin-left: auto;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
#chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f6f6f6;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Messages */
.message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 14px;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease;
}

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

.message.user {
    background: #25D366;
    color: #fff;
    align-self: flex-end;
}

.message.bot {
    background: #eaeaea;
    color: #111;
    align-self: flex-start;
}

.message.system {
    background: #fff3cd;
    color: #856404;
    align-self: center;
    font-size: 13px;
    border: 1px solid #ffeeba;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    align-self: center;
    font-size: 13px;
    border: 1px solid #f5c6cb;
}

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

#chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-family: sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
}

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

#send-button {
    border: none;
    background: #25D366;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

#send-button:hover {
    background: #128C7E;
    transform: scale(1.05);
}

#send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}
