/* MemberPress Directory Styles */
.mfx-memberpress-directory {
    width: 90vw;
    max-width: none;
    margin-left: calc(50% - 45vw);
    margin-right: calc(50% - 45vw);
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-sizing: border-box;
    /* Break out of WordPress constrained layout */
    position: relative;
}

/* Grid Layout */
.mfx-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch; /* Ensure equal heights */
}

/* List Layout */
.mfx-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card Container */
.mfx-card-container {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.mfx-card-container:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Card Styles */
.mfx-card {
    height: 30vh;
    width: 100%;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.mfx-grid .mfx-card {
    height: 30vh;
}

.mfx-list .mfx-card {
    height: auto;
    min-height: 8rem;
}

/* Field Styles */
.mfx-dir-field {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #4a5568; 
    
    /* Text truncation */
    white-space: nowrap;
    /* overflow: hidden; */
    text-overflow: ellipsis;
}

.mfx-dir-field:last-child {
    margin-bottom: 0;
}

/* Member ID Styling */
.mfx-card br + .mfx-dir-field:first-of-type {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .mfx-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .mfx-memberpress-directory {
        padding: 1.5rem;
    }
    
    .mfx-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .mfx-memberpress-directory {
        padding: 1rem;
    }
    
    .mfx-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .mfx-memberpress-directory {
        padding: 0.75rem;
    }
    
    .mfx-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mfx-card {
        height: auto;
        min-height: 12rem;
        padding: 1rem;
    }
}

/* Pagination Styles */
.mfx-pagination {
    margin-top: 2rem;
    text-align: center;
}

.mfx-pagination .navigation {
    display: inline-block;
}

.mfx-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mfx-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.mfx-pagination .page-numbers:hover {
    background: #f5f5f5;
    border-color: #999;
}

.mfx-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.mfx-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}

.mfx-pagination .prev,
.mfx-pagination .next {
    font-weight: 600;
}

/* Hero Image Styles */
.mfx-hero-image {
    width: 100%;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 4px;
}

.mfx-hero-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.mfx-hero-image-single {
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mfx-hero-image-single img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

/* Account Profile Hero Image Row */
.mepr-dir-hero-image-row {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid var(--wp--preset--color--primary, var(--theme-primary-color, #0073aa));
}

.mepr-dir-hero-image-row label {
    font-weight: normal;
}

/* File Upload Styling */
.mepr-dir-hero-image-row input[type="file"] {
    padding: 8px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
    width: 100% !important;
    max-width: 300px;
}

.mepr-dir-hero-image-row input[type="file"]:hover {
    border-color: var(--wp--preset--color--primary, var(--theme-primary-color, #0073aa));
    background: #f0f8ff;
}

.mepr-dir-hero-image-row small {
    color: #666;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

/* Remove Image Button */
.mepr-dir-hero-image-row .button-secondary {
    background: #f44336;
    border-color: #f44336;
    color: white;
    font-size: 12px;
    padding: 4px 12px;
    height: auto;
}

.mepr-dir-hero-image-row .button-secondary:hover {
    background: #d32f2f;
    border-color: #d32f2f;
    color: white;
}

/* List View Layout with Square Hero Image */
.mfx-list .mfx-list-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-height: 100px;
    flex-direction: row;
}

.mfx-list-hero-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.mfx-list-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.mfx-list-content {
    flex: 1;
    min-width: 0; /* Allows content to shrink */
}

/* Profile Field Styling */
.mfx-profile-title {
    font-size: 1.4em;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
}

.mfx-profile-short-desc {
    font-size: 1em;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
}

.mfx-profile-long-desc {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #555;
}

.mfx-profile-url a,
.mfx-profile-email a {
    color: var(--wp--preset--color--primary, var(--theme-primary-color, #0073aa));
    text-decoration: none;
}

.mfx-profile-url a:hover,
.mfx-profile-email a:hover {
    text-decoration: underline;
}

.mfx-profile-phone {
    font-weight: 500;
    color: #333;
}

.mfx-dir-field {
    margin-bottom: 6px;
    font-size: 0.9em;
}

/* Single Profile Styling */
.mfx-single-profile-title {
    font-size: 2.2em;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid var(--wp--preset--color--primary, var(--theme-primary-color, #0073aa));
    padding-bottom: 10px;
}

/* .mfx-membership-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--wp--preset--color--primary, var(--theme-primary-color, #0073aa));
} */

.mfx-membership-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--wp--preset--color--primary, var(--theme-primary-color, #0073aa));
}

.mfx-profile-field {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.mfx-profile-field:last-child {
    border-bottom: none;
}

.mfx-no-content {
    color: #999;
    font-style: italic;
}