/* ============================================================
   Justiça Multiportas RJ AI
   Versão 3.1.1 – Institucional Profissional
============================================================ */

/* ================= FLOATING BUTTON ================= */

#jmrj-ai-floating-btn {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #0b3d5c;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    z-index: 999999;
    transition: 0.25s ease;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#jmrj-ai-floating-btn:hover {
    transform: scale(1.05);
}

#jmrj-ai-floating-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

#jmrj-ai-floating-btn span {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

/* ================= CHAT WINDOW ================= */

#jmrj-ai-chat-window {
    position: fixed;
    right: 28px;
    bottom: 110px;
    width: 380px;
    height: 540px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: 0.3s ease;
    z-index: 999998;
}

#jmrj-ai-chat-window.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ================= EXPANDIDO ================= */

#jmrj-ai-chat-window.expanded {
    width: 70vw;
    height: 80vh;
    right: 15vw;
    bottom: 10vh;
}

/* ================= HEADER ================= */

.jmrj-header {
    background: #0b3d5c;
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jmrj-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jmrj-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
}

.jmrj-title {
    font-size: 14px;
    font-weight: 600;
}

.jmrj-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.jmrj-header-controls button {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
    transition: 0.2s;
}

.jmrj-header-controls button:hover {
    opacity: 0.7;
}

/* ================= BODY ================= */

#jmrj-ai-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f4f6f8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scroll elegante */

#jmrj-ai-messages::-webkit-scrollbar {
    width: 6px;
}

#jmrj-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* ================= MENSAGENS ================= */

.jmrj-msg {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.jmrj-user {
    align-self: flex-end;
    background: #dfe4ea;
    color: #1c1c1c;
}

.jmrj-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #1c1c1c;
    border: 1px solid #e0e0e0;
}

/* ================= FOOTER ================= */

.jmrj-footer {
    display: flex;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

#jmrj-ai-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #c5c9ce;
    font-size: 14px;
    outline: none;
}

#jmrj-ai-input:focus {
    border-color: #0b3d5c;
}

#jmrj-ai-send {
    background: #0b3d5c;
    border: none;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

#jmrj-ai-send:hover {
    background: #0e4f75;
}

/* ================= RESPONSIVO ================= */

@media (max-width: 768px) {

    #jmrj-ai-chat-window {
        width: 95%;
        right: 2.5%;
        height: 75vh;
        bottom: 90px;
    }

    #jmrj-ai-chat-window.expanded {
        width: 95%;
        height: 85vh;
        right: 2.5%;
        bottom: 5vh;
    }

    #jmrj-ai-floating-btn {
        right: 18px;
        bottom: 18px;
        width: 58px;
        height: 58px;
    }
}