/* IntelEdge HRM Chatbot v5.3.2 */

/* ── BUBBLE ── */
#ie-chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #0d3f6e;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 28px;
    line-height: 1;
    user-select: none;
}
#ie-chatbot-bubble:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}
#ie-chatbot-bubble img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
}
#ie-chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
    border: 2px solid #fff;
}

/* ── CHAT WINDOW ── */
#ie-chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 999999;
    width: 375px;
    max-width: 95vw;
    height: 590px;
    max-height: 88vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
}

/* ── HEADER ── */
#ie-chat-header {
    background: linear-gradient(135deg, #0d3f6e, #1a5fa8);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#ie-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
#ie-chat-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45);
    object-fit: contain;
    background: rgba(255,255,255,0.15);
}
#ie-chat-persona-name {
    font-size: 14px;
    display: block;
    font-weight: 600;
}
#ie-chat-status {
    font-size: 11px;
    opacity: 0.85;
    color: #a8ffbd;
}
#ie-chat-close,
#ie-chat-voice-toggle {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}
#ie-chat-close:hover,
#ie-chat-voice-toggle:hover {
    background: rgba(255,255,255,0.35);
}

/* ── LANGUAGE BAR ── */
#ie-chat-lang-bar {
    background: #f0f4f8;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #dde4ee;
    flex-shrink: 0;
}
#ie-chat-lang {
    border: 1px solid #c5cfe0;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 12px;
    background: #fff;
    color: #333;
}

/* ── MODE BAR ── */
#ie-chat-mode-bar {
    display: flex;
    gap: 4px;
    padding: 7px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.ie-mode-btn {
    flex: 1;
    min-width: 55px;
    padding: 5px 4px;
    border: 1px solid #dde4ee;
    background: #fff;
    border-radius: 7px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    color: #444;
}
.ie-mode-btn.active,
.ie-mode-btn:hover {
    background: #0d3f6e;
    color: #fff;
    border-color: #0d3f6e;
}

/* ── MESSAGES ── */
#ie-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
#ie-chat-messages::-webkit-scrollbar { width: 4px; }
#ie-chat-messages::-webkit-scrollbar-thumb { background: #ccd; border-radius: 2px; }

.ie-msg {
    max-width: 88%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    word-wrap: break-word;
    animation: ie-msg-in 0.2s ease-out;
}
@keyframes ie-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}
.ie-msg-bot {
    background: #f0f4f8;
    color: #222;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.ie-msg-bot strong { color: #0d3f6e; }
.ie-msg-bot code  { font-size: 12px; }
.ie-msg-user {
    background: #0d3f6e;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* ── TYPING ── */
.ie-msg-typing {
    background: #f0f4f8;
    padding: 10px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.ie-typing-dots span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #0d3f6e;
    border-radius: 50%;
    margin: 0 2px;
    animation: ie-bounce 1.2s infinite;
}
.ie-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ie-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ie-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40%           { transform: scale(1); }
}

/* ── QUICK BUTTONS ── */
#ie-chat-quick-btns {
    padding: 4px 8px 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex-shrink: 0;
}
.ie-quick-btn {
    padding: 5px 11px;
    background: #e8f0fe;
    color: #0d3f6e;
    border: 1px solid #b8d0f0;
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}
.ie-quick-btn:hover {
    background: #0d3f6e;
    color: #fff;
    border-color: #0d3f6e;
}

/* ── INPUT ROW ── */
#ie-chat-input-row {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid #eee;
    align-items: flex-end;
    flex-shrink: 0;
    background: #fff;
}
#ie-chat-input {
    flex: 1;
    border: 1px solid #dde4ee;
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    max-height: 100px;
    outline: none;
    line-height: 1.4;
    transition: border-color 0.2s;
}
#ie-chat-input:focus { border-color: #0d3f6e; }
#ie-chat-send,
#ie-chat-mic-inline {
    background: #0d3f6e;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 8px 11px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
#ie-chat-send:hover,
#ie-chat-mic-inline:hover { background: #1a5fa8; }
#ie-chat-mic-inline.recording {
    background: #e53935;
    animation: ie-pulse 1s infinite;
}
@keyframes ie-pulse {
    0%, 100% { opacity: 1;   }
    50%       { opacity: 0.5; }
}

/* ── FOOTER ── */
#ie-chat-footer {
    padding: 4px 8px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* ── FORMS & QUIZ inside chat ── */
.ie-chat-form {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
}
.ie-chat-form input,
.ie-chat-form select {
    width: 100%;
    padding: 7px 10px;
    margin: 4px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}
.ie-chat-form button {
    width: 100%;
    padding: 8px;
    background: #0d3f6e;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 6px;
    font-size: 13px;
}
.ie-quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    margin: 4px 0;
    background: #fff;
    border: 1px solid #dde4ee;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}
.ie-quiz-option:hover         { background: #0d3f6e; color: #fff; border-color: #0d3f6e; }
.ie-quiz-option.correct       { background: #d4edda; border-color: #28a745; color: #155724; }
.ie-quiz-option.wrong         { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.ie-quiz-option:disabled      { cursor: default; }

/* ── MOBILE ── */
@media (max-width: 480px) {
    #ie-chatbot-window {
        width: 100vw;
        height: 100dvh;
        height: 100vh; /* fallback */
        bottom: 0;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0;
        max-height: 100vh;
    }
    #ie-chatbot-bubble {
        bottom: 16px;
        right: 16px !important;
        left: auto !important;
        width: 56px;
        height: 56px;
    }
}

/* ── PRINT ── */
@media print {
    #ie-chatbot-bubble,
    #ie-chatbot-window,
    .ie-no-print { display: none !important; }
}

/* ── BOUNCE ANIMATION ── */
@keyframes ie-bubble-bounce {
    0%   { transform: scale(1); }
    20%  { transform: scale(1.2) rotate(-5deg); }
    40%  { transform: scale(0.95) rotate(3deg); }
    60%  { transform: scale(1.1) rotate(-2deg); }
    80%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}
.ie-bubble-bounce {
    animation: ie-bubble-bounce 0.7s ease-in-out 3;
}

/* ── v6.0.0 additions ── */
#ie-chat-lang-bar {
    background: rgba(0,0,0,0.18);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
#ie-chat-lang {
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
}
#ie-chat-lang option { background: #1a3a5c; color: #fff; }
#ie-agent-transfer-msg { animation: ie-msg-in 0.3s ease-out; }
.ie-otp-input {
    width: 100%;
    padding: 10px;
    font-size: 20px;
    letter-spacing: 8px;
    text-align: center;
    border: 2px solid #0d3f6e;
    border-radius: 8px;
    margin: 6px 0;
}
