/* Fonts */
@font-face {
    font-family: "Almoni DL AAA";
    src: url("https://llm.is-il.org.il/fonts/almoni-dl-aaa-900.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Almoni DL AAA";
    src: url("https://llm.is-il.org.il/fonts/almoni-dl-aaa-700.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Almoni DL AAA";
    src: url("https://llm.is-il.org.il/fonts/almoni-dl-aaa-400.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Almoni DL AAA";
    src: url("https://llm.is-il.org.il/fonts/almoni-dl-aaa-300.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Floating Chat Icon */
#chatbot-launcher {
    position: fixed;
    bottom: 20px;
    right: 10px;
    z-index: 9999;
    font-family: "Almoni DL AAA", Arial, sans-serif;
}

#custom-chatbot-launcher {
    width: 70px;
    height: 90px;
    background: #0050D1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: none;
}

#custom-chatbot-launcher:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.32);
}

#chatbot-launcher-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

#chatbot-launcher-label {
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

/* Modal */
#custom-chatbot-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.19);
    font-family: "Almoni DL AAA", Arial, sans-serif;
}

#custom-chatbot-modal .chat-container {
    position: absolute;
    bottom: 120px;
    right: 20px;
    background: #fff;
    border-radius: 15px;
    width: 480px;
    max-width: 98vw;
    min-height: 530px;
    max-height: 80vh;
    box-shadow: 0 4px 24px rgba(0,0,0,0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
#custom-chatbot-modal .chat-header {
    background: #0050D1;
    color: #fff;
    padding: 12px 16px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#custom-chatbot-modal .chat-header h3 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

#custom-chatbot-modal .chat-header .running-container {
    margin-top: 4px;
}

#custom-chatbot-modal .chat-header .running {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

#custom-chatbot-modal .chat-close {
    font-size: 25px;
    cursor: pointer;
    color: white;
    line-height: 1;
}

/* Chat Window */
#custom-chatbot-modal .chat-window {
    flex: 1 1 auto;
    background: #f4f7fb;
    overflow-y: auto;
    padding: 16px 10px 0 10px;
    font-size: 15px;
    direction: rtl;
}

#custom-chatbot-modal .chat-window::-webkit-scrollbar {
    width: 8px;
}

#custom-chatbot-modal .chat-window::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

#custom-chatbot-modal .chat-window::-webkit-scrollbar-thumb:hover {
    background-color: #b3b3b3;
}

/* Messages */
#custom-chatbot-modal .message {
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#custom-chatbot-modal .message.show {
    opacity: 1;
    transform: translateY(0);
}

#custom-chatbot-modal .message.user {
    align-items: flex-end;
}

#custom-chatbot-modal .message.user .text {
    background-color: #e2e6ea;
    color: #181818;
    text-align: right;
    border-radius: 16px;
    max-width: 90%;
}

#custom-chatbot-modal .message.bot {
    align-items: flex-start;
}

#custom-chatbot-modal .message.bot .text {
    background-color: #e0eafa;
    color: #181818;
    text-align: right;
    border-radius: 16px;
    max-width: 100%;
}

#custom-chatbot-modal .text {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.35;
}

#custom-chatbot-modal .timestamp {
    font-size: 11px;
    color: #a9b2c4;
    margin-top: 4px;
}

#custom-chatbot-modal .guid {
    font-size: 13px;
    color: #888;
}

.clickable {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}

/* Input Area */
#custom-chatbot-modal .chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 10px 12px;
    background: white;
    border-top: 1px solid #e5e5e5;
}

#custom-chatbot-modal .chat-input input[type=text] {
    flex: 1 1 auto;
    height: 42px;
    border: 1px solid #c3d1e2;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 15px;
    font-family: "Almoni DL AAA", Arial, sans-serif;
    outline: none;
    direction: rtl;
    text-align: right;
}

#custom-chatbot-modal .chat-input input[type=text]::placeholder {
    color: #757575;
}

#custom-chatbot-modal .btn-whatsapp-send {
    background: none;
    border: none;
    cursor: pointer;
    color: #0050D1;
    padding: 0;
    transition: color 0.2s;
}

#custom-chatbot-modal .btn-whatsapp-send:hover {
    color: #003C9C;
}

#custom-chatbot-modal .btn-whatsapp-send:disabled {
    opacity: 0.7;
    cursor: default;
}

@media (max-width: 700px) {
    #custom-chatbot-modal .chat-container {
        right: 5px;
        left: 5px;
        width: auto;
        bottom: 100px;
    }

    #custom-chatbot-modal .chat-input {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #custom-chatbot-modal .chat-input input[type=text] {
        width: 100%;
    }

    #custom-chatbot-modal .btn-whatsapp-send {
        align-self: flex-end;
    }
}
