.team {
    margin-top: 5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.card {
    height: 550px;
    width: 340px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    background-color: rgba(255, 255, 255, 1);
    display: flex;
    transition: 0.3s;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2);
}

.card[data-state="#expert"] {
    height: 400px;
    .card-main {
        padding-top: 0;
    }
}

.card.is-active {
    .card-header {
        height: 80px;
    }

    .card-cover {
        height: 100px;
        top: -50px;
    }

    .card-avatar {
        transform: none;
        left: 20px;
        width: 50px;
        height: 50px;
        bottom: 10px;
    }

    .card-fullname,
    .card-jobtitle {
        left: 86px;
        transform: none;
    }

    .card-fullname {
        bottom: 30px;
        font-size: 19px;
    }

    .card-jobtitle {
        bottom: 10px;
        letter-spacing: 1px;
        font-size: 10px;
    }
}

.card-header {
    position: relative;
    display: flex;
    height: 250px;
    width: 100%;
    transition: 0.3s;

    * {
        transition: 0.3s;
    }
}

.card-cover {
    width: 100%;
    height: 100%;
    position: absolute;
    height: 160px;
    top: -20%;
    left: 0;
    will-change: top;
    background-size: cover;
    background-position: center;
    filter: blur(30px);
    transform: scale(1.2);
    transition: 0.5s;
}

.card-avatar {
    width: 150px;
    height: 150px;
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    object-position: center;
    object-fit: cover;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-64px);
}

.card-fullname {
    position: absolute;
    bottom: 30px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    transform: translateX(-50%);
    left: 50%;
}

.card-jobtitle {
    position: absolute;
    bottom: 10px;
    font-size: 11px;
    white-space: nowrap;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
    left: 50%;
    transform: translateX(-50%);
}

.card-main {
    position: relative;
    flex: 1;
    display: flex;
    padding-top: 10px;
    flex-direction: column;
}

.card-subtitle {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}

.card-content {
    padding: 20px;
}

.card-desc {
    line-height: 1.6;
    color: #636b6f;
    font-size: 16px;
    margin: 0;
    font-weight: 400;
    text-align: center;
}

.card-social {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 30px;
    svg {
        fill: rgba(41, 41, 41, 0.7);
        width: 16px;
        display: block;
        transition: 0.3s;
    }
    a {
        color: #8797a1;
        height: 32px;
        width: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: 0.3s;
        background-color: rgba(41, 41, 41, 0.05);
        border-radius: 50%;
        margin-right: 10px;

        &:hover {
            svg {
                fill: rgba(41, 41, 41, 0.9);
            }
        }

        &:last-child {
            margin-right: 0;
        }
    }
}

.email-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
}

.email-link:hover {
    color: inherit;
    text-decoration: underline;
}

.card-buttons {
    display: flex;
    background-color: #fff;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    left: 0;

    button {
        flex: 1 1 auto;
        user-select: none;
        background: 0;
        font-size: 13px;
        border: 0;
        padding: 15px 5px;
        cursor: pointer;
        color: #5c5c6d;
        transition: 0.3s;
        font-family: "Jost", sans-serif;
        font-weight: 500;
        outline: 0;
        border-bottom: 3px solid transparent;

        &.is-active,
        &:hover {
            color: #2b2c48;
            border-bottom: 3px solid #292929;
            background: linear-gradient(
                to bottom,
                rgba(41, 41, 41, 0) 0%,
                rgba(41, 41, 41, 0.1) 44%,
                rgba(41, 41, 41, 0.2) 100%
            );
        }
    }
}

.card-section {
    display: none;
    &.is-active {
        display: block;
        animation: fadeIn 0.6s both;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translatey(40px);
    }
    100% {
        opacity: 1;
    }
}

.card-timeline {
    margin-top: 30px;
    position: relative;
    &:after {
        background: linear-gradient(
            to top,
            rgba(41, 41, 41, 0) 0%,
            rgba(41, 41, 41, 0.8) 100%
        );
        content: "";
        left: 42px;
        width: 2px;
        top: 0;
        height: 100%;
        position: absolute;
        content: "";
    }
}

.card-item {
    position: relative;
    padding-left: 60px;
    padding-right: 20px;
    padding-bottom: 30px;
    z-index: 1;
    &:last-child {
        padding-bottom: 5px;
    }

    &:after {
        content: attr(data-year);
        width: 10px;
        position: absolute;
        top: 0;
        left: 37px;
        width: 8px;
        height: 8px;
        line-height: 0.6;
        border: 2px solid #fff;
        font-size: 11px;
        text-indent: -35px;
        border-radius: 50%;
        color: rgba(#868686, 0.7);
        background: linear-gradient(
            to bottom,
            rgba(41, 41, 41, 0.5) 0%,
            #292929 100%
        );
    }
}

.card-item-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 5px;
}

.card-item-desc {
    font-size: 13px;
    color: #6f6f7b;
    line-height: 1.5;
    font-family: "DM Sans", sans-serif;
}

.card-contact-wrapper {
    margin-top: 20px;
}

.card-contact {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #6f6f7b;
    font-family: "DM Sans", sans-serif;
    line-height: 1.6;
    cursor: pointer;

    & + & {
        margin-top: 16px;
    }

    svg {
        flex-shrink: 0;
        width: 30px;
        min-height: 34px;
        margin-right: 12px;
        transition: 0.3s;
        padding-right: 12px;
        border-right: 1px solid #dfe2ec;
    }
}

.contact-me {
    border: 0;
    outline: none;
    background: linear-gradient(
        to right,
        rgba(41, 41, 41, 0.7) 0%,
        rgba(41, 41, 41, 0.9) 96%
    );
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    color: #fff;
    padding: 12px 16px;
    width: 100%;
    border-radius: 5px;
    margin-top: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: "Jost", sans-serif;
    transition: 0.3s;
}

/* Section title styling */
.sectionTitle {
    text-align: center;
    margin-bottom: 40px;
}

.sectionTitle h2 {
    font-size: 32px;
    font-weight: 700;
    color: #292929;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.sectionTitle h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background-color: #292929;
}

/* Media queries for responsive design */
@media screen and (max-width: 992px) {
    .team {
        margin-top: 7rem;
        gap: 20px;
    }

    .card {
        width: 320px;
    }
}

@media screen and (max-width: 768px) {
    .team {
        margin-top: 5rem;
        gap: 15px;
    }

    .card {
        width: 100%;
        max-width: 340px;
    }

    .sectionTitle h2 {
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .team {
        margin-top: 3rem;
    }

    .card {
        height: 520px;
    }

    .sectionTitle h2 {
        font-size: 24px;
        padding-bottom: 10px;
    }
}
