/* Team Grid Styles */
.dynamic-team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0 60px 0;
    padding: 0 20px;
}

.team-members-container {
    margin: 30px 0;
}

.team-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.filter-btn {
    background: #f1f1f1;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #1a5490;
    color: white;
}

.team-card-dynamic {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
    border-radius: 15px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.team-card-dynamic:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.team-member-image {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 20px;
    object-fit: cover;
    height: 250px !important;
}

.team-member-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px !important;
    object-fit: cover;
}

.team-card-dynamic h3 {
    font-size: 18px;
    color: #1a5490;
    margin-bottom: 10px;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-card-dynamic h4 {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 0;
    margin-top: 0px ;
}

/* Popup Styles */
.team-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
}

.team-popup-content {
    position: relative;
    background: #fff;
    max-width: 900px;
    margin: 50px auto;
    border-radius: 15px;
    overflow: hidden;
}

.team-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.team-popup-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.team-popup-image {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.team-popup-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-popup-info h2 {
    color: #1a5490;
    font-size: 24px;
    margin-bottom: 10px;
}

.team-popup-info h3 {
    color: #333;
    font-size: 28px;
    margin-bottom: 30px;
}

.member-details > div {
    margin-bottom: 25px;
}

.member-details h4 {
    color: #1a5490;
    font-size: 18px;
    margin-bottom: 10px;
}

.member-details p {
    color: #666;
    line-height: 1.6;
}

/* Responsive Design */
@media (min-width: 1200px) {
    .dynamic-team-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .dynamic-team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .dynamic-team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .team-card-dynamic {
        padding: 5px;
    }
    
    .team-card-dynamic h3 {
        font-size: 15px;
        min-height: 30px;
        margin-bottom: 2px;
    }
    
    .team-card-dynamic h4 {
        font-size: 16px;
    }
    
    .team-popup-inner {
        grid-template-columns: 1fr;
    }
    
    .team-popup-content {
        margin: 20px;
    }
    
    .team-popup-info h2 {
        font-size: 20px;
    }
    
    .team-popup-info h3 {
        font-size: 24px;
    }
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden;
}

/* Smooth transitions */
.team-popup-overlay {
    transition: opacity 0.3s ease;
}

.team-popup-content {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.team-popup-overlay.show .team-popup-content {
    transform: scale(1);
}
