/* Staff Profiles Container */
.msu-core-staff-profiles {
    display: block;
    margin: 20px 0;
    clear: both;
}

/* Grid Layout */
.msu-core-staff-layout-grid {
    display: flex;
    gap: 20px; /* Reduced spacing to fit more items */
    flex-wrap: wrap;
    justify-content: flex-start; /* Align items to the start */
}

.msu-core-staff-columns-4 .msu-core-staff-grid-item {
    flex: 0 0 calc(25% - 15px); /* Four items per row accounting for gap */
    max-width: calc(25% - 15px); /* Ensure width is enforced */
}

.msu-core-staff-columns-3 .msu-core-staff-grid-item {
    flex: 0 0 calc(33.333% - 14px); /* Three items per row accounting for gap */
    max-width: calc(33.333% - 14px); /* Ensure width is enforced */
}

.msu-core-staff-columns-2 .msu-core-staff-grid-item {
    flex: 0 0 calc(50% - 10px); /* Two items per row accounting for gap */
    max-width: calc(50% - 10px); /* Ensure width is enforced */
}

.msu-core-staff-name {
    margin: 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.msu-core-staff-divider {
    width: 40px;
    height: 2px;
    background-color: #2271b1;
    margin: 12px auto;
    border: none;
}

.msu-core-staff-position {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* Responsive adjustments for grid */
@media (max-width: 1366px) and (min-width: 1025px) {
    .msu-core-staff-layout-grid {
        gap: 20px;
    }
    .msu-core-staff-columns-4 .msu-core-staff-grid-item {
        flex: 0 0 calc(25% - 15px); /* Keep four items per row */
        max-width: calc(25% - 15px);
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .msu-core-staff-layout-grid {
        gap: 20px;
    }
    .msu-core-staff-columns-4 .msu-core-staff-grid-item {
        flex: 0 0 calc(33.333% - 14px); /* Three items per row on medium-large screens */
        max-width: calc(33.333% - 14px);
    }
}

/* Tablet specific styles (portrait and landscape) */
@media (max-width: 820px) and (min-width: 768px) {
    .msu-core-staff-layout-grid {
        gap: 15px;
    }
    .msu-core-staff-columns-4 .msu-core-staff-grid-item {
        flex: 0 0 calc(33.333% - 10px); /* Three items per row on iPad */
        max-width: calc(33.333% - 10px);
    }
}

@media (max-width: 768px) and (min-width: 601px) {
    .msu-core-staff-layout-grid {
        gap: 15px;
    }
    .msu-core-staff-columns-4 .msu-core-staff-grid-item,
    .msu-core-staff-columns-3 .msu-core-staff-grid-item {
        flex: 0 0 calc(50% - 7.5px); /* Two items per row on medium screens */
        max-width: calc(50% - 7.5px);
    }
    .msu-core-staff-name {
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    .msu-core-staff-layout-grid {
        gap: 15px;
    }
    .msu-core-staff-columns-4 .msu-core-staff-grid-item,
    .msu-core-staff-columns-3 .msu-core-staff-grid-item,
    .msu-core-staff-columns-2 .msu-core-staff-grid-item {
        flex: 0 0 100%; /* One item per row on small screens */
        max-width: 350px; /* Optional max-width */
        margin: 0 auto; /* Center items */
    }
    .msu-core-staff-name {
        font-size: 1.1rem; /* Slightly larger font on mobile */
    }
}

/* List Layout Styles ============================*/

/* List container */
.msu-core-list-staff-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

/* Individual staff container */
.msu-core-list-staff-container {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: var(--animation-delay, 0s);
}

/* Staff profile card */
.msu-core-list-staff-profile {
    display: flex;
    flex-direction: row;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left 0.3s ease;
    border-left: 5px solid transparent;
}

.msu-core-list-staff-profile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-left: 5px solid #0046BE; /* MSU Blue accent on hover */
}

/* Image section container */
.msu-core-list-staff-image-section {
    display: flex;
    flex-direction: column;
    width: 250px;
    background-color: #f8f8f8;
}

/* Staff image container */
.msu-core-list-staff-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

/* Staff image */
.msu-core-list-staff-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.msu-core-list-staff-profile:hover .msu-core-list-staff-image img {
    transform: scale(1.05);
}

/* Contact information */
.msu-core-list-staff-contact {
    padding: 15px;
    background-color: #f8f8f8;
    border-top: 1px solid #eaeaea;
    font-size: 0.9rem;
}

.msu-core-list-staff-email,
.msu-core-list-staff-phone {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #333;
}

.msu-core-list-staff-email i,
.msu-core-list-staff-phone i {
    margin-right: 8px;
    color: #0046BE;
    width: 16px;
    text-align: center;
}

/* Google Scholar button */
.msu-core-google-scholar-container {
    margin-top: 15px;
}

.msu-core-google-scholar-button {
    display: inline-flex;
    align-items: center;
    background-color: #f2f2f2;
    color: #444;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.msu-core-google-scholar-button:hover {
    background-color: #0046BE;
    color: white;
}

.msu-core-google-scholar-button i {
    margin-right: 8px;
}

/* Staff details section */
.msu-core-list-staff-details {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.msu-core-list-staff-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #222;
}

.msu-core-list-staff-divider {
    width: 50px;
    height: 3px;
    background-color: #0046BE;
    margin-bottom: 15px;
}

.msu-core-list-staff-position {
    font-size: 1.1rem;
    color: #0046BE;
    margin-bottom: 8px;
    font-weight: 500;
}

.msu-core-list-staff-department {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

.msu-core-list-staff-view-profile {
    margin-top: auto;
}

.msu-core-list-staff-profile-link {
    display: inline-flex;
    align-items: center;
    background-color: #0046BE;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.msu-core-list-staff-profile-link:hover {
    background-color: #003490;
    transform: translateX(5px);
}

.msu-core-list-staff-profile-link i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.msu-core-list-staff-profile-link:hover i {
    transform: translateX(3px);
}

/* Responsive Styles for List Layout */
@media (max-width: 768px) {
    .msu-core-list-staff-profile {
        flex-direction: column;
    }
    
    .msu-core-list-staff-image-section {
        width: 100%;
    }
    
    .msu-core-list-staff-image {
        height: 250px;
    }
    
    .msu-core-list-staff-contact {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .msu-core-list-staff-email,
    .msu-core-list-staff-phone {
        width: 48%;
    }
    
    .msu-core-google-scholar-container {
        width: 100%;
        margin-top: 10px;
        text-align: center;
    }
    
    .msu-core-list-staff-details {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .msu-core-list-staff-contact {
        flex-direction: column;
    }
    
    .msu-core-list-staff-email,
    .msu-core-list-staff-phone {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .msu-core-list-staff-image {
        height: 200px;
    }
}

.msu-core-list-staff-profile-link {
    display: block;
    text-decoration: none;
}

/* Use new list layout styles defined above */
.msu-core-list-staff-profile {
    background: #f5f5f5;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    transition: all 0.3s ease;
    padding: 25px;
    cursor: pointer;
    position: relative;
}

.msu-core-list-staff-profile-link:hover .msu-core-list-staff-profile {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    background: #f0f0f0;
}

/* View Details Overlay */
.msu-core-list-staff-profile::after {
    content: 'View Details →';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f8f8;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
}

.msu-core-list-staff-profile-link:hover .msu-core-list-staff-profile::after {
    opacity: 1;
}

/* Image Section */
.msu-core-list-staff-image-section {
    flex: 0 0 220px;
    margin-right: 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.msu-core-list-staff-image {
    width: 200px;
    height: 200px;
    overflow: hidden;
    margin: 0 auto 15px;
    transition: transform 0.5s ease;
}

.msu-core-list-staff-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Contact Information */
.msu-core-list-staff-contact {
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.msu-core-list-staff-email {
    margin-bottom: 15px;
}

.msu-core-list-staff-email span {
    color: #0046BE;
    transition: color 0.3s ease;
}

.msu-core-list-staff-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.msu-core-list-staff-social-icon {
    color: #555;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
}

/* Details Section */
.msu-core-list-staff-details {
    flex: 1;
    padding-top: 10px;
    position: relative;
    z-index: 1;
}

.msu-core-list-staff-name {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.msu-core-list-staff-divider {
    width: 60px;
    height: 5px;
    background-color: #0046BE;
    margin: 0 0 20px 0;
    border: none;
}

.msu-core-list-staff-position {
    font-weight: 500;
    color: #555;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.4;
}

/* Animation */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staff Grid Item */
.msu-core-staff-grid-item {
    background: #fff; /* Default white background */
    border-radius: 6px; /* Match your existing border radius */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Adjust shadow */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%; /* Ensures equal height */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-bottom 0.3s ease;
    position: relative;
    box-sizing: border-box; /* Include padding and border in width calculation */
    border-bottom: 3px solid transparent; /* Transparent border initially, becomes blue on hover */
}

/* Staff details section */
.msu-core-staff-details {
    padding: 20px;
    text-align: center;
    flex: 1;
    background-color: #ffffff;
    position: relative;
    z-index: 1;
}

.msu-core-staff-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #0046BE; /* MSU Blue bottom border on hover */
}

.msu-core-staff-profile {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Image container */
.msu-core-staff-image-container {
    width: 100%;
    height: 250px; /* Taller fixed height for all images */
    overflow: hidden;
    position: relative;
    display: block;
}

.msu-core-staff-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

/* Image overlay - hidden by default */
.msu-core-staff-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 70, 190, 0.8); /* MSU Blue with opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none; /* Makes the overlay clickable through to the link */
}

.msu-core-staff-view-profile {
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 15px;
    border: 2px solid white;
    border-radius: 4px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    pointer-events: auto; /* Make the button clickable */
    text-align: center;
}

.msu-core-staff-grid-item:hover .msu-core-staff-image {
    transform: scale(1.05);
}

.msu-core-staff-grid-item:hover .msu-core-staff-overlay {
    opacity: 1;
}

.msu-core-staff-grid-item:hover .msu-core-staff-view-profile {
    transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .msu-core-list-staff-profile {
        padding: 20px;
    }

    .msu-core-list-staff-image-section {
        flex: 0 0 200px;
        margin-right: 25px;
    }

    .msu-core-list-staff-image {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 768px) {
    .msu-core-list-staff-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 25px;
    }

    .msu-core-list-staff-image-section {
        margin-right: 0;
        margin-bottom: 25px;
        flex: 0 0 auto;
    }

    .msu-core-list-staff-divider {
        margin-left: auto;
        margin-right: auto;
    }

    .msu-core-list-staff-social {
        margin-top: 15px;
    }

    .msu-core-list-staff-profile::after {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .msu-core-list-staff-image {
        width: 160px;
        height: 160px;
    }

    .msu-core-list-staff-name {
        font-size: 1.3rem;
    }

    .msu-core-list-staff-position {
        font-size: 1rem;
    }

    .msu-core-list-staff-profile {
        padding: 20px;
    }

    .msu-core-list-staff-email {
        font-size: 0.85rem;
    }
}

/* Prevent text selection on interactive elements */
.msu-core-list-staff-profile-link {
    user-select: none;
    -webkit-user-select: none;
}

/* Disable hover effects on nested elements when parent is hovered */
.msu-core-list-staff-profile-link:hover .msu-core-list-staff-image img {
    transform: none;
}

.msu-core-list-staff-profile-link:hover .msu-core-list-staff-email span {
    color: inherit;
}

.msu-core-list-staff-profile-link:hover .msu-core-list-staff-social-icon {
    color: inherit;
    background: transparent;
}

/*google scholer btn*/
.msu-core-google-scholar-container {
    margin-top: 10px;
    text-align: center;
}

.msu-core-google-scholar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background-color: #0046BE;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

.msu-core-google-scholar-button:hover {
    background-color: #042d70;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.msu-core-google-scholar-button i {
    margin-right: 8px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .msu-core-google-scholar-button {
        padding: 6px 10px;
        font-size: 13px;
    }
}