/* SC Team Grid Styles - Compact Cards with Clear Photos */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sc-team-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Grid Layout */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Tablet - 2 columns */
@media (max-width: 992px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Mobile - 1 column */
@media (max-width: 576px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Team Card - Smaller size */
.team-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #0d103c;
    max-width: 280px;
    margin: 0 auto;
    width: 100%;
}

.team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(13, 16, 60, 0.1);
}

/* Image Container - Fixed size for clear visibility */
.card-image-wrapper {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    overflow: hidden;
    border-bottom: 1px solid #0d103c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures image covers the area without distortion */
    object-position: center;
    display: block;
}

/* For square/profile photos, use this to ensure they're fully visible */
.card-image.img-fit-contain img {
    object-fit: contain;
    background: #f5f5f5;
    padding: 10px;
}

/* Card Content */
.card-content {
    padding: 15px 12px;
    text-align: center;
    background: white;
}

.member-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a2b3c;
    margin: 0 0 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-position {
    font-size: 12px;
    color: #0d103c;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #0d103c;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact Icons */
.member-contact {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.contact-link {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 12px;
}

.contact-link:hover {
    transform: translateY(-2px);
}

.contact-link.phone:hover {
    background: #0d103c;
    color: white;
}

.contact-link.whatsapp:hover {
    background: #25D366;
    color: white;
}

.contact-link.email:hover {
    background: #EA4335;
    color: white;
}

/* View Profile Button */
.view-profile-btn {
    background: transparent;
    border: 1px solid #0d103c;
    color: #0d103c;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    width: fit-content;
    margin: 0 auto;
    background: white;
}

.view-profile-btn:hover {
    background: #0d103c;
    color: white;
}

.view-profile-btn i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.view-profile-btn:hover i {
    transform: translateX(3px);
}

/* Popup Styles */
.member-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.member-popup.active {
    display: block;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 16, 60, 0.9);
    backdrop-filter: blur(3px);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(13, 16, 60, 0.2);
    border: 1px solid #0d103c;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    border: 1px solid #0d103c;
    font-size: 20px;
    color: #0d103c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.popup-close:hover {
    background: #0d103c;
    color: white;
}

.popup-inner {
    display: flex;
}

.popup-image {
    flex: 0 0 250px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.popup-details {
    flex: 1;
    padding: 20px;
}

.popup-details h2 {
    font-size: 22px;
    color: #1a2b3c;
    margin: 0 0 3px;
}

.popup-details h3 {
    font-size: 16px;
    color: #0d103c;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #0d103c;
}

.popup-bio {
    margin-bottom: 20px;
}

.popup-bio h4,
.popup-contact h4 {
    font-size: 14px;
    color: #1a2b3c;
    margin: 0 0 8px;
}

.popup-bio p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 13px;
}

.contact-list {
    background: #f8fafc;
    border-radius: 6px;
    padding: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item i {
    width: 28px;
    height: 28px;
    background: #0d103c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.contact-item a {
    color: #0d103c;
    text-decoration: none;
    font-size: 13px;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Loading state for images */
.card-image img {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Fallback for missing images */
.card-image img[src*="ui-avatars"] {
    object-fit: contain;
    padding: 15px;
    background: #0d103c;
}
