/* public_html/assets/css/support/tickets/report_modal.css */

/* ===================== أساسيات عامة ===================== */

.svx-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none; /* يُفعّل عند إزالة hidden في الـ JS */
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.svx-report-overlay:not([hidden]) {
  display: flex;
}

.svx-report-modal {
  --svx-report-primary: #0b5cab;
  --svx-report-primary-soft: #e9f3ff;
  --svx-report-ink: #0f2233;
  --svx-report-muted: #6b7280;
  --svx-report-danger: #b91c1c;
  --svx-report-success: #047857;
  --svx-report-border: #d4e1f5;
  --svx-report-bg-soft: #f7f9fc;

  direction: rtl;
  text-align: right;
  background-color: #ffffff;
  width: min(640px, 96vw);
  max-height: 90vh;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
}

.svx-report-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  color: var(--svx-report-ink);
  font-size: 14px;
}

/* ===================== الهيدر ===================== */

.svx-report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px dashed #0b5cab;
  background-color: #e3f2ff; /* أزرق سماوي خفيف */
  color: #0b2957;
}

.svx-report-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.svx-report-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px dashed #0b5cab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.svx-report-icon-mark {
  font-weight: 800;
  font-size: 18px;
  color: #0b5cab;
}

.svx-report-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.svx-report-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.svx-report-subtitle {
  margin: 0;
  font-size: 12px;
  color: #1f2933;
}

/* زر الإغلاق */

.svx-report-close {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.08s ease,
    box-shadow 0.15s ease;
}

.svx-report-close:hover {
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

/* ===================== الجسم ===================== */

.svx-report-body {
  padding: 14px 18px 10px;
  overflow-y: auto;
  background: #f9fafb;
  flex: 1 1 auto;  /* مهم لتمدد الجسم داخل المودال */
  min-height: 0;   /* مهم مع flex حتى لا يكسر التخطيط */
}

/* شريط نوع البلاغ */

.svx-report-banner {
  border-radius: 12px;
  padding: 10px 12px;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.5);
  margin-bottom: 12px;
}

.svx-report-banner-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.svx-report-banner-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--svx-report-muted);
}

.svx-report-banner-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--svx-report-primary);
}

.svx-report-banner-hint {
  margin: 0;
  font-size: 11px;
  color: var(--svx-report-muted);
}

/* الأقسام */

.svx-report-section {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.55);
}

.svx-report-section:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.svx-report-section-header {
  margin-bottom: 6px;
}

.svx-report-section-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--svx-report-ink);
}

.svx-report-section-help {
  margin: 0;
  font-size: 12px;
  color: var(--svx-report-muted);
}

/* حقل عام */

.svx-report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* قائمة منسدلة (تصنيف + أولوية) */

.svx-report-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--svx-report-ink);
}

.svx-report-select {
  border-radius: 10px;
  border: 1px solid var(--svx-report-border);
  padding: 7px 9px;
  background-color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.svx-report-select:focus {
  border-color: var(--svx-report-primary);
  box-shadow: 0 0 0 1px rgba(11, 92, 171, 0.2);
  background-color: #ffffff;
}

/* حقل الوصف */

.svx-report-textarea {
  width: 100%;
  margin-top: 6px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid var(--svx-report-border);
  background-color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 88px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.svx-report-textarea:focus {
  border-color: var(--svx-report-primary);
  box-shadow: 0 0 0 1px rgba(11, 92, 171, 0.2);
}

/* صف التلميح والعداد */

.svx-report-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 8px;
}

.svx-report-hint {
  font-size: 11px;
  color: var(--svx-report-muted);
}

.svx-report-counter {
  font-size: 11px;
  color: var(--svx-report-muted);
}

/* الإرفاق */

.svx-report-attach-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.svx-report-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px dashed rgba(15, 23, 42, 0.35);
  background-color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.svx-report-attach-btn:hover {
  background-color: #eff6ff;
  border-color: #0b5cab;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.svx-report-attach-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.svx-report-attach-label-text {
  white-space: nowrap;
}

.svx-report-attach-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  background-color: #f9fafb;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 5px 8px;
}

/* إخفاء حاوية المرفق (الاسم + سلة المهملات) عندما تكون مخفية بالـ hidden */
.svx-report-attach-meta[hidden],
#svx-report-attachment-meta[hidden] {
  display: none !important;
}

.svx-report-attach-name {
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.svx-report-attach-remove {
  border: none;
  background: transparent;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.svx-report-attach-remove-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* رسائل الأخطاء والنجاح */

.svx-report-field-error {
  margin-top: 5px;
  font-size: 11px;
  color: var(--svx-report-danger);
}

.svx-report-global-error,
.svx-report-global-success {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.svx-report-global-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.svx-report-global-success {
  background-color: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* ===================== الفوتر والأزرار ===================== */

.svx-report-footer {
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(212, 225, 245, 0.9);
  background-color: #f3f4f6;
  display: flex !important;      /* إجبار الظهور */
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;                /* يمنع الفوتر من الانضغاط */
  visibility: visible !important;
  height: auto !important;
}

/* حماية قوية على الأزرار داخل الفوتر من أي قواعد عامة */
.svx-report-footer #svx-report-submit-btn,
.svx-report-footer #svx-report-cancel-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
}

/* عند التعطيل */
.svx-report-footer #svx-report-submit-btn[disabled],
.svx-report-footer #svx-report-cancel-btn[disabled] {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 0.7 !important;
  cursor: default !important;
}

.svx-report-btn {
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
  font-family: inherit;
  white-space: nowrap;
}

.svx-report-btn-primary {
  background-color: #0b5cab;
  color: #f9fafb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.22);
}

.svx-report-btn-primary:hover:not(:disabled) {
  background-color: #0a4f95;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.26);
  transform: translateY(-1px);
}

.svx-report-btn-primary:disabled {
  box-shadow: none;
  transform: none;
}

.svx-report-btn-ghost {
  background-color: #ffffff;
  color: var(--svx-report-ink);
  border-color: rgba(148, 163, 184, 0.6);
}

.svx-report-btn-ghost:hover {
  background-color: #f9fafb;
}

/* سبنر زر الإرسال */

.svx-report-btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(241, 245, 249, 0.85);
  border-inline-start-color: #ffffff;
  animation: svx-report-spin 0.8s linear infinite;
}

@keyframes svx-report-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===================== استجابة الشاشات الصغيرة ===================== */

@media (max-width: 480px) {
  .svx-report-modal {
    width: 94vw;
    max-height: 70vh;   /* تحجيم المودال على الجوال */
  }

  .svx-report-header {
    padding: 10px 12px 8px;
  }

  .svx-report-body {
    padding: 10px 12px 8px;
  }

  .svx-report-title {
    font-size: 15px;
  }

  .svx-report-subtitle {
    font-size: 11px;
  }

  .svx-report-footer {
    justify-content: space-between;
  }

  .svx-report-btn {
    padding-inline: 12px;
    font-size: 12px;
  }
}
