:root {
    --searchlist-size: 310px;
    --searchlist-font-size: 12px;
}

* {
    direction: rtl;
}
.search-icon {
    width: 20px;
    height: auto;
}

#search-container {
    position: relative;
    width: 320px; /* أقصى عرض */
    display: flex;  
    align-items: center; 
    gap: 5px; 
}

#search-input {
    background-color: var(--main-page-color);
    flex: 1; /* السماح له بالتوسع */
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--main-page-color);
    border-radius: 20px;
    text-align: right;
    min-width: 150px; /* الحد الأدنى المعقول */
    max-width: 85%; /* لا يتجاوز عرض الحاوية */
}

#search-input:focus {
    outline: none;
}

#search-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--main-page-color);
    color: var(--main-color);
    cursor: pointer;
    display: flex; /* لجعل المحتوى داخل الزر متناسقاً */
    align-items: center;
    justify-content: center;
    border: none;
}

#suggestions {
    position: absolute;
    top: 120%;
    right: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    z-index: 1000;
    max-height: 200px; /* تحديد ارتفاع أقصى للقائمة */
    overflow-y: auto; /* إظهار شريط تمرير عمودي */
    display: none; /* إخفاء مربع الاقتراحات افتراضيًا */
    width: var(--searchlist-size);
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: right; /* محاذاة النص إلى اليمين */
    font-size: var(--searchlist-font-size);
    padding: 8px 10px;
}

.suggestion-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.no-image {
    display: none;
}

.type-label {
    color: gray; /* لون رمادي */
    font-size: 0.9em; /* حجم خط أصغر */
    margin-left: 5px; /* مسافة بين الاقتراح ونوعه */
}

.separator {
    color: gray; /* لون رمادي */
    font-size: 0.9em; /* حجم صغير مثل حجم النوع */
    margin: 0 5px; /* مسافة حول الفاصل */
}

.suggestion:hover {
    background: #f0f0f0;
}

/* تنسيق شريط التمرير */
#suggestions::-webkit-scrollbar {
    width: 8px; /* عرض شريط التمرير */
}

#suggestions::-webkit-scrollbar-thumb {
    background: #aaa; /* لون شريط التمرير */
    border-radius: 4px; /* حدود دائرية */
}

#suggestions::-webkit-scrollbar-track {
    background: #f1f1f1; /* لون خلفية شريط التمرير */
}

#loading-message {
    display: none; /* إخفاء الرسالة افتراضيًا */
    padding: 5px 10px;
    background: var(--main-page-color);
    border: 1px solid #ccc;
    border-radius: 4px;
    position: absolute;
    top: 120%;
    left: 0;
    right: 0;
    z-index: 1000;
    font-size: var(--searchlist-font-size);
    width: var(--searchlist-size);
}

@media screen and (max-width: 1069px) {
    #search-input{
        max-width: 100%;
    }
}