/* خلفية المودال بتغبيش ناعم */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: all 0.3s ease;
}

/* محتوى المودال */
.modal {
  position: relative;
  background: #fff;
  padding: 25px 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  animation: modalShow 0.3s ease;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ✅ حركة ظهور المودال */
@keyframes modalShow {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ✅ زر الإغلاق (في الركن العلوي الأيمن) */
.closeModal {
  position: fixed;
  /* مثبت داخل الشاشة وليس داخل المحتوى */
  top: 25px;
  right: 25px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  /* فوق المودال نفسه */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.closeModal:hover {
  background: #c0392b;
  transform: scale(1.1) rotate(10deg);
}

/* النصوص والمحتوى */
.modal h3 {
  margin-bottom: 10px;
  color: #222;
  text-align: center;
}

.modal p {
  color: #444;
  font-size: 15px;
  margin-bottom: 10px;
  line-height: 1.7;
}

/* الحقول */
.modal input[type="text"],
.modal input[type="tel"],
.modal textarea,
.modal input[type="file"] {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 10px;
  resize: none;
  text-align: right;
  direction: rtl;
}

/* الأزرار */
.modal button,
.modal a {
  display: block;
  width: 100%;
  text-align: center;
  background: #007c69;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s;
  text-decoration: none;
}

.modal button:hover,
.modal a:hover {
  background: #005f50;
  transform: translateY(-2px);
}

/* ✅ توافق مع الجوال */
@media (max-width: 500px) {
  .modal {
    padding: 20px;
    max-width: 95%;
  }

  .closeModal {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .modal h3 {
    font-size: 17px;
  }

  .modal button,
  .modal a {
    font-size: 15px;
  }
}

/* خلفية شفافة بتغبيش */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: all 0.3s ease;
}

/* المودال */
.modal {
  position: relative;
  background: #fff;
  padding: 25px 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  animation: modalShow 0.3s ease;
  text-align: right;
}

/* حركة ظهور */
@keyframes modalShow {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ✅ زر الإغلاق */
.closeModal {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #28a745;
  /* أخضر افتراضي */
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.closeModal:hover {
  background: #218838;
  transform: scale(1.05);
}

.closeModal:active {
  background: #e74c3c;
  /* 🔴 أحمر عند الضغط */
  transform: scale(0.95);
}

/* ✅ متجاوب */
@media (max-width: 500px) {
  .modal {
    padding: 20px;
    max-width: 95%;
  }

  .closeModal {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}