/* =========================
   EL DORADO AI ASSISTANT
========================= */

#chatButton {
    position: fixed !important;
    left: 24px !important;
    bottom: 24px !important;

    width: 64px;
    height: 64px;
    padding: 0;

    display: flex !important;
    justify-content: center;
    align-items: center;

    border: none;
    border-radius: 50%;

    background: #d71920;
    color: white;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);

    z-index: 999999 !important;
}

#chatButton:hover {
    transform: scale(1.07);
}

#chatWindow {
    position: fixed !important;
    left: 24px !important;
    bottom: 100px !important;

    width: 370px;
    height: 520px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 130px);

    display: none;
    flex-direction: column;

    background: white;
    border-radius: 20px;
    overflow: hidden;

    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);

    z-index: 999999 !important;
}

/* This is what makes it appear after clicking */
#chatWindow.chat-open {
    display: flex !important;
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 16px 18px;

    background: linear-gradient(135deg, #c50000, #7e0000);
    color: white;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-title h3 {
    margin: 0;
    font-size: 17px;
}

.ai-chat-title p {
    margin: 3px 0 0;
    font-size: 12px;
    opacity: 0.85;
}

#closeChat {
    border: none;
    background: transparent;
    color: white;

    font-size: 22px;
    cursor: pointer;
}

#chatMessages {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 18px;

    overflow-y: auto;
    background: #f4f4f4;
}

.ai-bot-message,
.ai-user-message {
    max-width: 82%;

    padding: 11px 14px;

    border-radius: 16px;
    line-height: 1.4;

    word-break: break-word;
}

.ai-bot-message {
    align-self: flex-start;

    background: white;
    color: #222;

    border-bottom-left-radius: 4px;
}

.ai-user-message {
    align-self: flex-end;

    background: #b80000;
    color: white;

    border-bottom-right-radius: 4px;
}

#chatForm{

    display:flex;

    align-items:center;

    gap:10px;

    padding:12px;
}

#chatInput {
    flex: 1;

    padding: 11px 12px;

    border: 1px solid #ccc;
    border-radius: 10px;

    outline: none;
    font-size: 14px;
}

#chatInput:focus {
    border-color: #b80000;
}

#chatForm button {

    width: 80px;

    height: 48px;

    flex: 0 0 80px;

    padding: 0;

    border: none;

    border-radius: 10px;

    background: #b80000;

    color: white;

    font-size: 16px;

    font-weight: 600;

    cursor: pointer;

    display: flex;

    justify-content: center;

    align-items: center;
}

@media (max-width: 500px) {
    #chatButton {
        right: 15px !important;
        bottom: 15px !important;
    }

    #chatWindow {
        right: 15px !important;
        bottom: 90px !important;

        width: calc(100vw - 30px);
        height: 65vh;
    }
}
#chatWindow #chatForm {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 74px !important;
    align-items: center !important;
    gap: 8px !important;

    width: 100% !important;
    padding: 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#chatWindow #chatInput {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;

    padding: 0 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#chatWindow #chatSendButton {
    appearance: none !important;
    -webkit-appearance: none !important;

    position: static !important;
    inset: auto !important;
    float: none !important;
    transform: none !important;

    display: block !important;

    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;

    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;

    padding: 0 !important;
    margin: 0 !important;

    border: 0 !important;
    border-radius: 10px !important;

    background: #b80000 !important;
    color: white !important;

    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 44px !important;
    text-align: center !important;

    cursor: pointer !important;
    box-sizing: border-box !important;
}
.chat-action-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 18px;
    background-color: #d4af37;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: 0.2s;
    cursor: pointer;
}

.chat-action-button:hover {
    opacity: 0.85;
}
.ai-bot-message {
    white-space: pre-line;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ai-user-message {
    overflow-wrap: anywhere;
}