/* --- Core Structure and Grid --- */
.mdf-container {
    width: 100% !important; /* FORCING full width */
    margin: 20px 0;
    display: block !important; /* FORCING block behavior for full width */
}

.mdf-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    width: 100% !important; /* FORCING full width */
    /* UPDATED: Complete filter bar background color */
    background-color: #F6E7C5; 
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Retaining subtle shadow for the bar */
}

.mdf-filter-item {
    flex-grow: 1;
    min-width: 180px;
}

/* 4-Column Grid for large screens (1320px width assumed) */
.mdf-grid {
    display: grid;
    /* 4 columns for desktop, responsive down to 1fr min */
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px;
}

/* --- Input and Select Styling --- */
.mdf-input,
.mdf-select {
    width: 100%;
    padding: 10px 15px;
    /* UPDATED: Field text color */
    color: #3D3D3D;
    /* UPDATED: Field border */
    border: 1px solid black;
    /* UPDATED: Field background color */
    background-color: #F0F5FA;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    /* UPDATED: Field font family */
    font-family: "Merriweather", Sans-serif;
}

/* --- Category Dropdown Hover/Focus (Using the button-like appearance of the select) --- */
/* The select element doesn't have a true hover background property like buttons, 
   but we can style the container or mimic a hover on the select itself. 
   I will ensure the select uses the field background color. */


/* --- Button Styling (Reset Filters) --- */
.mdf-reset-button {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s, color 0.3s;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;

    /* UPDATED: Reset button base style */
    font-family: "Merriweather", Sans-serif;
    background-color: #EC7632;
    color: white; /* Initial text color */
}

.mdf-reset-button:hover {
    /* UPDATED: Reset button hover style */
    background-color: white;
    color: #073847;
    transform: translateY(-1px);
}

/* --- Member Card Styling --- */
.mdf-member-card {
    /* REVERTED: Box border, box-shadow, background */
    background: #ffffff; /* White background for the card */
    border: 1px solid #e0e0e0; /* Subtle light border */
    border-radius: 8px; /* Rounded corners for the box */
    padding: 20px; /* Increased padding for better card look */
    text-align: center;
    /* Initial subtle shadow */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); 
    transition: transform 0.3s, opacity 0.5s, box-shadow 0.3s; /* Added box-shadow transition */
}

.mdf-member-card:hover {
    transform: translateY(-5px); /* Subtle hover lift */
    /* Enhanced shadow on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); 
}

.mdf-member-card.hidden {
    display: none;
    opacity: 0; 
}

/* IMAGE STYLING: Rounded image with thick border */
.mdf-image-container {
    /* Image size is 66% of its container (which is 1/4 of the grid) */
    width: 66%; 
    padding-bottom: 66%; /* Creates a perfect square container */
    height: 0;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    
    /* Custom Border */
    border: 3px solid #EC7632; 
    
    /* Removed box-shadow */
    box-shadow: none; 
    position: relative;
    transition: border-color 0.3s;
}

.mdf-member-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* NAME STYLE */
.mdf-member-title {
    margin-bottom: 10px;
    font-family: "Merriweather", Sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1em;
    letter-spacing: -0.05em;
    color: #333; /* Ensuring readability */
}

/* DESIGNATION STYLE */
.mdf-member-designation {
    font-family: "Merriweather", Sans-serif;
    font-size: 16px;
    font-weight: 500;
    font-style: italic;
    line-height: 1em;
    letter-spacing: 0em;
    color: #005120; 
    margin: 0 0 10px 0; /* Updated margin-bottom to 10px */
}

/* DOB and Category (maintaining previous look, updating margin) */
.mdf-member-dob {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 10px 0; /* Updated margin-bottom to 10px */
}

.mdf-dob-label {
    font-weight: 600;
    color: #444;
}

.mdf-member-category-display {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 10px 0; /* Updated margin-bottom to 10px */
    padding-top: 5px; /* Less padding */
    border-top: none; /* Removing border line */
}


.mdf-no-results-message {
    grid-column: 1 / -1; /* Span across all columns */
    text-align: center;
    font-size: 1.2rem;
    color: #cc0000;
    padding: 50px 0;
    background-color: #fff0f0;
    border: 1px dashed #f0ccb7;
    border-radius: 8px;
}

/* --- Responsive Adjustments --- */

/* Tablet View (600px to 1024px) - 3 Columns */
@media (min-width: 601px) and (max-width: 1024px) {
    .mdf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile View (up to 600px) - 2 Columns */
@media (max-width: 600px) {
    .mdf-filters {
        flex-direction: column;
    }

    .mdf-filter-item {
        min-width: 100%;
    }
    
    .mdf-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns on mobile */
        gap: 20px;
    }

    .mdf-member-title {
        font-size: 18px; /* Smaller title on mobile */
    }
    
    .mdf-image-container {
        width: 80%; /* Slightly larger images on smaller screens */
        padding-bottom: 80%;
    }
}