/* AI Chat Widget Styles */
:root {
    --chat-primary: #0057ff; /* Brand accent blue */
    --chat-bg: rgba(26, 29, 36, 0.85);
    --chat-text: #ffffff;
    --chat-bubble-user: #0057ff;
    --chat-bubble-ai: rgba(255, 255, 255, 0.1);
    --chat-border: rgba(255, 255, 255, 0.1);
}

/* Floating Button */
#chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--chat-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 87, 255, 0.4);
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-widget-button:hover {
    transform: scale(1.1) rotate(5deg);
}

#chat-widget-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #0f1115;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* Chat Window */
#chat-widget-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 60px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: var(--chat-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 1001;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-widget-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.chat-header {
    background: rgba(0, 87, 255, 0.1);
    padding: 20px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 16px;
    color: white;
    font-weight: 700;
}

.chat-header-info p {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

/* Chat Content */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.ai {
    align-self: flex-start;
    background: var(--chat-bubble-ai);
    color: white;
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-bubble-user);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--chat-bubble-ai);
    border-radius: 15px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 15px;
}

.typing span {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Quick Replies */
.quick-replies {
    padding: 0 20px 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--chat-border);
    color: rgba(255,255,255,0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: rgba(0, 87, 255, 0.2);
    border-color: var(--chat-primary);
    color: white;
}

/* Input Area */
.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--chat-border);
    padding: 10px 15px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input-area input:focus {
    border-color: var(--chat-primary);
}

.chat-input-area button {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.05);
}

/* Floating WhatsApp inside chat */
.whatsapp-chat-link {
    color: #25d366;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    #chat-widget-container {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
