/* =============================================
   IJP Chatbot Widget Styles
   ============================================= */

#ijp-chat-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    height: 50px;
    padding: 0 20px;
    border-radius: 25px;
    background: linear-gradient(145deg, #ffffff 0%, #d8d8d8 30%, #f5f5f5 60%, #c4c4c4 100%);
    border: 1px solid #b0b0b0;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18),
                0 1px 0 rgba(255, 255, 255, 0.9) inset,
                0 -1px 0 rgba(0, 0, 0, 0.08) inset;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    color: #2c3e50;
    font-size: 18px;
}

#ijp-chat-toggle:hover {
    transform: scale(1.04);
    background: linear-gradient(145deg, #ffffff 0%, #e8e8e8 30%, #fafafa 60%, #d0d0d0 100%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22),
                0 1px 0 rgba(255, 255, 255, 0.95) inset;
}

.chat-toggle-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #2c3e50;
    line-height: 1;
}

#ijp-chat-toggle .bi-chat-dots-fill {
    color: #1a6fc4;
}

#ijp-chat-toggle .chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
}

#ijp-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.85) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

#ijp-chat-panel.ijp-chat-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.ijp-chat-header {
    background: linear-gradient(135deg, #1a6fc4, #0d4f8c);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ijp-chat-header .ijp-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ijp-chat-header .ijp-chat-title {
    flex: 1;
}

.ijp-chat-header .ijp-chat-title strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.ijp-chat-header .ijp-chat-title span {
    font-size: 11px;
    opacity: 0.85;
}

.ijp-chat-header .ijp-chat-actions {
    display: flex;
    gap: 4px;
}

.ijp-chat-header .ijp-chat-actions button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
}

.ijp-chat-header .ijp-chat-actions button:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Messages area */
.ijp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.ijp-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ijp-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ijp-chat-messages::-webkit-scrollbar-thumb {
    background: #c8d8ec;
    border-radius: 4px;
}

/* Message bubbles */
.ijp-msg {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 88%;
    animation: ijpMsgIn 0.2s ease;
}

@keyframes ijpMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ijp-msg.ijp-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ijp-msg.ijp-msg-bot {
    align-self: flex-start;
}

.ijp-msg-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.ijp-msg-user .ijp-msg-bubble {
    background: #1a6fc4;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ijp-msg-bot .ijp-msg-bubble {
    background: #f0f4f9;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    border: 1px solid #e1eaf4;
}

.ijp-msg-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.ijp-msg-user .ijp-msg-icon {
    background: #d0e4f7;
    color: #1a6fc4;
}

.ijp-msg-bot .ijp-msg-icon {
    background: #e8f0fa;
    color: #1a6fc4;
}

/* Typing indicator */
.ijp-typing {
    display: flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
}

.ijp-typing-dots {
    background: #f0f4f9;
    border: 1px solid #e1eaf4;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 10px 14px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.ijp-typing-dots span {
    width: 7px;
    height: 7px;
    background: #90a8c3;
    border-radius: 50%;
    animation: ijpDot 1.2s infinite;
    display: inline-block;
}

.ijp-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ijp-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ijpDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1);   opacity: 1; }
}

/* Quick suggestions */
.ijp-suggestions {
    padding: 6px 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.ijp-suggestion-btn {
    background: #eef4fc;
    border: 1px solid #c5d9f0;
    border-radius: 20px;
    padding: 5px 11px;
    font-size: 12px;
    color: #1a6fc4;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.ijp-suggestion-btn:hover {
    background: #d6e8f9;
    border-color: #1a6fc4;
}

/* Input area */
.ijp-chat-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid #e8edf3;
    flex-shrink: 0;
    background: #fff;
}

.ijp-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#ijp-chat-input {
    flex: 1;
    border: 1.5px solid #c8d8ec;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13.5px;
    resize: none;
    outline: none;
    max-height: 90px;
    min-height: 40px;
    line-height: 1.4;
    transition: border-color 0.15s;
    font-family: inherit;
}

#ijp-chat-input:focus {
    border-color: #1a6fc4;
}

#ijp-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a6fc4;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

#ijp-chat-send:hover {
    background: #0d4f8c;
    transform: scale(1.05);
}

#ijp-chat-send:disabled {
    background: #b0c8e4;
    cursor: not-allowed;
    transform: none;
}

/* Welcome card */
.ijp-welcome {
    background: linear-gradient(135deg, #eef4fc, #ddeaf8);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.55;
    border: 1px solid #c8d8f0;
}

.ijp-welcome strong {
    display: block;
    color: #1a6fc4;
    font-size: 14px;
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    #ijp-chat-panel {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: calc(100vh - 120px);
        max-height: 560px;
    }

    #ijp-chat-toggle {
        bottom: 18px;
        right: 18px;
    }
}
