/* General container for the entire directory */
.msdct-staff-directory-wrapper {
    margin: 20px 0;
}

/* Styling for the search and filter form */
.msdct-staff-filters {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.msdct-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.msdct-filter-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows groups to take available space */
    min-width: 180px; /* Minimum width for each group */
}

.msdct-filter-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.95em;
}

.msdct-filter-form input[type="search"],
.msdct-filter-form select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    width: 100%; /* Make input/select fill their group */
    box-sizing: border-box; /* Include padding and border in element's total width */
}

.msdct-filter-button {
    padding: 10px 18px;
    background-color: #0073aa; /* WordPress primary blue */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    align-self: flex-end; /* Align buttons to the bottom of the row */
}

.msdct-filter-button:hover {
    background-color: #005177;
}

.msdct-clear-button {
    background-color: #dc3232; /* A red color for clear */
}

.msdct-clear-button:hover {
    background-color: #a00;
}

/* Staff List Container - for overall scrolling if needed */
.msdct-staff-list-container {
    /* If you want a fixed height container with its own scrollbar, apply styles here: */
    /* max-height: 800px; */
    /* overflow-y: auto; */
    /* border: 1px solid #eee; */
    /* padding: 10px; */
    position: relative; /* For loading indicator positioning */
}

/* Loading Indicator */
#msdct-loading-indicator {
    text-align: center;
    padding: 20px;
    font-size: 1.2em;
    color: #555;
    background: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}


/* Staff Cards Wrapper - Grid Layout */
.msdct-staff-cards-wrapper {
    display: grid;
    /* Responsive grid:
       - minmax(250px, 1fr) means columns will be at least 250px wide,
         and will grow to take equal space.
       - auto-fit ensures it fits as many columns as possible.
    */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px; /* Space between cards */
    padding: 10px; /* Optional padding around the grid */
}

/* Individual Staff Card */
.msdct-staff-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex; /* Flex layout for photo and content */
    flex-direction: column;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    padding: 20px; /* Internal padding for card content */
}

.msdct-staff-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.msdct-card-photo {
    margin-bottom: 15px;
}

.msdct-card-photo img {
    width: 120px; /* Adjust photo size */
    height: 120px;
    border-radius: 50%; /* Make it round */
    object-fit: cover;
    border: 3px solid #0073aa; /* Accent border */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.msdct-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes button to bottom if content varies */
}

.msdct-card-name {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.2;
}

.msdct-card-name a {
    color: #333;
    text-decoration: none;
}

.msdct-card-name a:hover {
    color: #0073aa;
}

.msdct-card-position,
.msdct-card-rank,
.msdct-card-campus,
.msdct-card-email {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 5px;
}

.msdct-card-email a {
    color: #0073aa;
    text-decoration: none;
}

.msdct-card-email a:hover {
    text-decoration: underline;
}

.msdct-card-link {
    margin-top: 15px;
}

.msdct-card-link .button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.msdct-card-link .button:hover {
    background-color: #005177;
}

/* No results message */
.msdct-no-results, .msdct-error {
    text-align: center;
    padding: 30px;
    font-size: 1.2em;
    color: #555;
    background-color: #f0f0f0;
    border-radius: 8px;
    grid-column: 1 / -1; /* Make it span all columns in the grid */
}

/* Media Queries for responsiveness */
@media (max-width: 768px) {
    .msdct-staff-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .msdct-filter-group {
        width: 100%;
        min-width: unset;
    }
    .msdct-filter-form button {
        width: 100%;
    }
    .msdct-staff-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Smaller cards on small screens */
    }
}