@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400&display=swap');

body {
    font-family: cairo, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    font-size: 15px; /* حجم الخط يساوي 5% من عرض الشاشة */
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20vh; /* ارتفاع الشعار 20٪ من ارتفاع الشاشة */
    background-color: #f0f0f0;
}

.logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%; /* يجعل ارتفاع الصورة يحتل 100٪ من ارتفاع الشعار */
}

.container {
    display: inline;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    text-align: center;
}

.search-section {
    background-color: #f0f0f0; /* لون الجزء العلوي للبحث */
    padding: 10px;
    text-align: center;
}


#search-form {
    margin-bottom: 20px;
}

#results {
    overflow-x: auto;
    width: 92%;
    padding: 10px; /* تعديل التباعد حسب الحاجة */
    box-sizing: border-box;
    border: 1px solid #ccc;
    background-color: #fff;
    text-align: center;
}



/* تنسيقات مربع الإدخال */
#search-term {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 5px;
    width: 70%;
    box-sizing: border-box;
    text-align: center;
    transition: border-color 0.3s;
  margin: auto;
}

#search-term:focus {
    outline: 3px;
    border-color: #01b0f1;
}

/* تأثير مرئي لزر البحث */
#search-button {
    display: inline;
    background-color: #01b0f1;
    border: none;
    font-family: cairo, sans-serif;
    padding: 5px 5px;
    font-size: 16px;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: #01579b;
}

.table-container {
   max-height: 400px; /* ارتفاع ثابت للعنصر الذي يحتوي على الجدول */
   overflow-y: auto; /* إضافة شريط تمرير عند الحاجة */
   overflow-x: auto; /* إضافة سكرول أفقي */
   white-space: nowrap; /* منع الصفوف من الانزلاق إلى سطر جديد */
}

table {
  table-layout: auto;
  border-collapse: separate;
    margin-top: 10px;
    white-space: unset;
    width: 100%; /* عرض الجدول يساوي 90% من عرض الشاشة */
    margin: 0 auto; /* الحاشية العلوية والسفلية تساوي صفر، والحاشية الأفقية تعتمد على التوزيع التلقائي */
    margin-bottom: 50px;
  }

table th,
table td {
   text-align: center; /* محاذاة الأرقام في الوسط */
    padding: 1px;
    text-align: center;
    border: 0.5px solid #000;
    white-space: nowrap; /* منع النصوص من الانقسام إلى عدة أسطر */
}

table th {
    background-color: #e4cd70;
}

table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

table tbody tr:hover {
    background-color: #ddd;
}

tbody tr::before {
    content: counter(rowNumber);
    counter-increment: rowNumber;
}

 tr.highlighted {
    background-color: #FFD700; /* اللون الذهبي */
  }

/* تنسيق زري البحث والتفريغ والطباعة */
button {
display: inline-block;
  white-space: nowrap; /* منع الصفوف من الانزلاق إلى سطر جديد */  
  height: 40px; /* ارتفاع الزر */
    width: 200px ; /* عرض الجدول يساوي 90% من عرض الشاشة */
    background-color: #007bff;
    font-family: cairo, sans-serif;
    border: none;
    padding: 5px 5px;
    font-size: 16px;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    margin: auto;
}


button:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* تنسيق زري الطباعة والتفريغ بشكل خاص */
#clear-button,
#print-button {
    background-color: #dc3545; /* لون أحمر */
}

#clear-button:hover,
#print-button:hover {
    background-color: #c82333; /* لون أحمر داكن عند التحويل */
}

  @media print {
    /* توسيط المحتوى أفقيًا في الصفحة */
   body {
        justify-content: center;
        width: 78vh; /* املأ الشاشة بالارتفاع */
        margin: 0; /* إزالة الحاشية */
    }


    /* إخفاء العنوان h1 */
    h1 {
        display: none;
    }

    /* إظهار الجدول في منتصف الصفحة أثناء الطباعة */
    .print-section,
    .print-table {
        display: run-in !important;
        width: 100%; /* 100% عرض الصفحة */
        max-width: none;
        margin: 0 auto;
        padding: 0;
        border: none;
        overflow: visible;
    }

    /* إخفاء الأزرار ونموذج البحث */
    #search-form,
    #search-button,
    #clear-button,
    #print-button,
    .top-menu {
        display: none;
    }
}


.login-container {
    width: 80%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl; /* تغيير اتجاه النموذج إلى اليمين إلى اليسار */
    text-align: right;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    margin-bottom: 20px;
}


form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-weight: bold;
}

input[type="text"],
input[type="password"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

  /* أنماط CSS للقائمة الأفقية */
        .top-menu {
            background-color: #f2f2f2; /* لون الخلفية */
            overflow: hidden; /* للتعامل مع العناصر المحتوية التي تظهر بشكل زائد عن الشاشة */
            text-align: center; /* لجعل العناصر في المنتصف */
            border: 1px solid #ccc; /* إطار ثابت */
        }

        .top-menu ul {
            list-style-type: none; /* لإزالة النقاط أو الأرقام التي تظهر مع القائمة */
            padding: 0; /* لإزالة التباعد داخل القائمة */
            margin: 0; /* لإزالة التباعد الخارجي للقائمة */
        }

        .top-menu li {
            display: inline-block; /* لجعل العناصر تظهر بجانب بعضها البعض */
        }

        .top-menu li a {
            display: block;
            color: #333; /* لون النص */
            font-size: 14px; /* حجم الخط */
            padding: 14px 16px; /* التباعد بين النص وحواف العنصر */
            text-decoration: none; /* لإزالة أي تزيين للنص */
        }

        .top-menu li a:hover {
            background-color: #ddd; /* تغيير لون الخلفية عند تحويل الماوس */
        }