/* ===== WRAPPER ===== */
#ramopharm-chatbot-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== BOUTON TOGGLE ===== */
#ramopharm-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1DB4B5, #114B8E);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(17,75,142,0.35);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    padding: 0;
}
#ramopharm-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(17,75,142,0.5);
}
#ramopharm-toggle img.favicon-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
#ramopharm-toggle .icon-close {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}

/* ===== CHATBOX ===== */
#ramopharm-chatbox {
    width: 340px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
}

/* ===== HEADER ===== */
#ramopharm-header {
    background: linear-gradient(135deg, #114B8E, #1DB4B5);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}
#ramopharm-header img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* ===== MESSAGES ===== */
#ramopharm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f9f7;
}

.ramopharm-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ramopharm-msg.bot {
    background: #fff;
    color: #222;
    border: 1px solid #c5e8e8;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ramopharm-msg.user {
    background: linear-gradient(135deg, #114B8E, #1DB4B5);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ramopharm-msg.error {
    background: #fff3f3;
    border-color: #f5c6c6;
    color: #c0392b;
}

/* Sources */
.ramopharm-sources {
    margin-top: 6px;
    font-size: 11px;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 4px;
}

/* ===== TYPING ANIMATION ===== */
.ramopharm-msg.typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 14px;
}
.ramopharm-msg.typing span {
    width: 8px;
    height: 8px;
    background: #1DB4B5;
    border-radius: 50%;
    animation: ramopharm-bounce 1.2s infinite;
}
.ramopharm-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.ramopharm-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ramopharm-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* ===== INPUT AREA ===== */
#ramopharm-input-area {
    display: flex;
    padding: 10px;
    gap: 8px;
    border-top: 1px solid #e8f0eb;
    background: #fff;
}

#ramopharm-input {
    flex: 1;
    border: 1px solid #c8dcd0;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
#ramopharm-input:focus {
    border-color: #1DB4B5;
}

#ramopharm-send {
    background: linear-gradient(135deg, #114B8E, #1DB4B5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
#ramopharm-send:hover    { opacity: 0.85; }
#ramopharm-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== FOOTER ===== */
#ramopharm-footer {
    background: #eef7f7;
    padding: 7px 14px;
    font-size: 10px;
    color: #114B8E;
    text-align: center;
    border-top: 1px solid #c5e8e8;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 400px) {
    #ramopharm-chatbox {
        width: calc(100vw - 32px);
    }
    #ramopharm-chatbot-wrapper {
        right: 12px;
        bottom: 12px;
    }
}
