/* ==========================================================================
   modals.css - النوافذ المنبثقة والنماذج المخصصة وقابلية التمرير (Scrolling)
   مؤسسة اللؤلؤة العقارية - PEARL REAL ESTATE
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
  max-width: 880px;
}

@keyframes modalIn {
  from { transform: scale(0.96) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ضبط عنصر form ليكون Flexbox مرن داخل Modal Card */
.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  background: linear-gradient(135deg, #7b1123 0%, #500a16 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* جسم النافذة قابل للتمرير بسلاسة تامة */
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #a33246 #f1f5f9;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}
.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: #a33246;
  border-radius: 8px;
  border: 2px solid #f1f5f9;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: #7b1123;
}

.modal-footer {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* تبويبات النوافذ المنبثقة */
.modal-tabs-strip {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.modal-tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-tab-btn.active {
  color: var(--primary-burgundy);
  border-bottom-color: var(--primary-burgundy);
}

/* منطقة رفع الملفات (Drag & Drop Uploader) */
.dropzone-box {
  border: 2px dashed var(--accent-gold);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-box:hover {
  background: var(--primary-burgundy-soft);
  border-color: var(--primary-burgundy);
}

.dropzone-icon {
  font-size: 2.2rem;
  color: var(--primary-burgundy);
}

.dropzone-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
