/* Font Family */
.team-card,
.team-card *,
.team-name,
.team-position,
.team-bio {
  font-family: 'Tajawal', Arial, Helvetica, sans-serif !important;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 40px;
}

/* ===================================
   Team Cards - Ultra Premium 3D Design
   =================================== */

.team-card {
  background: linear-gradient(145deg, #ffffff 0%, #fafafa 100%);
  border-radius: 28px;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid transparent;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.1),
    0 8px 20px rgba(0, 0, 0, 0.06);
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
}

/* Animated Top Border */
.team-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #C8A041, #E8C46A, #F5D76E, #E8C46A, #C8A041);
  background-size: 200% 100%;
  z-index: 10;
  animation: gradientShift 3s ease infinite;
}

/* Glow Effect */
.team-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(232, 196, 106, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.team-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 
    0 30px 60px rgba(232, 196, 106, 0.25),
    0 15px 30px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border-color: rgba(232, 196, 106, 0.4);
}

.team-card:hover::after {
  opacity: 1;
  width: 350px;
  height: 350px;
}

/* ===================================
   Featured Card - Founder's Premium Design
   =================================== */

.team-card.featured {
  max-width: 900px;
  margin: 0 auto 4rem;
  border-radius: 36px;
  background: linear-gradient(145deg, #0A0F3C 0%, #1a2570 50%, #0A0F3C 100%);
  border: 3px solid rgba(232, 196, 106, 0.3);
  box-shadow: 
    0 30px 70px rgba(10, 15, 60, 0.3),
    0 15px 35px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Animated Gold Border for Featured */
.team-card.featured::before {
  height: 10px;
  background: linear-gradient(90deg, #C8A041, #E8C46A, #F5D76E, #FFD700, #F5D76E, #E8C46A, #C8A041);
  background-size: 300% 100%;
  animation: gradientShift 4s ease infinite;
  box-shadow: 0 4px 15px rgba(232, 196, 106, 0.5);
}

/* Radial Glow for Featured */
.team-card.featured::after {
  background: radial-gradient(circle, rgba(232, 196, 106, 0.25) 0%, transparent 70%);
  width: 400px;
  height: 400px;
}

.team-card.featured:hover {
  transform: translateY(-20px) scale(1.02);
  box-shadow: 
    0 50px 100px rgba(232, 196, 106, 0.4),
    0 30px 60px rgba(10, 15, 60, 0.3),
    0 15px 30px rgba(232, 196, 106, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(232, 196, 106, 0.6);
}

.team-card.featured:hover::after {
  opacity: 1;
  width: 600px;
  height: 600px;
}

/* Featured Card Body - Horizontal Layout */
.team-card.featured .team-card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  padding: 3rem;
  background: transparent;
}

/* Decorative Corner Accent */
.team-card.featured .team-card-body::before {
  content: '';
  position: absolute;
  top: 20px;
  right: 20px;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(232, 196, 106, 0.2) 0%, transparent 100%);
  border-radius: 50%;
  opacity: 0.5;
}

.team-card.featured .team-card-body::after {
  content: '';
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(232, 196, 106, 0.15) 0%, transparent 100%);
  border-radius: 50%;
  opacity: 0.5;
}

.team-image-wrapper {
  width: 100%;
  height: 320px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(145deg, #0A0F3C 0%, #1a2456 50%, #0A0F3C 100%);
}

.team-card.featured .team-image-wrapper {
  width: 350px;
  height: 350px;
  flex-shrink: 0;
  border-radius: 24px;
  border: 4px solid rgba(232, 196, 106, 0.4);
  box-shadow: 
    0 20px 50px rgba(232, 196, 106, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  transition: all 0.6s ease;
}

.team-card.featured:hover .team-image-wrapper {
  border-color: rgba(232, 196, 106, 0.7);
  box-shadow: 
    0 30px 70px rgba(232, 196, 106, 0.5),
    inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Image Overlay Effect */
.team-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.team-card:hover .team-image-wrapper::before {
  opacity: 1;
}

.team-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: grayscale(0%) brightness(1);
}

.team-card:hover .team-image {
  transform: scale(1.12);
  filter: grayscale(0%) brightness(1.05);
}

/* Placeholder for team images */
.team-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0A0F3C 0%, #1a2456 50%, #0A0F3C 100%);
  position: relative;
  z-index: 1;
}

.team-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.team-card:hover .team-image-placeholder img {
  transform: scale(1.12);
}

.team-image-placeholder i {
  font-size: 90px;
  background: linear-gradient(135deg, #C8A041, #E8C46A);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.4;
  transition: all 0.4s ease;
}

.team-card:hover .team-image-placeholder i {
  opacity: 0.6;
  transform: scale(1.1);
}

.team-card-body {
  padding: 2.2rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
  position: relative;
  z-index: 3;
}

.team-card.featured .team-info {
  flex: 1;
  text-align: right;
}

[dir="ltr"] .team-card.featured .team-info {
  text-align: left;
}

/* Decorative Line */
.team-card-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-start), transparent);
  opacity: 0;
  transition: all 0.4s ease;
}

