/* Team Widget Styles */
.team-widget-container {
    width: 100%;
    max-width: 100%;
}

/* Category Filter */
.team-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.team-category-filter a {
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.team-category-filter a:hover {
    color: #000;
}

.team-category-filter a.active {
    color: #000;
    font-weight: 600;
}

.team-category-filter a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(var(--team-columns, 4), 1fr);
    gap: 20px;
    width: 100%;
}

/* Ensure grid updates when CSS variable changes */
.team-widget-container .team-grid {
    grid-template-columns: repeat(var(--team-columns, 4), 1fr) !important;
}

/* Team Item */
.team-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
}

.team-item-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.team-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 14px;
}

/* Overlay */
.team-item-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 20px;
    text-align: center;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 4px;
}

.team-item:hover .team-item-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.team-item-designation {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.team-item-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Popup Modal */
.team-popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    overflow-y: auto;
}

.team-popup-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-popup-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.team-popup-modal-content {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
}

.team-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.team-popup-close:hover {
    background: #fff;
}

.team-popup-close:focus {
    background: rgba(255, 255, 255, 0.9);
    outline: none;
}

.team-popup-prev,
.team-popup-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    width: auto;
    height: auto;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.team-popup-prev {
    left: 15px;
}

.team-popup-next {
    right: 15px;
}

.team-popup-prev:hover,
.team-popup-next:hover {
    background: transparent;
}

.team-popup-prev:focus,
.team-popup-next:focus {
    background: transparent;
    outline: none;
}

.team-popup-slider {
    position: relative;
    width: 100%;
}

.team-popup-slide {
    display: none;
    width: 100%;
}

.team-popup-slide.active {
    display: flex;
    flex-direction: row;
    gap: 0;
}

.team-popup-image {
    flex: 0 0 40%;
    min-height: 400px;
    background: #f5f5f5;
    display: block;
    position: relative;
    overflow: hidden;
}

.team-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-popup-info {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-height: 90vh;
}

.team-popup-designation {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 10px;
}

.team-popup-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

.team-popup-content-text {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
    max-height: 160px;
    overflow-y: auto;
    overflow-x: hidden;
}

.team-popup-email {
    margin-bottom: 20px;
}

.team-popup-email a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.team-popup-email a:hover {
    color: #000;
}

.team-popup-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

.team-popup-social {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    visibility: visible;
    opacity: 1;
}

.team-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.team-social-icon:hover {
    background: #333;
    color: #fff;
    transform: translateY(-3px);
}

.team-social-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Responsive Styles - Using Elementor breakpoints */
/* Tablet: 1024px and below */
@media (max-width: 1024px) {
    .team-popup-modal-content {
        max-width: 95%;
    }
    
    .team-popup-slide.active {
        flex-direction: column;
    }
    
    .team-popup-image {
        flex: 0 0 auto;
        width: 100%;
        min-height: 260px;
        display: block;
    }
    
    .team-popup-image img {
        display: block;
        width: 100%;
        height: 100%;
    }
    
    .team-popup-social {
        display: flex;
        visibility: visible;
        opacity: 1;
    }
}
/* Mobile: 768px and below */
@media (max-width: 768px) {
    .team-grid {
        gap: 15px;
    }
    
    .team-category-filter {
        gap: 15px;
    }
    
    .team-popup-image {
        width: 100%;
        display: block;
        min-height: 260px;
    }
    
    .team-popup-image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .team-popup-info {
        padding: 30px 20px;
        width: 100%;
    }
    
    .team-popup-title {
        font-size: 24px;
    }
    
    .team-popup-social {
        display: flex;
        visibility: visible;
        opacity: 1;
    }
    
    .team-popup-prev,
    .team-popup-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* Mobile Extra: 480px and below */
@media (max-width: 480px) {
    .team-popup-image {
        width: 100%;
        min-height: 250px;
        display: block;
    }
    
    .team-popup-image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .team-popup-info {
        padding: 20px 15px;
        width: 100%;
    }
    
    .team-popup-title {
        font-size: 20px;
    }
    
    .team-popup-social {
        display: flex;
        visibility: visible;
        opacity: 1;
    }
}

/* Hide items when filtered */
.team-item.hidden {
    display: none;
}

