/**
 * N8N Chat Widget Pro - Frontend Styles
 * Additional styling for the chat widget
 */

/* Ensure chat widget appears above other elements */
#n8n-chat {
    z-index: 999999 !important;
}

/* Smooth animations */
.chat-toggle,
.chat-window {
    transition: all 0.3s ease-in-out !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-window {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    
    .chat-toggle {
        bottom: 20px !important;
        right: 20px !important;
    }
}

/* Accessibility improvements */
.chat-toggle:focus,
.chat-input:focus,
.chat-send-button:focus {
    outline: 2px solid var(--chat--color-primary);
    outline-offset: 2px;
}

/* Custom scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading animation */
.chat-loading {
    display: inline-block;
    animation: chat-pulse 1.5s ease-in-out infinite;
}

@keyframes chat-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Message animations */
.chat-message {
    animation: chat-slide-in 0.3s ease-out;
}

@keyframes chat-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator */
.chat-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--chat--color-light);
    border-radius: 12px;
}

.chat-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chat--color-medium);
    border-radius: 50%;
    animation: chat-typing 1.4s infinite;
}

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

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

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

/* Ensure proper stacking */
.n8n-chat-container {
    position: relative;
    z-index: 999999;
}

/* Print styles - hide chat widget when printing */
@media print {
    #n8n-chat,
    .n8n-chat-container {
        display: none !important;
    }
}
