/* Public styles for n8n Chat Bot WP */

.n8n-chatbot-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.n8n-chatbot-widget.position-right {
    right: 20px;
}

.n8n-chatbot-widget.position-left {
    left: 20px;
}

/* Chat Icon */
.n8n-chatbot-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--n8n-chatbot-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.n8n-chatbot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.n8n-chatbot-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.n8n-chatbot-icon:hover svg {
    transform: scale(1.1);
}

/* Chat Box */
.n8n-chatbot-box {
    width: 350px;
    height: 500px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 10px;
    animation: slideUp 0.3s ease-out;
}

.n8n-chatbot-box.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.n8n-chatbot-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.n8n-chatbot-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.n8n-chatbot-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.n8n-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.n8n-chatbot-close svg {
    width: 16px;
    height: 16px;
}

/* Messages Area */
.n8n-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.n8n-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.n8n-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.n8n-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.n8n-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Message Styling */
.n8n-chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.n8n-chatbot-message.user-message {
    align-self: flex-end;
}

.n8n-chatbot-message.bot-message {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message .message-content {
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

/* Typing Indicator */
.n8n-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.4;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.typing-text {
    font-size: 12px;
    opacity: 0.7;
}

/* Input Area */
.n8n-chatbot-input-area {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.n8n-chatbot-form {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.n8n-chatbot-form input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.n8n-chatbot-form input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.n8n-chatbot-form button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.n8n-chatbot-form button:hover {
    transform: scale(1.05);
}

.n8n-chatbot-form button:active {
    transform: scale(0.95);
}

.n8n-chatbot-form button svg {
    width: 20px;
    height: 20px;
}

/* Theme Styles */

/* Dark Theme */
.n8n-chatbot-widget.theme-dark .n8n-chatbot-icon {
    background: #2c3e50;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-dark .n8n-chatbot-box {
    background: #2c3e50;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-dark .user-message .message-content {
    background: #3498db;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-dark .bot-message .message-content {
    background: #34495e;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-dark .n8n-chatbot-form input {
    background: #34495e;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-dark .n8n-chatbot-form input::placeholder {
    color: #bdc3c7;
}

.n8n-chatbot-widget.theme-dark .n8n-chatbot-form button {
    background: #3498db;
    color: #ffffff;
}

/* White Theme */
.n8n-chatbot-widget.theme-white .n8n-chatbot-icon {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-box {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-header {
    border-bottom-color: #e0e0e0;
}

.n8n-chatbot-widget.theme-white .user-message .message-content {
    background: #007bff;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-white .bot-message .message-content {
    background: #e9ecef;
    color: #333333;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-form input {
    background: #f8f9fa;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-form input::placeholder {
    color: #6c757d;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-form button {
    background: #007bff;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-close:hover {
    background-color: #f8f9fa;
}

.n8n-chatbot-widget.theme-white .n8n-chatbot-input-area,
.n8n-chatbot-widget.theme-white .n8n-chatbot-typing {
    border-top-color: #e0e0e0;
}

/* Yellow Theme */
.n8n-chatbot-widget.theme-yellow .n8n-chatbot-icon {
    background: #f1c40f;
    color: #2c3e50;
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-box {
    background: #fff9c4;
    color: #2c3e50;
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-header {
    border-bottom-color: rgba(44, 62, 80, 0.1);
}

.n8n-chatbot-widget.theme-yellow .user-message .message-content {
    background: #f39c12;
    color: #2c3e50;
}

.n8n-chatbot-widget.theme-yellow .bot-message .message-content {
    background: #fef9e7;
    color: #2c3e50;
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-form input {
    background: #fef9e7;
    color: #2c3e50;
    border: 1px solid #f1c40f;
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-form input::placeholder {
    color: #34495e;
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-form button {
    background: #f39c12;
    color: #2c3e50;
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-close:hover {
    background-color: rgba(44, 62, 80, 0.1);
}

.n8n-chatbot-widget.theme-yellow .n8n-chatbot-input-area,
.n8n-chatbot-widget.theme-yellow .n8n-chatbot-typing {
    border-top-color: rgba(44, 62, 80, 0.1);
}

/* Red Theme */
.n8n-chatbot-widget.theme-red .n8n-chatbot-icon {
    background: #e74c3c;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-red .n8n-chatbot-box {
    background: #e74c3c;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-red .user-message .message-content {
    background: #c0392b;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-red .bot-message .message-content {
    background: #d63031;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-red .n8n-chatbot-form input {
    background: #c0392b;
    color: #ffffff;
}

.n8n-chatbot-widget.theme-red .n8n-chatbot-form input::placeholder {
    color: #ecf0f1;
}

.n8n-chatbot-widget.theme-red .n8n-chatbot-form button {
    background: #c0392b;
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .n8n-chatbot-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .n8n-chatbot-widget.position-left {
        left: 10px;
        right: auto;
    }
    
    .n8n-chatbot-widget.position-right {
        right: 10px;
        left: auto;
    }
    
    .n8n-chatbot-box {
        width: 100%;
        max-width: 350px;
        height: 450px;
    }
    
    .n8n-chatbot-icon {
        width: 50px;
        height: 50px;
    }
    
    .n8n-chatbot-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .n8n-chatbot-box {
        height: 400px;
    }
    
    .n8n-chatbot-messages {
        padding: 15px;
    }
    
    .n8n-chatbot-form {
        padding: 12px 15px;
    }
}

/* Accessibility */
.n8n-chatbot-icon:focus,
.n8n-chatbot-close:focus,
.n8n-chatbot-form button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.n8n-chatbot-form input:focus {
    outline: none;
}

/* Print styles */
@media print {
    .n8n-chatbot-widget {
        display: none !important;
    }
}
