/* ═══════════════════════════════════════════════════════════════════════════
   ABOUT PAGE STYLES - FULLY RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Layout Grid Helper (NEW) ─── */
/* استخدم هذا الكلاس للأقسام التي تحتوي على كروت متعددة */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

/* ─── Stats Cards ─── */
.stat-card {
  background: white;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  text-align: center;
  transition: all 0.3s ease;
  /* Flex layout for better centering */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

html.dark .stat-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(148, 163, 184, 0.1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

.stat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 12px;
  color: white;
  flex-shrink: 0; /* Prevent shrinking on small screens */
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
}

html.dark .stat-label {
  color: #94a3b8;
}

/* ─── Feature Cards ─── */
.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.3s ease;
  height: 100%; /* Ensure equal height in grid */
}

html.dark .feature-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(148, 163, 184, 0.1);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
}

/* ─── Architecture Diagram ─── */
.architecture-diagram {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.arch-layer {
  background: white;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-radius: 1.5rem;
  padding: 2rem;
  transition: all 0.3s ease;
}

html.dark .arch-layer {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(59, 130, 246, 0.3);
}

.arch-layer:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.arch-layer-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #3b82f6;
  text-align: center;
}

.arch-components {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.arch-component {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #3b82f6;
  /* Prevent text wrapping inside pill */
  white-space: nowrap;
}

html.dark .arch-component {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.arch-arrow {
  display: flex;
  justify-content: center;
  color: #3b82f6;
  font-size: 1.5rem;
}

/* ─── Security Cards ─── */
.security-card {
  background: white;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(34, 197, 94, 0.2);
  transition: all 0.3s ease;
  overflow: hidden; /* Contains overflowing code blocks */
}

html.dark .security-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(34, 197, 94, 0.2);
}

.security-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.4);
}

.security-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 1rem;
}

.code-preview {
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
  background: #1e293b; /* Fallback dark bg */
  width: 100%;
}

.code-preview pre {
  margin: 0 !important;
  font-size: 0.75rem !important;
  max-height: 200px;
  overflow-y: auto; /* Vertical scroll */
  overflow-x: auto; /* Horizontal scroll for long lines */
  padding: 1rem;
  white-space: pre; /* Keeps code formatting */
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #22c55e;
  max-width: 100%;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 0.75rem;
  font-weight: 600;
  word-break: break-word; /* Prevents long text overflow */
}

html.dark .checklist-item {
  background: rgba(30, 41, 59, 0.5);
}

/* ─── Tech Stack ─── */
.tech-category {
  background: white;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  height: 100%;
}

html.dark .tech-category {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(148, 163, 184, 0.1);
}

.tech-category-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #3b82f6;
}

.tech-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tech-item:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateX(-4px);
}

/* ─── Component Cards ─── */
.component-card {
  background: white;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

html.dark .component-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(148, 163, 184, 0.1);
}

.component-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 1rem;
  flex-wrap: wrap; /* Allow buttons to wrap on mobile */
  gap: 1rem;
}

.demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.demo-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
}

.demo-btn-search {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.demo-btn-attach {
  background: rgba(148, 163, 184, 0.1);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.demo-select-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  max-width: 100%;
}

.demo-select {
  background: transparent;
  border: none;
  outline: none;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE MEDIA QUERIES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet & Smaller Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .stat-card, .feature-card, .arch-layer, .security-card, .tech-category, .component-card {
    padding: 1.5rem; /* Reduce padding slightly */
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr; /* Force single column */
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .arch-layer {
    padding: 1.5rem 1rem;
  }

  .arch-components {
    /* Keeping wrap usually looks better than column for pills,
       but if you strictly want a list, use column */
    /* flex-direction: column; */
    gap: 0.5rem;
  }

  .arch-component {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .tech-items {
    gap: 0.75rem;
  }

  .component-preview {
    padding: 1.5rem 1rem;
  }

  .demo-btn {
    width: 100%; /* Full width buttons on mobile */
  }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  .stat-card, .feature-card, .security-card {
    padding: 1.25rem;
    border-radius: 1rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-icon, .feature-icon, .security-icon {
    width: 40px;
    height: 40px;
  }

  .arch-layer-title {
    font-size: 1.1rem;
  }

  .checklist-item {
    font-size: 0.9rem;
  }
}