 @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #121212;
    color: white;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    justify-content: flex-start;
}

/* الحاوية الأساسية */
.chat-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    width: 100%;
    max-width: 800px;
    background: #e4eaf3;
    padding: 2px;
    position: relative;
}

/* الهيدر يبقى ثابتاً في الأعلى */
.chat-title {
    background: gold;
    color: black;
    margin: 0;
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 800px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 10px;
}

.home-btn {
    background: #263aa5;
    color: white;
    font-size: 14px;
    text-decoration: none;
    padding:2px 5px;
    border-radius:5px;
}

.home-btn:hover {
    background: #1b2e85;
}

/* الدردشة تتمدد وتأخذ المساحة المتاحة */
.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding:2px;
    max-height: calc(100vh - 130px); /* 100vh - الهيدر وحقل الإدخال */
    margin-top:30px;
}

/* حقل الإدخال يبقى ثابتًا في الأسفل */
.input-container {
    display: flex;
    align-items: center;
    border-top: 2px solid gold;
    position: fixed;
    bottom: 5px;
    width:100%;
    max-width: 800px;
    background: #e4eaf3;
    z-index: 1000;
}

/* الرسائل */
.message {
    background: #444;
    padding:5px;
    margin:3px;
    border-radius: 12px;
    font-size: 16px;
    max-width: 80%;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* تحسين مظهر رسالة المستخدم */
.user {
    background: #0078ff;
    color: white;
    text-align: right;
    align-self: flex-start;
    border-radius: 12px 12px 0px 12px;
}

/* تحسين مظهر رسالة البوت */
.bot {
    background: #444;
    text-align: left;
    align-self: flex-end;
    border-radius: 12px 12px 12px 0px;
}

/* تحسين الأيقونات */
.bot-icon, .user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
}

.bot-icon {
    background: gold;
}

.user-icon {
    background: #ffffff;
}

/* الأزرار الجانبية */
.buttons-container {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.buttons-container button {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border: none;
    border-radius: 50%;
    background: #263aa5;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.buttons-container button:hover {
    background: #920000;
}

/* زر مسح الدردشة */
.buttons-container button:last-child {
    background: #ff0000;
}

.buttons-container button:last-child:hover {
    background: #cc0000;
}

/* تحسين حقل الإدخال */
input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 8px 0px 0px 8px;
    background: #ffffff;
    color: #000000;
    outline: none;
    font-family: 'Tajawal', sans-serif;
}

/* زر الإرسال */
.input-container button {
    padding: 10px 15px;
    font-size: 15px;
    font-weight: bold;
    font-family: 'Tajawal', sans-serif;
    border: none;
    border-radius: 0px 8px 8px 0px;
    background: gold;
    color: black;
    cursor: pointer;
    transition: background 0.3s ease;
}

.input-container button:hover {
    background: #e6b800;
}

/* تحسين تناسب الدردشة على الشاشات الصغيرة */
@media (max-width: 600px) {
    .chat-title {
        font-size: 14px;
        padding:5px;
    }
    .buttons-container button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    .message {
        font-size: 14px;
        padding: 3px;
    }
}