/* ============================================
   AndyWawa Chatbot Widget Styles
   ============================================ */

/* Trigger Button */
.andy-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    cursor: pointer;
}

.andy-chat-trigger-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #C85A4A;
    box-shadow: 0 4px 16px rgba(200, 90, 74, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.andy-chat-trigger-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(200, 90, 74, 0.5);
}

.andy-chat-trigger-btn img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
}

.andy-chat-trigger-btn .andy-chat-close-icon {
    display: none;
    font-size: 28px;
    color: #fff;
    line-height: 1;
}

.andy-chat-trigger-btn.active img {
    display: none;
}

.andy-chat-trigger-btn.active .andy-chat-close-icon {
    display: block;
}

/* Speech Bubble */
.andy-chat-bubble {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 9997;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.andy-chat-bubble.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.andy-chat-bubble-inner {
    background: #fff;
    color: #333;
    padding: 12px 18px;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    max-width: 240px;
    cursor: pointer;
    border: 1px solid #f0e8e6;
}

.andy-chat-bubble-inner:hover {
    background: #FFF8F7;
}

/* Chat Window */
.andy-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 520px;
    z-index: 9999;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    background: #FAF8F5;
    font-family: 'Poppins', sans-serif;
}

.andy-chat-window.open {
    display: flex;
    animation: andyChatSlideUp 0.3s ease;
}

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

/* Chat Header */
.andy-chat-header {
    background: linear-gradient(135deg, #C85A4A, #b04a3c);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.andy-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.andy-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.andy-chat-header-info {
    flex: 1;
}

.andy-chat-header-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.andy-chat-header-status {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.andy-chat-header-status::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
}

.andy-chat-header-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.andy-chat-header-close:hover {
    opacity: 1;
}

/* Chat Messages */
.andy-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.andy-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.andy-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.andy-chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* Message Bubbles */
.andy-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: andyMsgIn 0.3s ease;
}

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

.andy-msg.bot {
    align-self: flex-start;
}

.andy-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.andy-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.andy-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.andy-msg.user .andy-msg-avatar {
    background: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.andy-msg-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.andy-msg.bot .andy-msg-content {
    background: #fff;
    color: #333;
    border: 1px solid #eee;
    border-radius: 4px 16px 16px 16px;
}

.andy-msg.user .andy-msg-content {
    background: #C85A4A;
    color: #fff;
    border-radius: 16px 4px 16px 16px;
}

/* Typing Indicator */
.andy-typing {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    max-width: 85%;
}

.andy-typing-dots {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px 16px 16px 16px;
    padding: 12px 18px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.andy-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C85A4A;
    animation: andyTyping 1.4s infinite;
}

.andy-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.andy-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes andyTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Actions */
.andy-chat-quick {
    padding: 8px 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.andy-chat-quick button {
    background: #FFF5F3;
    border: 1px solid #f0d5cf;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    color: #C85A4A;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.andy-chat-quick button:hover {
    background: #C85A4A;
    color: #fff;
    border-color: #C85A4A;
}

/* Chat Input */
.andy-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.andy-chat-input input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.andy-chat-input input:focus {
    border-color: #C85A4A;
}

.andy-chat-input input::placeholder {
    color: #9ca3af;
}

.andy-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #C85A4A;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.andy-chat-input button:hover {
    background: #b04a3c;
}

.andy-chat-input button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .andy-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .andy-chat-bubble {
        bottom: 90px;
        right: 16px;
    }

    .andy-chat-trigger {
        bottom: 16px;
        right: 16px;
    }
}
