/* ==========================================================================
   بطاقات أدوات تحليل الموقع ودليل الاستخدام
   مستخرج من directory.css القديم ضمن إعادة تنظيم نظام التصميم
   ========================================================================== */
/* Site Analysis Tools Cards */
.analysis-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s, border-color 0.35s;
  box-shadow: var(--elev-1);
}

.tool-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--elev-3), 0 0 20px rgba(2, 132, 199, 0.18);
  transform: translateY(-7px) scale(1.012);
}

/* المعاينة المصغرة للرسم الهندسي (SVG Preview Header) */
.tool-preview-svg {
  height: 130px;
  background: linear-gradient(135deg, rgba(14, 22, 41, 0.96), rgba(7, 12, 24, 0.98));
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .tool-preview-svg {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.98), rgba(226, 232, 240, 0.95));
}

.tool-preview-svg .svg-visual {
  width: 100%;
  height: 100%;
  max-height: 120px;
  transition: transform 0.4s ease;
}

.tool-card:hover .tool-preview-svg .svg-visual {
  transform: scale(1.05);
}

.viz-caption {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="light"] .viz-caption {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* عناصر رسومات الـ SVG والأنيميشن التفاعلي */
.viz-ring { fill: none; stroke: rgba(56, 189, 248, 0.25); stroke-dasharray: 2, 3; }
.viz-axis { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.viz-petal { fill: rgba(2, 132, 199, 0.55); stroke: #38bdf8; stroke-width: 1.2; transition: transform 0.4s; }
.viz-petal-n { fill: rgba(245, 158, 11, 0.75); stroke: #fbbf24; }
.viz-hub { fill: #38bdf8; }
.viz-label { font-size: 8px; fill: #94a3b8; font-weight: bold; text-anchor: middle; }

.tool-card:hover .viz-petal {
  transform-origin: 100px 60px;
  filter: brightness(1.2);
}

.viz-ground-disc { fill: rgba(14, 116, 144, 0.15); stroke: rgba(56, 189, 248, 0.3); stroke-dasharray: 3, 3; }
.viz-sun-arc { fill: none; stroke-width: 1.5; }
.viz-summer-arc { stroke: #f59e0b; stroke-dasharray: 4, 3; }
.viz-equinox-arc { stroke: #06b6d4; }
.viz-winter-arc { stroke: #3b82f6; stroke-dasharray: 2, 2; }
.viz-sun-node { fill: #f59e0b; filter: drop-shadow(0 0 6px #f59e0b); transition: transform 0.4s; }
.viz-sun-node-alt { fill: #06b6d4; }
.viz-building-shadow { fill: rgba(0, 0, 0, 0.35); }
.viz-zenith-line { stroke: rgba(245, 158, 11, 0.4); stroke-dasharray: 2, 2; }

.tool-card:hover .viz-sun-node {
  transform: translate(6px, -4px);
}

.viz-contour-line { fill: none; stroke: #0284c7; stroke-width: 1.4; opacity: 0.6; transition: stroke-dashoffset 0.6s; }
.viz-iso-top { fill: #0284c7; stroke: #38bdf8; stroke-width: 0.8; }
.viz-iso-left { fill: #0369a1; stroke: #0284c7; stroke-width: 0.8; }
.viz-iso-right { fill: #075985; stroke: #0284c7; stroke-width: 0.8; }

.tool-card:hover .viz-isometric-block-1 {
  transform: translate(65px, 40px);
  transition: transform 0.3s;
}

.viz-dem-layer-1 { fill: rgba(2, 132, 199, 0.2); }
.viz-dem-layer-2 { fill: rgba(14, 165, 233, 0.35); }
.viz-dem-layer-3 { fill: rgba(56, 189, 248, 0.5); }
.viz-topo-survey-line { fill: none; stroke: #f59e0b; stroke-width: 1.2; stroke-dasharray: 3, 2; }
.viz-survey-peak { fill: #ef4444; }

.viz-doc-rect { fill: var(--overlay-1); stroke: var(--border-accent); stroke-width: 1.2; }
.viz-doc-line { stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; }
.viz-node-circle { fill: #0284c7; stroke: #38bdf8; stroke-width: 1.5; }
.viz-node-edge { stroke: rgba(56, 189, 248, 0.4); stroke-width: 1; }

.viz-panel-rect { fill: var(--overlay-1); stroke: var(--border-subtle); stroke-width: 1; }
.viz-panel-line { stroke: var(--border-accent); stroke-width: 2.5; stroke-linecap: round; }

/* جسم البطاقة */
.tool-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tool-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tool-icon-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-glow);
  color: var(--on-surface-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid var(--border-accent);
  flex-shrink: 0;
  transition: transform 0.3s;
}

.tool-card:hover .tool-icon-avatar {
  transform: scale(1.1) rotate(4deg);
}

.tool-head-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.tool-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.15);
  color: var(--on-surface-accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.tool-cat-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 4px;
}

.tool-card-en {
  font-family: var(--font-latin);
  font-size: 0.8rem;
  color: var(--on-surface-primary);
  margin-bottom: 12px;
}

.tool-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tool-planning-box {
  background: var(--overlay-1);
  border-right: 3px solid var(--color-primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 18px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tool-planning-box strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tool-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* Tool Guide Modal Timeline */
.guide-lead-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 22px;
}

.guide-lead-box h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-lead-box p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.guide-steps-heading {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--scrim-1);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-latin);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-footer-action {
  text-align: center;
}

/* ==========================================================================
   أشرطة الفلاتر وأزرار التصفية الموحدة (Tools Filter Pills)
   ========================================================================== */
.curriculum-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4, 16px);
  background: var(--bg-surface, #0e1629);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 12px);
  padding: 12px 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 16px;
  background: var(--bg-card, #131e36);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--text-secondary, #cbd5e1);
  font-family: var(--font-arabic, 'Cairo', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.filter-pill-btn:hover {
  background: var(--bg-hover, #22345e);
  color: var(--text-primary, #ffffff);
  border-color: var(--color-primary, #0284c7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.filter-pill-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  font-weight: 700;
}

/* ==========================================================================
   نظام التمرير الأفقي المحمول لأدوات تحليل الموقع (Mobile Horizontal Slider)
   ========================================================================== */
@media (max-width: 768px) {
  .analysis-tools-grid {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth;
    gap: var(--space-4) !important;
    padding: var(--space-2) 16px var(--space-4) 16px !important;
    margin-inline: -16px !important;
    scrollbar-width: thin;
  }

  .analysis-tools-grid::-webkit-scrollbar {
    height: 4px;
  }

  .analysis-tools-grid::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: var(--radius-full);
  }

  .analysis-tools-grid > * {
    flex: 0 0 85% !important;
    min-width: 280px !important;
    max-width: 340px !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: normal !important;
  }

  .curriculum-controls-bar {
    padding: 10px 12px;
    gap: 12px;
  }

  .curriculum-controls-bar .filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .curriculum-controls-bar .filter-group .filter-pill-btn {
    flex-shrink: 0;
  }
}


