/* =====================================================================
   AI Chat Widget — nareshkalra.com
   Deploy at: /css/ai-chat-widget.css  (site root /css/ folder)
   ===================================================================== */

#nk-chat-launcher {
    position: fixed;
    bottom: 22px;
    right: 22px;
    height: 56px;
    padding: 0 20px 0 16px;
    border-radius: 30px;
    background: #2c3e50;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    z-index: 999998;
    transition: transform 0.2s ease;
    border: none;
}
#nk-chat-launcher:hover { transform: scale(1.05); }
#nk-chat-launcher svg { width: 26px; height: 26px; flex-shrink: 0; }
#nk-chat-launcher .nk-launcher-label {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}

@media (max-width: 480px) {
    #nk-chat-launcher { padding: 0; width: 56px; justify-content: center; }
    #nk-chat-launcher .nk-launcher-label { display: none; }
}

#nk-chat-window {
    position: fixed;
    bottom: 96px;
    right: 22px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.28);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    font-family: Arial, sans-serif;
}
#nk-chat-window.nk-open { display: flex; }

#nk-chat-header {
    background: #2c3e50;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#nk-chat-header .nk-title { font-size: 15px; font-weight: 700; }
#nk-chat-header .nk-subtitle { font-size: 11px; opacity: 0.75; margin-top: 2px; }
#nk-chat-close { cursor: pointer; background: none; border: none; color: #fff; font-size: 20px; line-height: 1; }

#nk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f4f6f9;
}

.nk-msg { margin-bottom: 12px; display: flex; }
.nk-msg.nk-user { justify-content: flex-end; }
.nk-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
}
.nk-msg.nk-user .nk-bubble { background: #2c3e50; color: #fff; border-bottom-right-radius: 3px; }
.nk-msg.nk-bot .nk-bubble { background: #fff; color: #222; border: 1px solid #e3e6ea; border-bottom-left-radius: 3px; }

.nk-typing .nk-bubble { display: flex; gap: 4px; align-items: center; }
.nk-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: #9aa3ad;
    animation: nk-bounce 1.2s infinite ease-in-out;
}
.nk-typing span:nth-child(2) { animation-delay: 0.15s; }
.nk-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes nk-bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* CTA row appended after every AI reply */
.nk-cta-row {
    display: flex;
    gap: 6px;
    margin: 6px 0 14px 0;
    flex-wrap: wrap;
}
.nk-cta-btn {
    flex: 1;
    min-width: 90px;
    text-align: center;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.nk-cta-whatsapp { background: #25D366; color: #fff; }
.nk-cta-call { background: #2c3e50; color: #fff; }
.nk-cta-form { background: #e9edf1; color: #2c3e50; border: 1px solid #cfd6dc; }

#nk-chat-inputbar {
    display: flex;
    border-top: 1px solid #e3e6ea;
    padding: 10px;
    gap: 8px;
    flex-shrink: 0;
    background: #fff;
}
#nk-chat-input {
    flex: 1;
    border: 1px solid #d7dce1;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13.5px;
    outline: none;
}
#nk-chat-send {
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
#nk-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 420px) {
    #nk-chat-window { right: 16px; bottom: 90px; }
    #nk-chat-launcher { right: 16px; bottom: 16px; }
}
