/* ========================================
   AQUAMONDIS AI Chat Widget Styles
   ======================================== */

/* Chat Widget Container */
#am-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle Button */
#am-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5 0%, #00B894 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

#am-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

#am-chat-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.6), 0 0 0 8px rgba(79, 70, 229, 0.1);
    }
}

/* Chat Window */
#am-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#am-chat-window.am-chat-open {
    transform: scale(1);
    opacity: 1;
}

/* Chat Header */
#am-chat-header {
    background: linear-gradient(135deg, #4F46E5 0%, #00B894 100%);
    padding: 16px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#am-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

#am-chat-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#am-chat-header-icon svg {
    width: 24px;
    height: 24px;
}

#am-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#am-chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

#am-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

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

#am-chat-close svg {
    width: 24px;
    height: 24px;
}

/* Messages Area */
#am-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#am-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#am-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#am-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#am-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message Bubbles */
.am-chat-message {
    display: flex;
    animation: messageSlideIn 0.3s ease;
}

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

.am-chat-message-user {
    justify-content: flex-end;
}

.am-chat-message-assistant {
    justify-content: flex-start;
}

.am-chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.am-chat-message-user .am-chat-bubble {
    background: linear-gradient(135deg, #4F46E5 0%, #00B894 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.am-chat-message-assistant .am-chat-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Typing Indicator */
.am-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
}

.am-typing span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.am-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.am-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
#am-chat-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

#am-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

#am-chat-input:focus {
    border-color: #4F46E5;
}

#am-chat-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

#am-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5 0%, #00B894 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#am-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
}

#am-chat-send:active:not(:disabled) {
    transform: scale(0.95);
}

#am-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#am-chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    #am-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        max-height: 600px;
        border-radius: 16px 16px 0 0;
    }

    #am-chat-toggle {
        bottom: 16px;
        right: 16px;
    }

    #am-chat-messages {
        padding: 16px;
    }

    .am-chat-bubble {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    #am-chat-window {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    #am-chat-header {
        padding: 12px 16px;
    }
}
