/* Reset default styles */

body, h1, h2, p, button, nav {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  
}
.glow-star {
  display: inline-block;
  color: gold;
  font-size: 18px;
  animation: glow 1.5s infinite ease-in-out;
}

@keyframes glow {
  0%   { text-shadow: 0 0 5px #ffd700; transform: scale(1); }
  50%  { text-shadow: 0 0 15px #fff066; transform: scale(1.2); }
  100% { text-shadow: 0 0 5px #ffd700; transform: scale(1); }
}

/* General Body Styles */
body {
  background-color: #f4f4f9;
  direction: rtl; /* تغيير اتجاه النص من اليمين لليسار */
}

/* Header Styles */
/* Header responsive layout */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background-color: #9b5f96;
  padding: 20px;
  color: white;
}



header .logo {
  display: flex;
  align-items: center;
}

header .logo-img {
  width: 40px;
  margin-left: 10px;
}

header .site-name {
  font-size: 28px;
  font-weight: bold;
  white-space: nowrap;
}

/* روابط التنقل */
header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

header nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
}



@media (max-width: 600px) {
  header {
    flex-direction: column;
    text-align: center;
  }

  header nav {
    flex-direction: column;
    gap: 8px;
  }

  header .site-name {
    font-size: 24px;
  }

  header nav a {
    font-size: 15px;
  }
}


/* الأقسام الرئيسية */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  padding: 20px;
  max-width: 1000px;
  margin: auto;
}

.category-btn {
  background-color: #9b5f96;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 22px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.category-btn:hover {
  background-color: #7a4470;
}

/* تحسين العرض في الجوال */
@media (max-width: 600px) {
  .categories {
    grid-template-columns: repeat(2, 1fr); /* عمودين فقط */
    padding: 15px;
  }

  .category-btn {
    font-size: 16px;
    padding: 12px;
  }
}

.green-coupon {
  background-color: #28a745 !important; /* اللون الأخضر */
  color: white !important;
  border: none !important;
}
.green-coupon:hover {
  background-color: #218838 !important; /* أخضر أغمق عند التمرير */
}
.golden-coupon {
  background-color: #c8c82f !important; /* اللون الأخضر */
  color: white !important;
  border: none !important;
}
.golden-coupon:hover {
  background-color: #959521 !important; /* أخضر أغمق عند التمرير */
}

.category-btn:hover {
  background-color: #7a4470;
}
h1 {
  font-size: 40px;  /* تكبير حجم الخط */
  color: #9b5f96;   /* تغيير اللون إلى #9b5f96 */
  font-weight: bold; /* إضافة وزن الخط ليكون عريضًا */
}

#sections .section-title {
  font-size: 30px;  /* تغيير حجم الخط لقسم الأمومة فقط */
  color: blue;  /* تغيير اللون الأزرق لقسم الأمومة فقط */
  font-weight: bold;
  direction: rtl;
}

#sections .add-topic-box {
  background-color: #9b5f96;  /* نفس لون الأقسام */
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  text-align: center;
}

#sections .add-topic-btn {
  background-color: #9b5f96;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#sections .add-topic-btn:hover {
  background-color: #7a4470;
}

#sections .search-input {
  width: 100%;
  padding: 10px;
  margin-top: 20px;
}

#sections table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

#sections table th, #sections table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#sections table th {
  background-color: #f4f4f4;
}

#sections .pagination a {
  color: #9b5f96;
  text-decoration: none;
  margin-left: 10px;
}

#sections .pagination a:hover {
  text-decoration: underline;
}
#register .register {
  background-color: #9b5f96;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}
/* تنسيق زر "إضافة الموضوع" */
button[type="submit"] {
  background-color: #9b5f96; /* اللون الخلفي للزر */
  color: white; /* لون النص */
  padding: 10px 20px; /* التباعد داخل الزر */
  border: none; /* إزالة الحدود الافتراضية */
  border-radius: 5px; /* جعل الزر ذو حواف مدورة */
  cursor: pointer; /* تغيير شكل المؤشر عند مرور الماوس على الزر */
  font-weight: bold; /* جعل النص عريضًا */
  font-size: 16px; /* حجم الخط */
}

button[type="submit"]:hover {
  background-color: #7a4470; /* تغيير اللون عند المرور على الزر */
}

/* General body and layout */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f9;
  margin: 0;
  padding: 0;
}

