/* Team Cards */
.team-card {
    min-height: 28rem;
    padding: 0 !important;
    perspective: 1000px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
        display: flex;

}

.team-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* Trigger flip on hover AND on .flipped class click */
.team-card:hover .team-card-inner,
.team-card.flipped .team-card-inner {
    transform: rotateY(180deg);
}

.team-card-front, .team-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1.5rem;
}

.team-card-front {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Slight background for front to help occlusion */
    transform: translateZ(0); /* Fix for some browsers */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.team-card-back {
    transform: rotateY(180deg) translateZ(1px); /* Slight Z-boost to prevent fighting */
    background: #0f0f14; /* Solid background to prevent bleeding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.team-image {
    width: 100%;
    height: 18rem;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.team-image-placeholder {
    width: 100%;
    height: 18rem;
    background: linear-gradient(to bottom right, #2a2a3e, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.team-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.team-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: white;
    text-transform: uppercase;
}

.team-role {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.team-back-title {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-transform: uppercase;
}

.team-bio {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: justify;
}

.team-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.team-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
    justify-content: center;
}

.team-linkedin {
    color: rgb(168, 85, 247);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-empty-card {
    padding: 2rem;
    text-align: center;
    grid-column: 1 / -1;
}

.team-empty-text {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .team-card {
        min-height: auto;
        height: auto;
        margin-bottom: 2rem; /* Add spacing between staked cards */
    }

    .team-card-inner {
        height: auto;
    }

    /* Front face dictates the height */
    .team-card-front {
        position: relative;
        height: auto;
        /* Ensure it wraps content */
    }

    .team-image,
    .team-image-placeholder {
        width: 100%;
        height: auto !important; /* Override fixed height */
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    .team-content {
        padding: 1.5rem 1rem; /* Adjust padding if needed */
    }

    .team-card-back {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
    }
}