/* ============================================
   Stats Section CSS
   ============================================ */

.stats-section {
  background-color: #f6f8fd;
  padding: 60px 20px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

.stats-header {
  text-align: center;
  margin-bottom: 50px;
}

.stats-title {
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  padding: 0 20px;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  justify-items: center;
}

/* First 3 items in first row */
.stats-container .stat-item:nth-child(1),
.stats-container .stat-item:nth-child(2),
.stats-container .stat-item:nth-child(3) {
  grid-row: 1;
}

/* Last 2 items in second row - flipped pyramid (pushed toward center) */
.stats-container .stat-item:nth-child(4) {
  grid-row: 2;
  grid-column: 1 / 2;
  justify-self: end;
  padding-right: 60px;
}

.stats-container .stat-item:nth-child(5) {
  grid-row: 2;
  grid-column: 3 / 4;
  justify-self: start;
  padding-left: 60px;
  box-sizing: border-box;
}

/* Prevent overflow on medium screens */
@media (max-width: 1200px) {
  .stats-container .stat-item:nth-child(4) {
    padding-right: 30px;
  }
  
  .stats-container .stat-item:nth-child(5) {
    padding-left: 30px;
  }
}

.stat-item {
  text-align: center;
  padding: 20px 15px;
  width: 100%;
  max-width: 220px;
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-icon {
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stat-icon svg {
  width: 50px;
  height: 50px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  font-family: "Open Sans", sans-serif;
  line-height: 1.2;
}

.stat-value {
  display: inline-block;
}

.stat-suffix {
  display: inline-block;
  font-size: 1.7rem;
  margin-left: 2px;
}

.stat-label {
  font-size: 1rem;
  color: #666;
  font-weight: 300;
  font-family: "Noto Sans Hebrew", "Open Sans", sans-serif;
  margin-top: 8px;
}

/* RTL Support */
.stats-container[dir="rtl"] .stat-item {
  direction: rtl;
}

.stats-container[dir="ltr"] .stat-item {
  direction: ltr;
}

/* ========== RESPONSIVE STYLES ========== */

/* Large Tablet */
@media (max-width: 1024px) {
  .stats-section {
    padding: 40px 20px;
  }
  
  .stats-header {
    margin-bottom: 40px;
  }
  
  .stats-title {
    font-size: 2rem;
  }
  
  .stats-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
  
  .stats-container .stat-item:nth-child(4) {
    grid-column: 1 / 2;
    justify-self: end;
    padding-right: 20px;
  }
  
  .stats-container .stat-item:nth-child(5) {
    grid-column: 3 / 4;
    justify-self: start;
    padding-left: 20px;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-suffix {
    font-size: 1.4rem;
  }
  
  .stat-label {
    font-size: 0.95rem;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .stats-section {
    padding: 35px 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .stats-header {
    margin-bottom: 35px;
  }
  
  .stats-title {
    font-size: 1.8rem;
  }
  
  .stats-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Reset flipped pyramid on tablet - show all 5 items in grid */
  .stats-container .stat-item:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    padding-right: 0;
    padding-left: 0;
  }
  
  .stats-container .stat-item:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    padding-left: 0;
    padding-right: 0;
  }
  
  .stat-item {
    padding: 15px 12px;
    max-width: 180px;
  }
  
  .stat-icon svg {
    width: 45px;
    height: 45px;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .stat-suffix {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.9rem;
  }
}

/* Mobile Landscape */
@media (max-width: 640px) {
  .stats-section {
    padding: 35px 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Reset all grid positions for 2-column layout */
  .stats-container .stat-item:nth-child(1),
  .stats-container .stat-item:nth-child(2),
  .stats-container .stat-item:nth-child(3),
  .stats-container .stat-item:nth-child(4),
  .stats-container .stat-item:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }
  
  .stat-item {
    max-width: 180px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .stats-section {
    padding: 30px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .stats-header {
    margin-bottom: 30px;
  }
  
  .stats-title {
    font-size: 1.5rem;
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0 auto;
  }
  
  /* 2-2-1 layout: First 2 items in row 1, next 2 in row 2, last 1 in row 3 */
  .stats-container .stat-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  
  .stats-container .stat-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  
  .stats-container .stat-item:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }
  
  .stats-container .stat-item:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    padding-left: 0;
    padding-right: 0;
  }
  
  .stats-container .stat-item:nth-child(5) {
    grid-column: 1 / 3; /* Span both columns */
    grid-row: 3;
    justify-self: center;
    padding-left: 0;
    padding-right: 0;
  }
  
  .stat-item {
    max-width: 100%;
    width: 100%;
    padding: 15px 8px;
    justify-self: center;
  }
  
  .stat-icon svg {
    width: 40px;
    height: 40px;
  }
  
  .stat-number {
    font-size: 1.6rem;
  }
  
  .stat-suffix {
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.85rem;
  }
}