header {
  background-color: #9b5f96;
  padding: 20px;
  text-align: center;
  color: white;
}

header .logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

header .logo-img {
  width: 40px;
  margin-right: 10px;
}

header .site-name {
  font-size: 36px;
  font-weight: bold;
}

header nav a {
  color: white;
  margin: 0 15px;
  text-decoration: none;
  font-weight: bold;
}

header nav a:hover {
  text-decoration: underline;
}

main {
  padding: 40px;
  text-align: center;
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

h2 {
  color: #9b5f96;
  font-size: 30px;
  margin-bottom: 20px;
}

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

form label {
  font-weight: bold;
  text-align: right;
}

form input, form textarea, form select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 100%;
}

form button {
  background-color: #9b5f96;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

form button:hover {
  background-color: #7a4470;
}

.ad-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
}

.ad-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  width: 48%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.ad-card img {
  max-width: 100%;
  border-radius: 5px;
}

.ad-card h4 {
  color: #9b5f96;
  font-size: 22px;
  margin-top: 10px;
}

.ad-card p {
  font-size: 16px;
  margin-top: 5px;
}

footer {
  text-align: center;
  margin-top: 40px;
  color: #777;
}
.pinned {
  background-color: #fff6db;
  font-weight: bold;
}
.forum-table {
  width: 100%;
  border-collapse: collapse;
}
.forum-table th, .forum-table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: right;
}
.forum-table th {
  background-color: #e9cce2;
}
.comment-box {
  display: flex;
  margin-bottom: 15px;
  background-color: #f9e6ff;
  padding: 10px;
  border-radius: 8px;
}

.comment-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-left: 15px;
}

.comment-content {
  flex-grow: 1;
}

.comment-content strong {
  display: block;
  color: #333;
}

.comment-date {
  font-size: 0.8em;
  color: #888;
}
.comment-toolbar img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
}


/* 📱 تنسيق واجهة الجوال */
@media (max-width: 768px) {
  body {
      font-size: 16px;
      padding: 10px;
  }

  .form-container,
  .profile-box,
  .panel {
      width: 95% !important;
      padding: 15px !important;
      margin: 20px auto !important;
  }

  table {
      font-size: 14px;
      width: 100%;
  }

  table th, table td {
      padding: 8px;
  }

  .add-topic-btn,
  a.button,
  button {
      width: 100% !important;
      box-sizing: border-box;
  }

.post-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
  text-align: center;
}
  .comment-box {
      flex-direction: column;
      align-items: center;
  }

  .post-author, .comment-author {
      width: 100%;
      margin-bottom: 10px;
  }

  .post-content, .comment-content {
   width: 100%;
    text-align: center !important;
    direction: rtl;
    display: block;
    margin: 0 auto;
}


  nav {
      flex-direction: column;
      align-items: flex-start;
  }

  nav a {
      padding: 8px 0;
      width: 100%;
  }
}

/* === دعم الجوال - Responsive Form === */
@media (max-width: 768px) {
  .form-container {
      width: 90%;
      padding: 20px;
      margin: 20px auto;
  }

  input[type="text"],
  select,
  textarea,
  button {
      width: 100%;
      font-size: 16px;
      box-sizing: border-box;
  }

  button {
      padding: 12px;
  }

  label {
      display: block;
      margin-top: 10px;
      margin-bottom: 5px;
      font-weight: bold;
  }

  h2 {
      font-size: 1.4em;
      text-align: center;
  }
  .coupon-box {
    background-color: #28a745; /* أخضر مثل زر التعديل */
    color: white;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    transition: background-color 0.3s ease;
  }
  
  .coupon-box:hover {
    background-color: #218838;
    
  }
  /* ضبط العرض العام */
body, html {
  max-width: 100%;
  overflow-x: hidden;
}

/* تصغير عناصر التنقل */
nav, .top-bar, .side-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* البطاقات أو الأقسام */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px;
}

/* زر + إضافة موضوع */
.add-topic-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 10px auto;
  font-size: 16px;
  padding: 10px;
}

/* تعديل الخط وحجم النصوص */
@media (max-width: 600px) {
  h2, h3, h4 {
      font-size: 18px;
  }

  .post-box, .comment-box {
      flex-direction: column;
      align-items: center;
      text-align: center;
  }

  .post-author, .comment-author {
      width: 100%;
  }

  .post-content, .comment-content {
      width: 100%;
  }

  nav a, .top-bar a {
      font-size: 14px;
      margin: 5px;
  }
}
.topic-card {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: right;
  direction: rtl;
}

