/* Notria AI Suite - Modern Chatbot Styles */
:root {
    --ai-chatbot-radius: 24px;
    --ai-chatbot-bubble-radius: 18px;
    --ai-chatbot-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    --ai-chatbot-glass: rgba(255, 255, 255, 0.85);
}

#ai-chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Floating Action Button */
#ai-chatbot-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    color: white;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ai-chatbot-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

#ai-chatbot-button svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Main Window */
#ai-chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: var(--ai-chatbot-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--ai-chatbot-radius);
    box-shadow: var(--ai-chatbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aiSlideIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}

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

/* Header */
#ai-chatbot-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.ai-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chatbot-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4ade80;
    border: 2px solid #fff;
    border-radius: 50%;
}

.ai-chatbot-title-group h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chatbot-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

#ai-chatbot-close {
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

#ai-chatbot-close:hover {
    background: rgba(0,0,0,0.2);
}

/* Body */
#ai-chatbot-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

#ai-chatbot-body::-webkit-scrollbar {
    width: 6px;
}

#ai-chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

/* Message Bubbles */
.ai-chat-message {
    display: flex;
    max-width: 85%;
    animation: aiFadeUp 0.3s ease-out;
}

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

.ai-message-bubble {
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1.5;
}

.ai-chat-message.bot {
    align-self: flex-start;
}

.ai-chat-message.bot .ai-message-bubble {
    background: #fff;
    color: #1a1a1a;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ai-chat-message.user {
    align-self: flex-end;
}

.ai-chat-message.user .ai-message-bubble {
    background: #0073aa; /* Default fallback */
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Footer & Input */
#ai-chatbot-footer {
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.ai-input-wrapper {
    background: #fff;
    padding: 8px 8px 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ai-input-wrapper:focus-within {
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#ai-chatbot-input {
    flex-grow: 1;
    border: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
    font-size: 14px !important;
    outline: none !important;
    box-shadow: none !important;
}

#ai-chatbot-send {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s, transform 0.2s;
}

#ai-chatbot-send:hover:not(:disabled) {
    background: rgba(0,0,0,0.03);
    transform: translateX(2px) translateY(-2px);
}

#ai-chatbot-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ai-typing-indicator span {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: aiBounce 1.4s infinite ease-in-out both;
}

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

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

