/* Premium Team Stylesheet - 3D Card Flip Edition */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #2D8B47;
    --primary-gradient: linear-gradient(135deg, #2D8B47 0%, #16a34a 100%);
    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(243, 244, 246, 0.5) 0%, rgba(229, 231, 235, 0.3) 90%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(0, 0, 0, 0.06);
    --text-main: #0f172a;
    --text-sub: #475569;
    --text-muted: #64748b;
}

.team-section {
    padding: 60px 0 80px 0;
    background: var(--bg-gradient);
    font-family: 'Plus Jakarta Sans', sans-serif;
    position: relative;
    overflow: hidden;
}

.team-section::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(45, 139, 71, 0.08);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
}

.team-section::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 450px;
    height: 450px;
    background: rgba(16, 185, 129, 0.06);
    border-radius: 50%;
    filter: blur(100px);
    z-index: 1;
    pointer-events: none;
}

.team-section .container {
    position: relative;
    z-index: 2;
}

/* Header */
.team-header-block {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px auto;
}

.team-header-block h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
    background: linear-gradient(135deg, #1e293b 30%, #2D8B47 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.team-header-block p {
    font-size: 16px;
    color: var(--text-sub);
    line-height: 1.7;
    font-weight: 400;
}

/* Grid layout */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    width: 100%;
    margin-top: 10px;
}

/* 3D Flip Card Container */
.team-card-wrapper {
    perspective: 1000px;
    height: 530px;
    width: 100%;
}

.team-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

.team-card-inner.is-flipped {
    transform: rotateY(180deg);
}

/* Card Faces */
.team-card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.team-card-wrapper:hover .team-card-face {
    border-color: rgba(45, 139, 71, 0.3);
    box-shadow: 0 16px 40px rgba(45, 139, 71, 0.08);
}

/* Front Face */
.team-card-front {
    z-index: 2;
    transform: rotateY(0deg);
    justify-content: space-between;
}

.team-card-top-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.team-img-wrapper {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #10b981 100%);
    box-shadow: 0 8px 20px rgba(45, 139, 71, 0.15);
    transition: transform 0.4s ease;
}

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

.team-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #f8fafc;
}

.team-member-name {
    font-family: 'Outfit', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    transition: color 0.3s ease;
}

.team-card-wrapper:hover .team-member-name {
    color: var(--primary-color);
}

.team-member-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(45, 139, 71, 0.08);
    border-radius: 30px;
}

.team-member-bio {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
    margin-top: 6px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 125px;
    text-overflow: ellipsis;
    width: 100%;
    text-align: justify;
    text-align-last: center;
    font-weight: 500;
    letter-spacing: -0.15px;
}

/* Bottom Bar (Aligned Across All Cards) */
.team-card-bottom-bar {
    margin-top: auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.team-social-links-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.team-social-icon.email {
    background-color: #ea4335;
    border: 1px solid #ea4335;
    color: #ffffff !important;
}

.team-social-icon.linkedin {
    background-color: #0077b5;
    border: 1px solid #0077b5;
    color: #ffffff !important;
}

.team-social-icon.website {
    background-color: #1e293b;
    border: 1px solid #1e293b;
    color: #ffffff !important;
}

.team-social-icon:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.btn-flip-bio {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.btn-flip-bio:hover {
    background: rgba(45, 139, 71, 0.08);
    color: #15803d;
    gap: 9px;
}

.btn-flip-bio i {
    font-size: 11px;
}

/* Back Face (Biography Flip Side) */
.team-card-back {
    transform: rotateY(180deg);
    background: #ffffff;
    border: 1px solid rgba(45, 139, 71, 0.25);
    box-shadow: 0 15px 40px rgba(45, 139, 71, 0.1);
    padding: 24px;
    text-align: left;
    justify-content: space-between;
}

.btn-flip-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-flip-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.card-back-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}

.card-back-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #2D8B47 0%, #10b981 100%);
    flex-shrink: 0;
}

.card-back-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.card-back-meta h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.card-back-meta span {
    font-size: 11px;
    font-weight: 700;
    color: #2D8B47;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-back-bio-scroll {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.65;
    padding-right: 6px;
    margin-bottom: 14px;
}

.card-back-bio-scroll::-webkit-scrollbar {
    width: 4px;
}

.card-back-bio-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.card-back-bio-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.btn-back-to-profile {
    background: rgba(45, 139, 71, 0.08);
    border: none;
    color: #2D8B47;
    font-weight: 700;
    font-size: 12.5px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-back-to-profile:hover {
    background: #2D8B47;
    color: #ffffff;
}

/* Responsive Grid */
@media (max-width: 992px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    .team-card-wrapper {
        height: 550px;
    }
}

@media (max-width: 600px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .team-header-block h2 {
        font-size: 30px;
    }
    .team-card-wrapper {
        height: 530px;
    }
}
