/*
* THEDI - Team Orbit Section Styles - RESTORED + JS ENHANCEMENT
*/

/* Team Orbit Section Base */
.team-orbit-section {
    position: relative;
    padding: 60px 0 180px 0; /* Increased bottom padding */
    background: linear-gradient(135deg, #004b6b 0%, #366072 70%, #004b6b 100%);
    overflow: visible;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.dark-theme .team-orbit-section {
    background: linear-gradient(135deg, #003048 0%, #1e3540 70%, #002a3d 100%);
}

/* Background Elements */
.team-orbit-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.orbit-bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(81, 177, 70, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 75, 107, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(54, 96, 114, 0.15) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
}

.orbit-bg-particles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2351b146' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.4;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Team Orbit Container */
.team-orbit-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

/* Section Header */
.team-orbit-header {
    text-align: center;
    z-index: 20;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.team-orbit-subtitle {
    display: inline-block;
    padding: 10px 25px;
    background: rgba(81, 177, 70, 0.2);
    color: #51b146;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(81, 177, 70, 0.2);
    border: 1px solid rgba(81, 177, 70, 0.3);
}

.team-orbit-title {
    font-size: 2.0rem;
    font-weight: 800;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #ffffff, #51b146);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.team-orbit-description {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Orbit Wrapper */
.wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  opacity: 0;
  transform: scale(0.8);
  animation: orbitFadeIn 1.5s ease forwards 0.8s;
}

@keyframes orbitFadeIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Orbit Inner Container */
.inner {
  --w: 180px;
  --h: 260px;
  --translateZ: calc((var(--w) + var(--h)) + 20px);
  --rotateX: -8deg;
  --perspective: 1400px;
  position: absolute;
  width: var(--w);
  height: var(--h);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) perspective(var(--perspective)) rotateX(var(--rotateX));
  z-index: 2;
  transform-style: preserve-3d;
  animation: rotating 40s linear infinite;
}

@keyframes rotating {
  from { transform: translate(-50%, -50%) perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(0); }
  to { transform: translate(-50%, -50%) perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(1turn); }
}

/* Individual Cards - NEW DESIGN */
.card {
  position: absolute;
  width: var(--w);
  height: var(--h);
  transform: rotateY(calc((360deg / var(--quantity)) * var(--index))) translateZ(var(--translateZ));
  perspective: 1000px;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
}

.team-card-content {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 20px 40px rgba(0, 75, 107, 0.3),
    0 0 0 1px rgba(81, 177, 70, 0.2);
  /* background: linear-gradient(145deg, #004b6b, #366072); */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}

/* Image Section (2/3 of card) */
.card-image-section {
  position: relative;
  height: 66.67%;
  overflow: hidden;
}

.team-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s ease;
}

.image-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, rgba(0, 75, 107, 0.8));
  pointer-events: none;
}

/* Details Section (1/3 of card) */
.card-details-section {
  height: 33.33%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, #004b6b, #366072);
  position: relative;
}

.card-details-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(81, 177, 70, 0.1) 50%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.member-name {
  margin: 0 0 3px 0;
  font-size: 0.6rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
  position: relative;
}

.member-position {
  margin: 0 0 8px 0;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  z-index: 2;
  position: relative;
}

.view-details-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(81, 177, 70, 0.2);
  color: #51b146;
  text-decoration: none;
  border-radius: 15px;
  border: 1px solid rgba(81, 177, 70, 0.3);
  font-size: 0.4rem;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
  backdrop-filter: blur(10px);
  align-self: flex-start;
}

.view-details-btn:hover {
  background: rgba(81, 177, 70, 0.3);
  border-color: #51b146;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(81, 177, 70, 0.3);
  color: #ffffff;
}

.view-details-btn i {
  transition: transform 0.3s ease;
}

.view-details-btn:hover i {
  transform: translateX(3px);
}

/* Enhanced hover effects */
.card:hover {
  filter: drop-shadow(0 0 20px rgba(81, 177, 70, 0.5));
}

