.team-section {
  font-family: 'Vazir', sans-serif;
  direction: rtl;
  background: #1c1c1c;
  padding: 40px 0;
  color: #ccc;
  margin-top: -50px;
}

.team-section .container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.team-section h2 {
  font-size: 2.2em;
  letter-spacing: 1px;
  margin-bottom: 40px;
  text-align: right;
  color: #d4af37;
}

/* ---------- Grid Layout for 4 Columns by Default ---------- */
.team-section .team-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
}

/* ---------- Member Cards ---------- */
.team-section .member {
  padding: 12px;
  background: transparent;
  border: 1px solid #444;
  border-radius: 12px;
  color: #ccc;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
  transition: transform 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.team-section .member:nth-child(1) { animation-delay: 0.1s; }
.team-section .member:nth-child(2) { animation-delay: 0.2s; }
.team-section .member:nth-child(3) { animation-delay: 0.3s; }
.team-section .member:nth-child(4) { animation-delay: 0.4s; }
.team-section .member:nth-child(5) { animation-delay: 0.5s; }
.team-section .member:nth-child(6) { animation-delay: 0.6s; }
.team-section .member:nth-child(7) { animation-delay: 0.7s; }

.team-section .member:hover {
  transform: translateY(-10px);
  border-color: #fff;
  color: #fff;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.team-section .member img {
  width: 100%;
  height: auto;
  filter: grayscale(100%);
  border-radius: 8px;
  transition: filter 0.4s ease;
}

.team-section .member:hover img {
  filter: grayscale(0%);
}

.team-section .name {
  margin-top: 15px;
  font-weight: bold;
  text-align: right;
}

.team-section .title {
  font-style: normal;
  margin: 4px 0;
  color: #aaa;
  text-align: right;
}

.team-section .degree {
  font-size: 0.9em;
  color: #bbb;
  margin: 6px 0 10px;
  text-align: right;
}

/* استایل آیکن‌ها */
.team-section .email-icon {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.team-section .email-icon a {
  display: inline-block;
  transition: transform 0.3s ease;
}

.team-section .email-icon a .icon {
  width: 24px;
  height: 24px;
  display: block;
}

.team-section .email-icon a:hover {
  transform: scale(1.1);
}

/* ---------- Responsive Breakpoints ---------- */
/* Mobile: 2 columns */
@media (max-width: 768px) {
  .team-section .team-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-section h2 {
    text-align: center;
  }
}

/* Tablet: 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
  .team-section .team-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Small Desktop: 4 columns (default) */
@media (min-width: 1025px) and (max-width: 1366px) {
  .team-section .team-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Large Desktop: 4 columns */
@media (min-width: 1367px) {
  .team-section .team-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}