.topic-card h3 {
  color: #9b5f96;
  font-size: 20px;
  margin-bottom: 10px;
}

.topic-card p {
  font-size: 15px;
  margin: 5px 0;
}

.view-link {
  display: inline-block;
  margin-top: 10px;
  background-color: #9b5f96;
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
}

.view-link:hover {
  background-color: #7a4470;
}

/* Responsive */
@media (max-width: 600px) {
  .topic-card {
    font-size: 14px;
    padding: 12px;
  }
  .topic-card h3 {
    font-size: 18px;
  }
}
tr.clickable-row {
  cursor: pointer;
}

tr.clickable-row:hover {
  background-color: #f3d9f2;
}

/* ✅ الجوال */
@media screen and (max-width: 768px) {
  table, thead, tbody, th, td, tr {
      display: block;
  }

  thead {
      display: none;
  }

  tr {
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 8px;
      padding: 10px;
      background: white;
      cursor: pointer;
  }

  td {
      text-align: right;
      padding-right: 40%;
      position: relative;
  }

  td::before {
      content: attr(data-label);
      position: absolute;
      right: 10px;
      top: 10px;
      font-weight: bold;
      color: #893f90;
  }
}
.topics-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  max-width: 900px;
  margin: auto;
}

.topic-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: #000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  transition: background-color 0.3s ease;
}

.topic-card:hover {
  background-color: #f9e6ff;
}

.topic-title {
  font-size: 1.3em;
  font-weight: bold;
  color: #9b5f96;
  margin-bottom: 10px;
}

.topic-meta {
  font-size: 1em;
  color: #555;
  margin: 6px 0;
}

/* ✅ الجوال */
@media (max-width: 600px) {
  .topics-list {
    padding: 10px;
  }

  .topic-card {
    padding: 15px;
  }

  .topic-title {
    font-size: 1.1em;
  }

  .topic-meta {
    font-size: 0.95em;
  }
}



.banner-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin: 30px auto;
  max-width: 1000px;
}

.banner-box {
    flex: 1 1 300px;
    max-width: 450px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    text-align: center;
    padding: 0; /* إلغاء أي مساحة داخلية */
}

.banner-box img,
.banner-box video {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

@media (max-width: 768px) {
    .banner-box img,
    .banner-box video {
        height: auto;
        max-height: 180px;
    }
}



/* توسيط المواضيع ة */
.post-content, .comment-content {
   width: 100%;
    text-align: center !important;
    direction: rtl;
    display: block;
    margin: 0 auto;

}
.post-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
  text-align: center;
}
.post-content img {
  display: block !important;
  margin: 15px auto !important;
  width: 100% !important;
  max-width: 800px; /* عدّل هذا الرقم حسب الحجم الذي تريده */
  height: auto !important;
  border-radius: 10px;
  object-fit: contain;
}

/* تنسيق الإعلان الواحد ليظهر ككرت على الجوال */
@media (max-width: 768px) {
  .ad-container {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0,0,0,0.1);
    background-color: #fff;
  }

  .ad-title {
    font-size: 1.5em;
    text-align: center;
    color: #9b5f96;
  }

  .meta {
    font-size: 0.95em;
    text-align: center;
    margin-bottom: 10px;
  }

  .content {
    font-size: 1em;
    text-align: center;
  }

  .content img {
    max-width: 100%;
    height: auto;
    margin: 10px auto;
    display: block;
  }

  .back-link {
    text-align: center;
    font-size: 1.1em;
    display: block;
    margin-top: 20px;
  }
}
   /* تنسيق خاص بالجوال */
@media (max-width: 768px) {
  .ads-sidebar {
    padding: 15px;
    background: #fff;
    margin: 15px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }

  .filter-form label {
    display: block;
    margin: 10px 0 5px;
    font-size: 0.95em;
    font-weight: bold;
    color: #333;
  }

  .filter-form select {
    width: 100%;
    padding: 10px;
    font-size: 0.95em;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f9f9f9;
    appearance: none;
  }

  .filter-form button {
    width: 100%;
    padding: 12px;
    background: #8e44ad;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
  }

  .ads-sidebar h3 {
    text-align: center;
    font-size: 1.2em;
    color: #6c3483;
    margin-bottom: 20px;
  }
}
