/* ===========================
   TEAM SECTION - SLEEK & PROFESSIONAL
   =========================== */

/* Team Section Base */
.team.section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.team.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/><circle cx="50" cy="10" r="1" fill="%23000" opacity="0.01"/><circle cx="90" cy="40" r="1" fill="%23000" opacity="0.01"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

/* Team Member Card */
.team-member-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 0;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.team-member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.team-member-card:hover::before {
  transform: scaleX(1);
}

.team-member-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Image Container */
.member-image-container {
  position: relative;
  overflow: hidden;
  height: 280px;
  background: linear-gradient(145deg, #f0f2f5, #ffffff);
}

.member-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.member-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: grayscale(20%) brightness(1.05);
}

.team-member-card:hover .member-img {
  transform: scale(1.08);
  filter: grayscale(0%) brightness(1.1);
}

/* Overlay Effect */
.member-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.9) 0%,
    rgba(118, 75, 162, 0.9) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s ease;
  backdrop-filter: blur(2px);
}

/* Only show overlay if there are social links */
.social-links:empty {
  display: none;
}

.member-overlay:has(.social-links:empty) {
  display: none;
}

.team-member-card:hover .member-overlay {
  opacity: 1;
}

/* Hide overlay entirely if no social links exist */
.member-overlay:has(.social-links:not(:has(a))) {
  display: none;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 15px;
  transform: translateY(20px);
  transition: transform 0.4s ease 0.1s;
}

.team-member-card:hover .social-links {
  transform: translateY(0);
}

.social-link {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.3s ease;
  transform: scale(0.8);
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
  transform: scale(1) rotate(5deg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Member Content */
.member-content {
  padding: 30px 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.member-header {
  margin-bottom: 20px;
  text-align: center;
}

.member-name {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.member-role {
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
}

.member-role::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 1px;
}

/* Bio Section */
.member-bio-container {
  margin-top: auto;
  position: relative;
}

.member-bio {
  font-size: 14px;
  line-height: 1.6;
  color: #5a6c7d;
  margin: 0;
  overflow: hidden;
  position: relative;
  max-height: none; /* Changed from 60px to auto */
  transition: max-height 0.4s ease;
}

.member-bio.truncated {
  max-height: 120px; /* Updated from 60px to 120px */
}

.member-bio.expanded {
  max-height: 500px;
}

.member-bio::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(transparent, #ffffff);
  transition: opacity 0.3s ease;
  opacity: 0; /* Hidden by default */
}

.member-bio.truncated::after {
  opacity: 1; /* Only show fade when truncated */
}

.member-bio.expanded::after {
  opacity: 0;
}

.bio-toggle {
  background: none;
  border: none;
  color: #667eea;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  padding: 8px 0;
  display: none; /* Hidden by default */
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bio-toggle.show {
  display: flex; /* Only show when needed */
}

.bio-toggle:hover {
  color: #764ba2;
  transform: translateX(5px);
}

.bio-toggle i {
  transition: transform 0.3s ease;
  font-size: 10px;
}

.bio-toggle.active i {
  transform: rotate(180deg);
}

.bio-toggle .read-less {
  display: none;
}

.bio-toggle.active .read-more {
  display: none;
}

.bio-toggle.active .read-less {
  display: inline;
}

/* No Team Content Styling */
.no-team-content {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.no-team-content p {
  color: #6c757d;
  font-size: 16px;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .team.section {
    padding: 60px 0;
  }

  .member-image-container {
    height: 240px;
  }

  .member-content {
    padding: 20px;
  }

  .member-name {
    font-size: 20px;
  }

  .social-links {
    gap: 10px;
  }

  .social-link {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .member-image-container {
    height: 200px;
  }

  .member-content {
    padding: 15px;
  }

  .team-member-card:hover {
    transform: translateY(-6px) scale(1.01);
  }
}

/* Animation for loading */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.team-member-card {
  animation: fadeInUp 0.6s ease forwards;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .team.section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  }

  .team-member-card {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .member-name {
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #64b5f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .member-bio {
    color: #b0b0b0;
  }

  .member-bio::after {
    background: linear-gradient(transparent, #2a2a2a);
  }
}
