:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-card: rgba(15, 23, 42, 0.96);
  --bg-card-soft: rgba(15, 23, 42, 0.9);
  --border-subtle: rgba(148, 163, 184, 0.3);
  --border-strong: rgba(148, 163, 184, 0.6);
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-strong: rgba(59, 130, 246, 0.4);
  --accent-grad-1: #3b82f6;
  --accent-grad-2: #6366f1;
  --accent-grad-3: #22c55e;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --danger-strong: rgba(248, 113, 113, 0.45);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;
}

/* RESET بسيط */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a, #020617 52%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* RTL دعم بسيط */
html[dir="rtl"] body {
  direction: rtl;
}

/* روابط */
a {
  color: var(--accent);
  text-decoration: none;
}


/* حاوية عامة */
.container {
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.88),
    transparent
  );
  backdrop-filter: blur(26px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 12px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: conic-gradient(
    from 200deg,
    #22c55e,
    #3b82f6,
    #6366f1,
    #22c55e
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #0b1120;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9),
    0 12px 30px rgba(15, 23, 42, 0.9);
}
.brand-logo::before {
  content: "DA";
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
}

/* اختيار اللغة */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top left, #0b1120, #020617);
}

.lang-label span {
  color: var(--text-muted);
  font-size: 12px;
}

.lang-label select {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding-inline: 4px;
}

/* صفحة */
.page-main {
  padding: 24px 0 40px;
}

/* HERO */
.hero {
  position: relative;
  padding: 32px 20px 28px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.2), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(34, 197, 94, 0.15), transparent 52%),
    linear-gradient(145deg, #020617, #020617 40%, #020617 70%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-text h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 5vw, 32px);
  letter-spacing: 0.02em;
}

.hero-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* خلفية خفيفة */
.hero-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(circle at 10% 0, rgba(56, 189, 248, 0.15), transparent 50%),
    radial-gradient(circle at 95% 90%, rgba(45, 212, 191, 0.2), transparent 45%);
}

/* نموذج الفحص */
.analyze-form {
  position: relative;
  margin-top: 20px;
  z-index: 1;
}

.input-group {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.url-input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top left, #020617, #020617);
  color: var(--text);
  font-size: 14px;
}
.url-input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}
.url-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

/* زر رئيسي */
.btn-primary {
  position: relative;
  border: none;
  outline: none;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  background: linear-gradient(
    120deg,
    var(--accent-grad-1),
    var(--accent-grad-2),
    var(--accent-grad-3)
  );
  color: #f9fafb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.45);
  border: 1px solid rgba(15, 23, 42, 0.9);
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn-primary.disabled {
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-text {
  position: relative;
  z-index: 1;
}

/* سبنر صغير داخل الزر */
.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.7);
  border-top-color: #f9fafb;
  opacity: 0;
  transform: scale(0.2);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn-primary.loading .btn-spinner {
  opacity: 1;
  transform: scale(1);
  animation: spin 0.9s linear infinite;
}

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

/* رسالة خطأ */
.alert-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.5);
}

/* GRID */
.grid {
  display: grid;
}
.grid-2 {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}
.gap-lg {
  gap: 18px;
}
.m-top-lg {
  margin-top: 22px;
}

/* كروت عامة */
.card {
  position: relative;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px 14px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at top right,
    rgba(59, 130, 246, 0.08),
    transparent 55%
  );
  opacity: 0.9;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5e7eb;
}

/* HEADER التقرير */
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.back-link {
  font-size: 13px;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top, #020617, #020617);
  text-decoration: none;
}
.back-link:hover {
  border-color: var(--accent);
}

.report-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-title h1 {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.open-site {
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, #020617, #020617);
  color: var(--text);
  text-decoration: none;
}
.open-site:hover {
  border-color: var(--accent);
}

/* مشاركة الرابط */
.share-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 3px 3px 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top left, #020617, #020617);
}

.share-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  width: 180px;
}

.btn-copy {
  border: none;
  outline: none;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  cursor: pointer;
}
.btn-copy:hover {
  background: rgba(30, 64, 175, 0.9);
}

/* مؤشرات رئيسية */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-circle {
  text-align: center;
}

.circle {
  width: 60px;
  height: 60px;
  margin-inline: auto 0;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: #f9fafb;
  background: radial-gradient(circle at top, #020617, #020617);
}
.metric-circle p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Core Web Vitals */
.core-web-vitals {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 22px;
  font-size: 12px;
}
.core-web-vitals .label {
  color: var(--text-muted);
}
.core-web-vitals .value {
  font-weight: 500;
}

/* Info list */
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.info-list .label {
  color: var(--text-muted);
}
.info-list .value {
  text-align: right;
}

/* Issues */
.issues-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.issues-list li {
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 12px;
}
.issue-title {
  font-weight: 500;
}
.issue-score {
  margin-top: 3px;
  font-size: 11px;
  color: #fecaca;
}
.issue-desc {
  margin-top: 4px;
  color: var(--text-muted);
}

/* Badges للألوان */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
}

.badge-good {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.4);
}

.badge-medium {
  background: rgba(234, 179, 8, 0.12);
  color: #fef3c7;
  border-color: rgba(234, 179, 8, 0.4);
}

.badge-bad {
  background: rgba(248, 113, 113, 0.12);
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.4);
}

/* Large images */
.large-images {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.large-images h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.large-images ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.large-images li {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.large-img-size {
  color: #fecaca;
}

.large-img-src {
  color: var(--text-muted);
  word-break: break-all;
}

/* قائمة آخر المواقع */
.recent-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.recent-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.recent-url {
  color: #e5e7eb;
  text-decoration: none;
}
.recent-url:hover {
  color: var(--accent);
}
.recent-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding: 14px 0 20px;
  background: radial-gradient(circle at top, #020617, #020617);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  gap: 8px;
}

/* RESPONSIVE */
@media (max-width: 840px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-header {
    flex-direction: column;
    align-items: stretch;
  }
  .report-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .share-input {
    width: 140px;
  }
}

@media (max-width: 600px) {
  .nav-inner {
    padding: 8px 0 9px;
  }

  .hero {
    padding: 22px 16px 18px;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary {
    justify-content: center;
    padding-block: 9px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}



.thumb-box {
  text-align: center;
  margin: 16px 0;
}




.thumb {
  
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  margin: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
 max-width: 300px;
    max-height: 170px;
}
.preview-row {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
}



.btn-rescan {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, #0b1120, #020617);
  color: #e5e7eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-rescan:hover {
  border-color: #3b82f6;
  text-decoration: none;
}

.scan-progress {
  /* position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%); */
  z-index: 9999;
  width: 100%;
}

.scan-progress.hidden {
  display: none;
}

.scan-progress-inner {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.scan-progress-label {
  font-size: 11px;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.scan-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(30, 64, 175, 0.4);
  border-radius: 999px;
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
  transition: width 0.25s ease-out;
}