.team-card:hover .team-card-body::before {
  opacity: 1;
  width: 80px;
}

.team-info {
  flex: 1;
  text-align: center;
}

.team-name {
  color: #0A0F3C;
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 0.8rem;
  line-height: 1.3;
  transition: all 0.3s ease;
  position: relative;
}

.team-card.featured .team-name {
  font-size: 2.5rem;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
}

.team-card.featured:hover .team-name {
  color: #F5D76E;
  transform: scale(1.03);
  text-shadow: 0 6px 16px rgba(232, 196, 106, 0.6);
}

.team-card:hover .team-name {
  color: var(--gold-start);
  transform: scale(1.05);
}

.team-position {
  color: #C8A041;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: block;
  transition: all 0.3s ease;
  line-height: 1.5;
}

.team-card.featured .team-position {
  font-size: 1.4rem;
  color: #E8C46A;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.team-card.featured:hover .team-position {
  color: #F5D76E;
  transform: scale(1.02);
}

.team-card.featured .team-bio {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1.8;
}

.team-card.featured:hover .team-bio {
  color: rgba(255, 255, 255, 1);
}

.team-card:hover .team-position {
  color: #E8C46A;
  transform: scale(1.03);
}

.team-bio {
  color: #666;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

.team-card:hover .team-bio {
  color: #444;
}

/* ===================================
   Animations
   =================================== */

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.team-grid .team-card:nth-child(1) {
  animation-delay: 0.1s;
}

.team-grid .team-card:nth-child(2) {
  animation-delay: 0.2s;
}

.team-grid .team-card:nth-child(3) {
  animation-delay: 0.3s;
}

.team-grid .team-card:nth-child(4) {
  animation-delay: 0.4s;
}

.team-grid .team-card:nth-child(5) {
  animation-delay: 0.5s;
}

.team-grid .team-card:nth-child(6) {
  animation-delay: 0.6s;
}

.team-grid .team-card:nth-child(7) {
  animation-delay: 0.7s;
}

.team-grid .team-card:nth-child(8) {
  animation-delay: 0.8s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RTL Support */
[dir="rtl"] .team-card.featured .team-card-body {
  flex-direction: row-reverse;
}

[dir="rtl"] .team-card.featured .team-info {
  text-align: right;
}

[dir="ltr"] .team-card.featured .team-info {
  text-align: left;
}

[dir="rtl"] .team-info {
  text-align: right;
}

[dir="ltr"] .team-info {
  text-align: left;
}

/* Responsive Design */
@media (max-width: 991px) {
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
  }

  .team-image-wrapper {
    height: 300px;
  }

  .team-card.featured .team-image-wrapper {
    height: 350px;
  }

  .team-card-body {
    padding: 2rem 1.8rem;
  }

  .team-card.featured .team-card-body {
    padding: 2.5rem 2rem;
  }

  .team-name {
    font-size: 1.3rem;
  }

  .team-card.featured .team-name {
    font-size: 1.8rem;
  }

  .team-position {
    font-size: 1rem;
  }

  .team-card.featured .team-position {
    font-size: 1.15rem;
  }

  [dir="rtl"] .team-card.featured .team-info,
  [dir="ltr"] .team-card.featured .team-info {
    text-align: center;
  }
}

@media (max-width: 767px) {
  .team-section {
    padding: 40px 0;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .team-image-wrapper {
    height: 280px;
  }

  .team-card.featured .team-image-wrapper {
    height: 320px;
  }

  .team-card-body {
    padding: 1.8rem 1.5rem;
  }

  .team-card.featured .team-card-body {
    padding: 2.2rem 1.8rem;
  }

  .team-name {
    font-size: 1.2rem;
  }

  .team-card.featured .team-name {
    font-size: 1.6rem;
  }

  .team-position {
    font-size: 0.95rem;
  }

  .team-card.featured .team-position {
    font-size: 1.1rem;
  }

  .team-bio {
    font-size: 0.95rem;
  }

  .team-image-placeholder i {
    font-size: 80px;
  }
}

@media (max-width: 480px) {
  .team-card-body {
    padding: 1.5rem 1.2rem;
  }

  .team-card.featured .team-card-body {
    padding: 2rem 1.5rem;
  }

  .team-image-wrapper {
    height: 260px;
  }

  .team-card.featured .team-image-wrapper {
    height: 300px;
  }

  .team-name {
    font-size: 1.1rem;
  }

  .team-card.featured .team-name {
    font-size: 1.5rem;
  }

  .team-position {
    font-size: 0.9rem;
  }

  .team-card.featured .team-position {
    font-size: 1.05rem;
  }

  .team-image-placeholder i {
    font-size: 70px;
  }
}