/* =====================================================
   IndianJobHub AI Chatbot – Stylesheet
   ===================================================== */

/* CSS custom properties – overridden by JS with the admin color */
:root {
    --ijhc-primary:     #2563eb;
    --ijhc-primary-dk:  #1d4ed8;
    --ijhc-radius:      16px;
    --ijhc-shadow:      0 8px 32px rgba(0,0,0,.18);
    --ijhc-font:        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Launcher button ---- */
#ijhc-launcher {
    position: fixed;
    z-index: 99999;
    bottom: 24px;
    width:  58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ijhc-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--ijhc-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, background .2s;
    font-size: 26px;
}
#ijhc-launcher:hover { transform: scale(1.08); background: var(--ijhc-primary-dk); }
#ijhc-launcher.bottom-right { right: 24px; }
#ijhc-launcher.bottom-left  { left:  24px; }

/* Unread badge */
#ijhc-launcher .ijhc-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

/* ---- Chat window ---- */
#ijhc-window {
    position: fixed;
    z-index: 99998;
    bottom: 94px;
    width:  370px;
    max-height: 520px;
    background: #fff;
    border-radius: var(--ijhc-radius);
    box-shadow: var(--ijhc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--ijhc-font);
    transition: opacity .2s, transform .2s;
    opacity: 0;
    transform: translateY(12px) scale(.97);
    pointer-events: none;
}
#ijhc-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
#ijhc-window.bottom-right { right: 24px; }
#ijhc-window.bottom-left  { left:  24px; }

/* Header */
#ijhc-header {
    background: var(--ijhc-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ijhc-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.ijhc-header-info h4 { margin: 0; font-size: 15px; font-weight: 600; }
.ijhc-header-info span { font-size: 11px; opacity: .85; }
#ijhc-close-btn {
    margin-left: auto;
    background: none; border: none; color: #fff;
    font-size: 20px; cursor: pointer; padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
}
#ijhc-close-btn:hover { background: rgba(255,255,255,.2); }

/* Messages area */
#ijhc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.ijhc-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ijhc-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.ijhc-msg.user {
    align-self: flex-end;
    background: var(--ijhc-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ijhc-msg.error {
    background: #fee2e2;
    color: #991b1b;
    align-self: flex-start;
}

/* Typing indicator */
.ijhc-typing {
    display: flex; gap: 5px;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.ijhc-typing span {
    width: 7px; height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ijhc-bounce 1.2s infinite;
}
.ijhc-typing span:nth-child(2) { animation-delay: .2s; }
.ijhc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ijhc-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* Quick reply chips */
#ijhc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 4px;
    background: #f8fafc;
}
.ijhc-chip {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 20px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-family: var(--ijhc-font);
}
.ijhc-chip:hover {
    background: var(--ijhc-primary);
    color: #fff;
    border-color: var(--ijhc-primary);
}

/* Input row */
#ijhc-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
#ijhc-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 14px;
    font-family: var(--ijhc-font);
    outline: none;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    transition: border-color .15s;
}
#ijhc-input:focus { border-color: var(--ijhc-primary); }
#ijhc-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--ijhc-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
#ijhc-send-btn:hover  { background: var(--ijhc-primary-dk); }
#ijhc-send-btn:active { transform: scale(.92); }
#ijhc-send-btn svg    { width: 18px; height: 18px; }

/* Powered-by footer */
.ijhc-powered {
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    padding: 4px 0 8px;
    background: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 420px) {
    #ijhc-window {
        width: calc(100vw - 16px);
        right: 8px !important;
        left: 8px !important;
        bottom: 80px;
    }
    #ijhc-launcher.bottom-right { right: 12px; }
    #ijhc-launcher.bottom-left  { left:  12px; }
}