.card:hover .team-card-content {
  transform: scale(1.05);
  box-shadow: 
    0 30px 60px rgba(0, 75, 107, 0.4),
    0 0 0 2px rgba(81, 177, 70, 0.4);
}

.card:hover .team-img {
  transform: scale(1.1);
}

.card:hover .image-fade {
  background: linear-gradient(transparent, rgba(0, 75, 107, 0.9));
}

/* Responsive Design */
@media (max-width: 1200px) {
  .inner {
    --w: 160px;
    --h: 240px;
    --translateZ: calc((var(--w) + var(--h)) + 15px);
  }
  
  .team-orbit-title {
    font-size: 3rem;
  }
  
  .team-orbit-section {
    padding-bottom: 160px;
  }
  
  .member-name {
    font-size: 0.8rem;
  }
  
  .member-position {
    font-size: 0.65rem;
  }
  
  .view-details-btn {
    font-size: 0.6rem;
    padding: 5px 10px;
  }
}

@media (max-width: 992px) {
  .team-orbit-section {
    padding: 80px 0 140px 0;
    min-height: 100vh;
  }
  
  .team-orbit-container {
    height: 90vh;
  }
  
  .inner {
    --w: 140px;
    --h: 200px;
    --translateZ: calc((var(--w) + var(--h)) + 10px);
    --perspective: 1000px;
  }
  
  .team-orbit-title {
    font-size: 2.0rem;
  }
  
  .team-orbit-description {
    font-size: 1.1rem;
  }
  
  .card-details-section {
    padding: 10px;
  }
  
  .member-name {
    font-size: 0.75rem;
  }
  
  .member-position {
    font-size: 0.6rem;
  }
  
  .view-details-btn {
    font-size: 0.6rem;
    padding: 4px 8px;
  }
}

@media (max-width: 768px) {
  .team-orbit-section {
    padding: 60px 0 120px 0;
    min-height: 100vh;
  }
  
  .team-orbit-container {
    height: 80vh;
  }
  
  .inner {
    --w: 120px;
    --h: 180px;
    --translateZ: calc((var(--w) + var(--h)) + 8px);
    --perspective: 800px;
    animation: rotating 50s linear infinite;
  }
  
  .team-orbit-title {
    font-size: 2rem;
  }
  
  .team-orbit-description {
    font-size: 1rem;
    padding: 0 20px;
  }
  
  .card-details-section {
    padding: 8px;
  }
  
  .member-name {
    font-size: 0.7rem;
  }
  
  .member-position {
    font-size: 0.55rem;
  }
  
  .view-details-btn {
    font-size: 0.55rem;
    padding: 3px 6px;
  }
}

@media (max-width: 576px) {
  .team-orbit-section {
    padding: 40px 0 100px 0;
    min-height: 100vh;
  }
  
  .team-orbit-container {
    height: 60vh;
  }
  
  .inner {
    --w: 100px;
    --h: 150px;
    --translateZ: calc((var(--w) + var(--h)) + 5px);
    --perspective: 600px;
    animation: rotating 60s linear infinite;
  }
  
  .team-orbit-title {
    font-size: 1.8rem;
  }
  
  .team-orbit-description {
    font-size: 0.9rem;
  }
  
  .card-details-section {
    padding: 6px;
  }
  
  .member-name {
    font-size: 0.65rem;
  }
  
  .member-position {
    font-size: 0.5rem;
  }
  
  .view-details-btn {
    font-size: 0.5rem;
    padding: 2px 5px;
  }
}

/* Scroll-triggered animations */
.team-orbit-section.aos-animate .wrapper {
  animation-delay: 0.2s;
}

.team-orbit-section.aos-animate .team-orbit-header {
  animation-delay: 0.1s;
}

/* Dark theme adjustments */
.dark-theme .team-card-content {
  background: linear-gradient(145deg, #003048, #1e3540);
}

.dark-theme .image-fade {
  background: linear-gradient(transparent, rgba(0, 48, 72, 0.8));
}

.dark-theme .card:hover .image-fade {
  background: linear-gradient(transparent, rgba(0, 48, 72, 0.9));
}