body {
  font-family: "Cairo", sans-serif;
  background-color: #f0f2f5;
  color: #333;
  margin: 0;
}

/* تصميم صفحة الدخول */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* تصميم عام للعناصر */
h1,
h2 {
  text-align: center;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  /* يمنع تغيير العرض عند إضافة padding */
}

button {
  width: 100%;
  padding: 12px;
  background-color: #0056b3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  background-color: #004494;
}

/* تصميم لوحة التحكم الرئيسية */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  padding: 10px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0;
}

header button {
  width: auto;
  /* يجعل الزر بحجم محتواه */
  background-color: #dc3545;
}

header button:hover {
  background-color: #c82333;
}

main {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
}

section {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- Admin Button Styling --- */
.post-item div {
  display: flex;
  gap: 10px;
}

.edit-button,
.delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  /* Unified padding */
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  color: white;
  transition: transform 0.2s;
  min-width: 90px;
  /* Set a minimum width */
}

.edit-button:hover,
.delete-button:hover {
  transform: translateY(-2px);
  /* Simple hover effect */
}

.edit-button i,
.delete-button i {
  margin-right: 8px;
  /* Correct space for RTL */
}

.edit-button {
  background-color: #0d6efd;
  /* Blue */
}

.delete-button {
  background-color: #dc3545;
  /* Red */
}

.cancel-button {
  display: inline-block;
  padding: 12px;
  background-color: #6c757d;
  /* Gray color */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  margin-left: 10px;
  /* Space between buttons */
}

.cancel-button:hover {
  background-color: #5a6268;
}

/* --- Styling for Table Header --- */
thead th {
  text-align: center;
  /* لمحاذاة كل العناوين في الوسط */
  vertical-align: middle;
}

/* --- Styling for Admin Buttons in Table (Perfectly Circular) --- */
.actions-cell {
  white-space: nowrap;
}

.actions-cell a,
.actions-cell button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  /* ✅ تحديد عرض ثابت */
  height: 32px;
  /* ✅ تحديد ارتفاع مساوٍ للعرض */
  padding: 0;
  min-width: 0;
  border: none;
  border-radius: 50%;
  /* لجعلها دائرية تمامًا */
  cursor: pointer;
  font-size: 14px;
  /* تكبير الأيقونة قليلاً */
  text-decoration: none;
  color: white;
  transition: transform 0.2s, background-color 0.2s;
  margin: 0 2px;
}

.actions-cell a:hover,
.actions-cell button:hover {
  transform: translateY(-2px);
}

.actions-cell .edit-button {
  background-color: #0d6efd;
}

.actions-cell .delete-button {
  background-color: #dc3545;
}

.actions-cell .preview-button {
  background-color: #198754;
}

.actions-cell i {
  margin: 0;
}

/* --- ✅ أكواد جديدة أضفها في نهاية الملف --- */

/* لتنسيق شعار صفحة الدخول */
.login-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
}

/* لتنسيق شعار لوحة التحكم */
.header-title {
  display: flex;
  align-items: center;
  gap: 15px; /* مسافة بين الشعار والنص */
}

.header-logo {
  height: 40px;
  width: 40px;
  border-radius: 50%;
}

header h1 {
  margin: 0;
  font-size: 1.5rem; /* تعديل حجم الخط ليتناسب */
}
.featured-image-control {
  display: flex;
  gap: 10px;
}

/* --- ✅ 4. أكواد جديدة لتحسين عرض الجدول في الشاشات الصغيرة --- */

@media (max-width: 768px) {
  /* إخفاء رأس الجدول التقليدي */
  .table thead {
    display: none;
  }

  /* تحويل الجدول والصفوف إلى كتل */
  .table,
  .table tbody,
  .table tr {
    display: block;
  }

  .table tr {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  /* تحويل الخلايا إلى كتل وإضافة عنوان لكل خلية */
  .table td {
    display: block;
    text-align: right; /* محاذاة النص لليمين */
    border: none;
    border-bottom: 1px solid #eee;
    padding-left: 50%; /* مساحة لإظهار العنوان */
    position: relative;
  }

  .table td:before {
    content: attr(data-label); /* جلب العنوان من خاصية data-label */
    position: absolute;
    left: 0.5rem;
    width: 45%;
    padding-right: 0.5rem;
    font-weight: bold;
    text-align: left; /* محاذاة العنوان لليسار */
  }

  .table td:last-child {
    border-bottom: none;
  }

  .actions-cell {
    text-align: center !important; /* توسيط أزرار الإجراءات */
    padding-left: 0 !important;
  }

  .actions-cell:before {
    display: none; /* إخفاء عنوان خلية الإجراءات */
  }
}
