/**
 * تصميم مميز لنموذج إضافة المستخدمين
 * يعكس هيبة النظام وقوته بأسلوب احترافي
 *
 * @version 1.0
 * @author Augment Agent
 */

/* متغيرات CSS */
:root {
  --form-primary: #0f2a47;
  --form-primary-dark: #081a2d;
  --form-primary-light: #1e4976;
  --form-secondary: #f8b500;
  --form-secondary-dark: #e6a700;
  --form-secondary-light: #ffd54f;
  --form-accent: #4f46e5;
  --form-accent-light: #818cf8;
  --form-success: #10b981;
  --form-danger: #ef4444;
  --form-warning: #f59e0b;
  --form-info: #3b82f6;
  --form-text-light: #f8fafc;
  --form-text-dark: #1e293b;
  --form-gray-50: #f8fafc;
  --form-gray-100: #f1f5f9;
  --form-gray-200: #e2e8f0;
  --form-gray-300: #cbd5e1;
  --form-gray-400: #94a3b8;
  --form-gray-500: #64748b;
  --form-gray-600: #475569;
  --form-gray-700: #334155;
  --form-gray-800: #1e293b;
  --form-gray-900: #0f172a;
  --form-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --form-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --form-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --form-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --form-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --form-transition: all 0.3s ease;
  --form-border-radius: 0.75rem;
}

/* تحسين نموذج المستخدم */
.modal-content {
  background: linear-gradient(135deg, var(--form-gray-50) 0%, white 100%);
  border-radius: var(--form-border-radius);
  box-shadow: var(--form-shadow-xl);
  border: 1px solid var(--form-gray-200);
  overflow: hidden;
  position: relative;
  max-width: 600px !important;
  width: 95% !important;
  max-height: 85vh !important;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

/* رأس النموذج */
.modal-content .p-6 {
  padding: 0 !important;
}

.modal-content .flex.items-center.justify-between.mb-6 {
  background: linear-gradient(135deg, var(--form-primary) 0%, var(--form-primary-dark) 100%);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem !important;
  border-bottom: 3px solid var(--form-secondary);
  position: relative;
  overflow: hidden;
}

.modal-content .flex.items-center.justify-between.mb-6::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  20%, 100% { transform: translateX(100%); }
}

.modal-content h3 {
  color: white !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
}

.modal-content h3::before {
  content: '\f234';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-left: 0.75rem;
  font-size: 1.25rem;
  background: var(--form-secondary);
  color: var(--form-primary-dark);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* زر الإغلاق */
#closeModal {
  background-color: rgba(255, 255, 255, 0.1);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white !important;
  transition: var(--form-transition);
}

#closeModal:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* محتوى النموذج */
#userForm {
  padding: 0 1.5rem 1.5rem;
}

/* مجموعات الحقول */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
  transition: var(--form-transition);
}

.form-group:hover {
  transform: translateY(-2px);
}

/* تسميات الحقول */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--form-primary);
  font-size: 0.9rem;
  position: relative;
  padding-right: 1rem;
}

.form-label::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1rem;
  background: linear-gradient(to bottom, var(--form-secondary), var(--form-secondary-dark));
  border-radius: 2px;
}

/* حقول الإدخال */
.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--form-gray-300);
  border-radius: var(--form-border-radius);
  font-size: 0.95rem;
  transition: var(--form-transition);
  background-color: white;
  color: var(--form-gray-800);
  box-shadow: var(--form-shadow-sm);
}

.form-input:focus, .form-select:focus {
  border-color: var(--form-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  outline: none;
}

/* تنسيق خانات الاختيار */
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--form-gray-400);
  appearance: none;
  -webkit-appearance: none;
  background-color: white;
  margin-left: 0.5rem;
  position: relative;
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  background-color: var(--form-accent);
  border-color: var(--form-accent);
}

input[type="checkbox"]:checked::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
}

/* أزرار النموذج */
.modal-content button[type="submit"] {
  background: linear-gradient(135deg, var(--form-accent) 0%, var(--form-accent-light) 100%);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--form-border-radius);
  border: none;
  cursor: pointer;
  transition: var(--form-transition);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 1rem;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.modal-content button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: var(--form-transition);
}

.modal-content button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px -3px rgba(79, 70, 229, 0.5);
}

.modal-content button[type="submit"]:hover::before {
  transform: translateX(100%);
  transition: transform 1s;
}

.modal-content button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px -1px rgba(79, 70, 229, 0.4);
}

/* تنسيق قسم الصلاحيات */
.bg-indigo-50 {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  border: 2px solid #c7d2fe !important;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

.bg-indigo-50 h4 {
  color: var(--form-accent) !important;
  font-size: 1rem !important;
}

/* تنسيق خانات الصلاحيات */
.bg-white.p-2.rounded.border {
  transition: var(--form-transition);
  border-color: #ddd5fe !important;
}

.bg-white.p-2.rounded.border:hover {
  background-color: #f5f3ff !important;
  border-color: #c4b5fd !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

/* تأثيرات الحركة */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  animation: fadeInUp 0.5s forwards;
  opacity: 0;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }
.form-group:nth-child(7) { animation-delay: 0.7s; }

/* تنسيق شعار النظام في النموذج */
.modal-content .text-center.mb-6 {
  position: relative;
  padding: 1rem 0;
}

.modal-content .text-center.mb-6 img {
  transition: transform 0.5s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.modal-content .text-center.mb-6:hover img {
  transform: scale(1.05);
}

.modal-content .text-center.mb-6 .text-sm {
  font-weight: 500;
  color: var(--form-primary);
  margin-top: 0.5rem;
}

.modal-content .h-0.5.w-24 {
  margin-top: 0.75rem;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(to right, transparent, var(--form-secondary), transparent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* تنسيق التنبيهات */
.bg-yellow-50, .bg-blue-50, .bg-red-50 {
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

.bg-yellow-50::before, .bg-blue-50::before, .bg-red-50::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shine 3s infinite;
  animation-delay: 1s;
}

/* تنسيق توقيع النظام */
.modal-content .mt-8.pt-4.border-t {
  position: relative;
  animation: fadeInUp 0.5s forwards;
  animation-delay: 0.9s;
  opacity: 0;
}

.modal-content .mt-8.pt-4.border-t p {
  line-height: 1.5;
  color: var(--form-gray-500);
}

/* تنسيق زر الحفظ */
.btn-submit {
  background: linear-gradient(135deg, var(--form-accent) 0%, var(--form-accent-light) 100%);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--form-border-radius);
  border: none;
  cursor: pointer;
  transition: var(--form-transition);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: var(--form-transition);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px -3px rgba(79, 70, 229, 0.5);
}

.btn-submit:hover::before {
  transform: translateX(100%);
  transition: transform 1s;
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px -1px rgba(79, 70, 229, 0.4);
}
