/* N8N Live Chat Widget Styles */

.n8n-chat-widget {
    --primary-color: #3c9b72;
    --secondary-color: #256f4f;
    --bottom-spacing: 20px;
    --side-spacing: 30px;
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Positioning */
.n8n-chat-bottom-right {
    bottom: var(--bottom-spacing);
    right: var(--side-spacing);
}

.n8n-chat-bottom-left {
    bottom: var(--bottom-spacing);
    left: var(--side-spacing);
}

/* Bubble Button */
.n8n-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.n8n-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.n8n-chat-bubble img {
    max-width: 32px;
    max-height: 32px;
}

.n8n-chat-bubble svg {
    width: 28px;
    height: 28px;
}

.n8n-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #fff;
}

/* Chat Window */
.n8n-chat-window {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Widget Sizes */
.n8n-chat-size-small .n8n-chat-window {
    width: 320px;
    height: 540px;
}

.n8n-chat-size-medium .n8n-chat-window {
    width: 380px;
    height: 630px;
}

.n8n-chat-size-large .n8n-chat-window {
    width: 440px;
    height: 720px;
}

/* Position window relative to bubble */
.n8n-chat-bottom-right .n8n-chat-window {
    bottom: 80px;
    right: 0;
}

.n8n-chat-bottom-left .n8n-chat-window {
    bottom: 80px;
    left: 0;
}

/* Header */
.n8n-chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.n8n-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.n8n-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.n8n-chat-avatar-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.n8n-chat-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    color: #ffffff;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.n8n-chat-status {
    margin-top: 4px;
    font-size: 13px;
    font-family: 'Roboto', sans-serif;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Optional: titik online */
.n8n-chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #22c55e; /* hijau online */
    border-radius: 50%;
    display: inline-block;
}

.n8n-chat-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.n8n-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages */
.n8n-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.n8n-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.n8n-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.n8n-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

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

.n8n-chat-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

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

.n8n-message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.n8n-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.n8n-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.n8n-message-bubble {
    background: #fff;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.n8n-message-user {
    flex-direction: row-reverse;
}

.n8n-message-user .n8n-message-content {
    align-items: flex-end;
}

.n8n-message-user .n8n-message-bubble {
    background: var(--primary-color);
    color: #fff;
}

.n8n-message-time {
    font-size: 11px;
    color: #999;
    padding: 0 8px;
}

/* Typing Indicator */
.n8n-chat-typing {
    padding: 10px 20px;
    background: #f8f9fa;
}

.n8n-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.n8n-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

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

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

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

/* Input */
.n8n-chat-input-wrapper {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.n8n-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 10px !important;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.n8n-chat-input:focus {
    border-color: var(--primary-color);
}

.n8n-chat-send {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    padding: 0;

    background: #d0cece !important;   /* ❌ no background */
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}


.n8n-chat-send:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.n8n-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.n8n-chat-send img {
  width: 28px !important;
  height: 28px !important;
  display: block;
  opacity: 0.85;
}

/* Animations */
.n8n-chat-window.n8n-show {
    animation: slideUp 0.3s ease;
}

.n8n-chat-window.n8n-hide {
    animation: slideDown 0.3s ease;
}

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

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

/* AFTER (fixed): */
@media (max-width: 768px) {
    .n8n-chat-window {
        width: 100vw !important;     /* ✅ Full width */
        height: 100vh !important;    /* ✅ Full height */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important; /*  No border radius */
    }
}
