/*
 * WebPlus — Chapter 9: WebPlus Score Styles (أداة فحص الموقع)
 * واجهة فحص عصرية مع تأثير مسح راداري (Radar Sweep) ولوحة نتائج تفاعلية
 * بادئة الأصناف: wx-
 */

.wx-audit-section {
  position: relative;
  background-color: var(--wx-navy);
  color: var(--wx-snow);
  padding-block: var(--wx-sec-pad);
  overflow: hidden;
}

.wx-audit-header {
  margin-bottom: var(--wx-head-gap);
}

.wx-audit-box {
  max-width: 860px;
  margin-inline: auto;
  background: rgba(5, 14, 36, 0.85);
  border: 1px solid var(--wx-border-dark);
  border-radius: var(--wx-radius-xl);
  padding: clamp(28px, 5vw, 56px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.wx-audit-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--wx-sky), transparent);
}

/* شريط إدخال الرابط */
.wx-audit-form {
  width: 100%;
}

.wx-audit-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(7, 21, 48, 0.95);
  border: 1.5px solid var(--wx-border-dark);
  border-radius: var(--wx-radius-lg);
  padding: 8px 12px 8px 20px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wx-audit-input-wrap:focus-within {
  border-color: var(--wx-blue);
  box-shadow: 0 0 24px rgba(0, 102, 255, 0.3);
}

.wx-audit-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--wx-snow);
  font-family: var(--wx-font-lat);
  font-size: 16px;
  padding: 10px 0;
  direction: ltr;
}

.wx-audit-input::placeholder {
  color: var(--wx-slate-500);
}

/* كارت النتيجة التوضيحي المرئي مسبقاً */
.wx-audit-sample-preview {
  margin-top: 28px;
  background: rgba(7, 21, 48, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--wx-radius-lg);
  padding: 20px 24px;
  transition: opacity 0.3s ease;
}

.wx-audit-sample-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--wx-slate-300);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wx-audit-sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}

.wx-sample-card {
  background: rgba(5, 14, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wx-sample-val {
  font-family: var(--wx-font-lat);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.wx-sample-lbl {
  font-size: 11px;
  color: var(--wx-slate-400);
  font-weight: 600;
}

/* حالة جاري الفحص مع المسح الراداري */
.wx-audit-scanning-view {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 40px;
  text-align: center;
}

.wx-radar-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-radar-container::after {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.25);
}

.wx-radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 102, 255, 0.4) 0deg, transparent 60deg, transparent 360deg);
  animation: wxRadarSweep 1.8s linear infinite;
}

@keyframes wxRadarSweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.wx-audit-scan-status-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--wx-sky);
  margin-bottom: 6px;
}

/* لوحة النتائج */
.wx-audit-results-view {
  display: none;
  flex-direction: column;
  gap: 32px;
  animation: wxFadeIn 0.5s ease forwards;
}

.wx-audit-results-summary {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--wx-border-dark);
}

.wx-audit-overall-score {
  text-align: center;
  padding: 24px;
  background: rgba(7, 21, 48, 0.8);
  border: 1px solid var(--wx-border-dark);
  border-radius: var(--wx-radius-lg);
}

.wx-audit-score-number {
  font-family: var(--wx-font-lat);
  font-size: clamp(48px, 7vw, 68px);
  font-weight: 900;
  line-height: 1;
  margin-block: 8px 4px;
}

.wx-audit-score-number--good { color: var(--wx-success); }
.wx-audit-score-number--avg  { color: #F59E0B; }
.wx-audit-score-number--bad  { color: #EF4444; }

.wx-audit-cats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.wx-audit-cat-box {
  background: rgba(7, 21, 48, 0.6);
  border: 1px solid var(--wx-border-dark);
  border-radius: var(--wx-radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wx-audit-cat-label {
  font-size: 13px;
  color: var(--wx-slate-300);
}

.wx-audit-cat-val {
  font-family: var(--wx-font-lat);
  font-size: 18px;
  font-weight: 800;
}

/* قائمة التحسينات والفرص */
.wx-audit-opps-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wx-audit-opp-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(7, 21, 48, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--wx-radius-md);
}

.wx-audit-opp-impact {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wx-audit-opp-impact--high {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.wx-audit-opp-impact--med {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.wx-audit-actions-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
}

@media (max-width: 768px) {
  .wx-audit-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .wx-audit-results-summary {
    grid-template-columns: 1fr;
  }
}
