/* Section Header */
.team-header {
    margin-bottom: 80px;
    width: 60%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.team-title {
    font-size: 3em;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 30px;
    color: #2d3748;
    letter-spacing: -0.02em;
}

.highlight {
    color: #993ab3;
}

.team-description {
    font-size: 1.5em;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    font-weight: 300;
    color: #4a5568;
}

/* Team Grid */
.team-grid {
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 75px auto;
}

/* Team Member Card */
.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Only rotate when NOT flipped */
/* .team-member:not(.flipped):nth-child(odd):hover {
    transform: rotate(5deg);
}

.team-member:not(.flipped):nth-child(even):hover {
    transform: rotate(-5deg);
} */

/* Keep normal scale/translate when flipped */
.team-member:hover {
    transform: scale(1.05) translateY(-10px);
}

/* Member Photo Container - This is the flip container */
.member-photo-container {
    position: relative;
    margin-bottom: 25px;
    width: 100%;
    height: 420px;
    transform-style: preserve-3d;
}

/* Front and Back faces */
.member-photo-front,
.member-photo-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 25px;
    overflow: hidden;
}

/* Front face (photo) */
.member-photo-front {
    background: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-photo-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Back face (text content) */
.member-photo-back {
    background: linear-gradient(135deg, #323e71 0%, #200168 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    transform: rotateY(180deg);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4);
}

.member-photo-back h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 600;
}

.member-photo-back p {
    font-size: 1em;
    line-height: 2;
    margin-bottom: 15px;
    opacity: 0.9;
}

.member-photo-back .skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.member-photo-back .skill-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    backdrop-filter: blur(10px);
}

/* Flip Animation */
.member-photo-container.flipped .member-photo-front {
    transform: rotateY(-180deg);
}

.member-photo-container.flipped .member-photo-back {
    transform: rotateY(0deg);
}

/* Photo Background Shapes for front face */
.member-photo-front::before {
    content: "";
    position: absolute;
    top: -30px;
    left: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.member-photo-front::after {
    content: "";
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

/* Member Info */
.member-info {
    transition: all 0.3s ease;
}

.team-member:hover .member-info {
    transform: translateY(-5px);
}

.member-name {
    font-size: 2.2em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.member-role {
    font-size: 1.3em;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 15px;
}

.flip-hint {
    font-size: 0.9em;
    color: #718096;
    font-style: italic;
    opacity: 0.7;
}

/* Hover Glow Effect */
.team-member::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    z-index: -1;
    pointer-events: none;
}

.team-member:hover::before {
    width: 400px;
    height: 400px;
}

.team-content-container {
    justify-self: center;
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
}

.team-content {
    margin: 30px 0;
}

.team-content span {
    font-weight: 400;
    font-size: 2em;
}

.team-highlight {
    color: #993ab3;
}

.team-hire-btn {
    display: inline-block;
    padding: 20px 40px;
    background: linear-gradient(90deg, #4e69e1, #aa8af4);
    color: #fff;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 500;
    box-shadow: 2px 2px 5px black;
    transition: background-color 0.3s ease, transform 0.5s ease;
    cursor: pointer;
}

.team-hire-btn:hover {
    background: linear-gradient(90deg, #aa8af4, #4e69e1);
    transform: translateY(-5px);
}

@media (max-width: 1100px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .member-photo-container {
        width: 300px;
        height: 380px;
    }

    .member-photo-back p {
        line-height: 1.8;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .team-header {
        width: 90%;
    }

    .team-title {
        font-size: 2.5em;
    }

    .team-description {
        font-size: 1.2em;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .member-photo-container {
        width: 320px;
        height: 400px;
    }

    .member-name {
        font-size: 1.8em;
    }

    .member-role {
        font-size: 1.1em;
    }

    .team-member:hover {
        transform: scale(1.02) translateY(-5px);
    }
}

@media (max-width: 480px) {
    .team-title {
        font-size: 2em;
    }

    .team-description {
        font-size: 1em;
    }

    .member-name {
        font-size: 1.5em;
    }

    .member-role {
        font-size: 1em;
    }

    .member-photo-back {
        padding: 20px;
    }

    .member-photo-back p {
        font-size: 0.9em;
    }
}
