/* - التنسيقات العامة والمحسنة */
.gpm-search-container {
    max-width: 800px;
    margin: 20px auto;
    font-family: inherit;
    direction: rtl;
}

.gpm-search-form {
    display: flex;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: visible; /* هام لضمان ظهور القائمة المنسدلة */
    background: #fff;
    border: 1px solid #ddd;
}

.gpm-search-select {
    padding: 12px 15px;
    border: none;
    border-left: 1px solid #ddd;
    background: #f9f9f9;
    color: #333;
    font-weight: bold;
    border-radius: 0 8px 8px 0;
    outline: none;
    cursor: pointer;
}

.gpm-input-wrapper {
    flex-grow: 1;
    position: relative;
}

.gpm-search-input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
}

/* - تعديل لون الزر وتنسيقه */
.gpm-search-button {
    padding: 12px 25px;
    border: none;
    background: #0C0C4C; /* اللون الكحلي الخاص بالمعهد */
    color: #fff;
    font-weight: bold;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gpm-search-button:hover {
    background: #08083a;
}

/* - تنسيق أيقونة العدسة */
.gpm-search-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* --- تنسيق نتائج البحث المنسدلة (AJAX) --- */
.gpm-ajax-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    display: none;
    overflow: hidden; /* لضمان عدم خروج خلفية العنصر عن حدود الانحناء */
}

.gpm-ajax-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gpm-ajax-results li {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.gpm-ajax-results li:last-child {
    border-bottom: none;
}

/* التنسيق الافتراضي للرابط داخل القائمة */
.gpm-ajax-results li a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    text-align: right;
    transition: all 0.2s ease;
}

/* --- حل مشكلة اختفاء النص عند الوقوف بالماوس (Hover) --- */
.gpm-ajax-results li:hover {
    background-color: #0C0C4C; /* تغيير الخلفية للون الكحلي */
}

.gpm-ajax-results li:hover a {
    color: #fff !important; /* إجبار النص على اللون الأبيض ليظهر فوق الخلفية الداكنة */
    padding-right: 20px; /* لمسة جمالية: إزاحة بسيطة للنص عند الوقوف */
}

/* تنسيق حالة "لا توجد نتائج" */
.gpm-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* - تنسيق مظهر الصندوق في الهواتف */
@media (max-width: 600px) {
    .gpm-search-form {
        flex-direction: row; /* الحفاظ على التخطيط الأفقي */
    }
    
    .gpm-search-select {
        padding: 8px 10px;
        font-size: 13px;
        max-width: 100px;
    }

    .gpm-search-input {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .gpm-search-button {
        padding: 8px 15px;
    }

    /* إخفاء نص "بحث" في الزر وإبقاء أيقونة العدسة فقط في الهواتف */
    .gpm-btn-text {
        display: none;
    }
}