/* VIAADUC Chatbot Styles - Enhanced & Modern */
:root {
    --chat-primary: #0ea5e9;
    --chat-primary-dark: #0284c7;
    --chat-secondary: #2A3062;
    --chat-bg: #ffffff;
    --chat-text: #1e293b;
    --chat-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -6px rgba(0, 0, 0, 0.04);
    --chat-radius: 24px;
}

.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
}

/* Launcher Bubble - Pulse Effect */
.chatbot-launcher {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-secondary) 0%, #1e293b 100%);
    box-shadow: 0 8px 24px rgba(42, 48, 98, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
    position: relative;
}

.chatbot-launcher::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--chat-primary);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
}

.chatbot-launcher:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 30px rgba(42, 48, 98, 0.4);
}

.chatbot-launcher:hover::after {
    opacity: 1;
    transform: scale(1.1);
}

.chatbot-launcher svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* Chat Window - Glassmorphism */
.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 550px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.chatbot-window.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header - Modern Gradient */
.chatbot-header {
    background: linear-gradient(135deg, var(--chat-secondary) 0%, #1e1b4b 100%);
    color: white;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 5px;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatbot-header-info h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
}

.chatbot-header-info p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.chat-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
    transition: all 0.3s ease;
}

.chat-message.bot {
    align-self: flex-start;
    background: white;
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--chat-primary) 0%, #0284c7 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

/* Input Area - Floated */
.chatbot-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input-area input {
    flex: 1;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    padding: 12px 18px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
}

.chatbot-input-area input:focus {
    border-color: var(--chat-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.chatbot-send-btn {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.chatbot-send-btn:hover {
    background: var(--chat-secondary);
    transform: rotate(-5deg) scale(1.05);
}

/* Quick Replies - Styled as Pills */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.quick-reply-btn {
    background: white;
    color: var(--chat-secondary);
    border: 2px solid #f1f5f9;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.quick-reply-btn:hover {
    border-color: var(--chat-primary);
    color: var(--chat-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Typing Indicator Animation */
.typing-indicator span {
    width: 6px; height: 6px;
    background: var(--chat-primary);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }
}
