/* Obairawo AI Assistant - Exact 1:1 Jotform AI Chatbot Clone */
:root {
    --jf-primary: #672000;
    --jf-primary-hover: #501900;
    --jf-pulse-color: rgba(103, 32, 0, 0.4);
    --jf-text: #2E073F;
    --jf-text-muted: #6b7280;
    --jf-bg: #FFFFFF;
    --jf-bubble-bot: #F3F4F6;
    --jf-border: #E5E7EB;
    --jf-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
}

#obairawo-chat-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Greeting Tooltip Bubble (Jotform Signature) */
#jf-greeting-bubble {
    position: absolute;
    bottom: 8px;
    right: 76px;
    background: #ffffff;
    color: var(--jf-text);
    padding: 12px 34px 12px 16px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: jfSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#jf-greeting-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

#jf-greeting-bubble::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 9px solid #ffffff;
}

#jf-greeting-close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    transition: color 0.15s ease;
}

#jf-greeting-close:hover {
    color: #374151;
}

/* Launcher Button */
#jf-launcher-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--jf-primary);
    box-shadow: 0 6px 20px var(--jf-pulse-color);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #ffffff;
    animation: jfPulse 2.4s infinite;
}

#jf-launcher-btn:hover {
    transform: scale(1.06);
    background: var(--jf-primary-hover);
}

@keyframes jfPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(103, 32, 0, 0.55);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(103, 32, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(103, 32, 0, 0);
    }
}

#jf-launcher-btn svg {
    width: 32px;
    height: 32px;
    transition: transform 0.25s ease;
}

/* Chat Modal Window */
#jf-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--jf-bg);
    border-radius: 20px;
    box-shadow: var(--jf-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: jfModalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999999;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

#jf-chat-window.jf-open {
    display: flex;
}

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

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

/* Header */
.jf-header {
    background: #ffffff;
    border-bottom: 1px solid var(--jf-border);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jf-header-agent {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jf-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB629 0%, #FF6100 50%, #672000 100%);
    padding: 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jf-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jf-avatar-inner svg {
    width: 22px;
    height: 22px;
}

.jf-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: #10B981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.jf-header-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--jf-text);
    line-height: 1.2;
}

.jf-header-text span {
    font-size: 12px;
    color: #10B981;
    font-weight: 500;
}

.jf-header-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}

.jf-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.jf-tool-btn:hover {
    background: #f3f4f6;
    color: var(--jf-text);
}

.jf-tool-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Chat Body */
.jf-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

/* Welcome Hero Box */
.jf-welcome-hero {
    text-align: center;
    padding: 18px 12px 10px;
    margin-bottom: 6px;
}

.jf-welcome-hero .jf-avatar-wrap {
    width: 54px;
    height: 54px;
    margin: 0 auto 10px;
}

.jf-welcome-hero .jf-avatar-inner svg {
    width: 30px;
    height: 30px;
}

.jf-welcome-hero h4 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--jf-text);
}

.jf-welcome-hero p {
    margin: 0;
    font-size: 13px;
    color: var(--jf-text-muted);
    line-height: 1.45;
}

/* Prompt Chips */
.jf-prompt-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 10px;
}

.jf-prompt-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--jf-text);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jf-prompt-card:hover {
    background: #f4ede7;
    border-color: var(--jf-primary);
    color: var(--jf-primary);
    transform: translateY(-1px);
}

.jf-prompt-card svg {
    width: 14px;
    height: 14px;
    fill: #9ca3af;
}

/* Message Rows */
.jf-msg-row {
    display: flex;
    gap: 8px;
    max-width: 86%;
    animation: jfMsgFade 0.2s ease;
}

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

.jf-msg-row.jf-bot {
    align-self: flex-start;
}

.jf-msg-row.jf-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.jf-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff5ed;
    border: 1px solid #ffd8be;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.jf-msg-avatar svg {
    width: 16px;
    height: 16px;
}

.jf-msg-content {
    display: flex;
    flex-direction: column;
}

.jf-msg-bubble {
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.jf-bot .jf-msg-bubble {
    background: var(--jf-bubble-bot);
    color: var(--jf-text);
    border-bottom-left-radius: 4px;
}

.jf-user .jf-msg-bubble {
    background: var(--jf-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.jf-msg-time {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.jf-user .jf-msg-time {
    text-align: right;
}

/* Typing Indicator */
.jf-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--jf-bubble-bot);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.jf-typing-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: jfBounce 1.4s infinite ease-in-out both;
}

.jf-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.jf-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes jfBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Footer & Input */
.jf-footer {
    padding: 12px 16px 14px;
    background: #ffffff;
    border-top: 1px solid var(--jf-border);
}

.jf-input-box {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1.5px solid var(--jf-border);
    border-radius: 24px;
    padding: 4px 6px 4px 16px;
    transition: all 0.2s ease;
}

.jf-input-box:focus-within {
    border-color: var(--jf-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(103, 32, 0, 0.1);
}

.jf-input-field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--jf-text);
    padding: 8px 0;
}

.jf-input-field::placeholder {
    color: #9ca3af;
}

.jf-send-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--jf-primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.jf-send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.jf-send-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transform: translateX(1px);
}

.jf-branding-line {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.jf-branding-line a {
    color: #16a34a;
    text-decoration: none;
    font-weight: 600;
}

.jf-branding-line a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    #jf-chat-window {
        bottom: 80px;
        right: 12px;
        left: 12px;
        width: auto;
        height: 75vh;
        border-radius: 16px;
    }
    #jf-greeting-bubble {
        display: none !important;
    }
}