/* -------------------------------------------------------------------------
   UNLOQ AI CHAT WIDGET STYLES
   ------------------------------------------------------------------------- */

#unloq-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Launcher */
#unloq-chat-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3fa7e4;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#unloq-chat-launcher img {
    width: 36px !important;
    height: 36px !important;
     max-width: none !important;
    max-height: none !important;
    display: block;
    padding: 0;
}

#unloq-chat-launcher:hover { transform: scale(1.05); }

/* Chat Window (Desktop) */
#unloq-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}
#unloq-chat-window.closed {
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Header */
.unloq-chat-header {
    background: #3ea8e5;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-left { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.header-actions button { background: none; border: none; color: white; cursor: pointer; padding: 0; opacity: 0.9; }
.header-actions button:hover { opacity: 1; }

/* Messages Container */
#unloq-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 120px;
}
#unloq-chat-messages::-webkit-scrollbar { width: 6px; }
#unloq-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* Bubbles */
.unloq-message { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; animation: fadeIn 0.3s ease; }
.unloq-message.user { flex-direction: row-reverse; }

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    max-width: 80%;
    word-wrap: break-word;
}

/* User Style */
.unloq-message.user .message-content {
    background: #f5f5f5;
    color: #333;
    border-bottom-right-radius: 2px;
}

/* Bot Style (Pink Gradient) */
.unloq-message.bot .message-content {
    background: #05446e;
    color: white;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(214, 74, 232, 0.3);
}

/* --- RICH TEXT / MARKDOWN STYLES (BOT) --- */
.unloq-message.bot .message-content h1,
.unloq-message.bot .message-content h2,
.unloq-message.bot .message-content h3,
.unloq-message.bot .message-content h4,
.unloq-message.bot .message-content h5,
.unloq-message.bot .message-content h6 {
    margin: 20px 0 8px 0 !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    color: white !important;
    display: block !important;
}
.unloq-message.bot .message-content > *:first-child { margin-top: 0 !important; }
.unloq-message.bot .message-content a { color: #fff; text-decoration: underline; font-weight: bold; }

.unloq-message.bot .message-content ul, 
.unloq-message.bot .message-content ol { 
    margin: 8px 0 8px 25px !important; 
    padding: 0 !important; 
    list-style: disc !important; 
}
.unloq-message.bot .message-content li { 
    margin-bottom: 4px !important; 
    list-style-type: disc !important; 
    display: list-item !important;
    color: white !important;
}
.unloq-message.bot .message-content strong { font-weight: 800; color: white !important; }
.unloq-message.bot .message-content em { font-style: italic; }
.unloq-message.bot .message-content p { margin: 0 0 8px 0 !important; }
.unloq-message.bot .message-content p:last-child { margin-bottom: 0 !important; }

/* Avatars */
.avatar-bot, .avatar-user {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-bot svg, .avatar-user svg { color: #000; width: 28px; height: 28px; }

/* --- TYPING INDICATOR --- */
.typing-pulse {
    display: inline-block;
    color: white;
    font-weight: bold;
    font-size: 24px;
    line-height: 10px;
    padding-bottom: 10px;
    opacity: 0.8;
    animation: pulse-fade 1.5s infinite ease-in-out;
}
@keyframes pulse-fade {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* Scroll Button */
#unloq-scroll-btn {
    position: absolute;
    bottom: 110px;
    right: 20px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e67e22;
    border: none;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: opacity 0.2s;
    padding: 0 !important;
}
#unloq-scroll-btn.hidden { opacity: 0; pointer-events: none; }

/* --- INPUT AREA --- */
.unloq-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: transparent;
    pointer-events: none;
}

.unloq-input-wrapper {
    pointer-events: auto;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: none !important; 
    border: 1px solid #e5e5e5 !important;
    display: flex;
    align-items: center !important;
    min-height: 50px;
}

/* Multi-line Textarea */
#unloq-chat-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px;
    color: #333;
    background: transparent;
    resize: none;
    font-family: inherit;
    padding-bottom: 0;
    line-height: 1.4;
    min-height: 48px;
    max-height: 150px;
    overflow-y: auto;
    margin: 0 !important;
}

/* Button */
#unloq-send-btn {
    width: 36px;
    height: 36px;
    background: #e67e22;
    border: none;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0 !important;
    position: static;
    margin-left: 10px;
    flex-shrink: 0;
}
#unloq-send-btn:hover { background: #d35400; }

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

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 480px) {
    #unloq-chat-window { 
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0; left: 0; right: 0; bottom: 0;
        max-height: none; 
        border-radius: 0;
        margin: 0;
        z-index: 100000;
    }
    #unloq-chat-input {
        font-size: 16px;
    }
}