﻿/* public/css/greefbot.css */
#greef-chatbot-container {
    position: fixed;
    bottom: 20px;
    left: 20px; /* على اليسار في RTL */
    z-index: 1000;
    font-family: 'Cairo', sans-serif; /* استخدام الخط الجديد */
    direction: rtl; /* لضمان ظهور الودجت من اليمين لليسار */
    text-align: right;
}

#greef-chat-button {
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#greef-chat-button:hover {
    transform: scale(1.1);
}

#greef-chat-window {
    display: none; /* مخفي افتراضيًا */
    width: 320px;
    height: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px; /* فوق الزر */
    left: 0;
    transition: all 0.3s ease;
}

#greef-chat-window.open {
    display: flex; /* مهم جداً: يجعل النافذة تظهر */
    transform: translateY(0);
}

.chat-header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: bold;
}

.chat-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2em;
}

#chat-close-btn {
    cursor: pointer;
    font-size: 1.5em;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f7f7f7;
    border-bottom: 1px solid #eee;
}

.user-message, .bot-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background-color: #dcf8c6; /* أخضر فاتح */
    align-self: flex-end;
    margin-left: auto; /* لليمين */
    text-align: right;
}

.bot-message {
    background-color: #e0e0e0; /* رمادي فاتح */
    align-self: flex-start;
    margin-right: auto; /* لليسار */
    text-align: right;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background-color: #f0f0f0;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9em;
    margin-left: 10px; /* مسافة بين مربع الإدخال وزر الإرسال */
}

#chat-send-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

#chat-send-btn:hover {
    background-color: #0056b3;
}

/* Responsive adjustments for chatbot */
@media (max-width: 768px) {
    #greef-chatbot-container {
        bottom: 15px; /* Adjust slightly from bottom */
        left: 15px;  /* Adjust slightly from left */
    }
    #greef-chat-window {
        width: 90vw; /* Use 90% of viewport width */
        max-width: 380px; /* A bit wider for better text flow on small tablets/large phones */
        height: 75vh; /* Use 75% of viewport height */
        bottom: 80px; /* Position above the button */
        /* Center horizontally */
        left: 50%;
        transform: translateX(-50%);
        /* Ensure it's not off-screen */
        margin-left: auto;
        margin-right: auto;
    }
    /* Ensure chat input area fits */
    .chat-input-area {
        padding: 8px;
    }
    #chat-input {
        padding: 6px 12px;
    }
    #chat-send-btn {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
    .chat-header {
        padding: 12px;
        font-size: 1em;
    }
    .chat-header h3 {
        font-size: 1.1em;
    }
    .chat-messages {
        padding: 10px;
    }
    .user-message, .bot-message {
        font-size: 0.85em;
        max-width: 95%; /* Give messages more width on small screens */
    }
}

@media (max-width: 480px) {
    #greef-chatbot-container {
        bottom: 10px;
        left: 10px;
    }
    #greef-chat-window {
        width: 95vw;
        max-width: none; /* Remove max-width for very small screens */
        height: 80vh;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
    }
}