/* Shortcode User Directory Styles */

/* Header Design Improvements */
.wpuf-user-directory-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem !important;
    margin: 2rem 0 !important;
    flex-wrap: wrap !important;
}

/* Search Container Styling */
.wpuf-search-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

/* Filter Controls Styling */
.wpuf-filter-controls {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .wpuf-user-directory-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    
    .wpuf-search-container {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .wpuf-search-container > div {
        width: 100% !important;
    }
    
    .wpuf-ud-search-wrapper {
        width: 100% !important;
        max-width: none !important;
    }
    
    .wpuf-filter-controls {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .wpuf-filter-controls > div {
        width: 100% !important;
    }
    
    .wpuf-filter-controls select,
    .wpuf-filter-controls button {
        width: 100% !important;
    }
}

/* Tablet Design */
@media (min-width: 769px) and (max-width: 1024px) {
    .wpuf-user-directory-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .wpuf-search-container {
        width: 100% !important;
        justify-content: flex-start !important;
    }
    
    .wpuf-filter-controls {
        width: 100% !important;
        justify-content: flex-start !important;
    }
}

/* Desktop Design Improvements */
@media (min-width: 1025px) {
    .wpuf-search-container {
        flex: 0 1 auto !important;
    }
    
    .wpuf-filter-controls {
        flex: 0 1 auto !important;
    }
}

/* Improve dropdown and input styling */
.wpuf-ud-search-wrapper {
    min-width: 250px;
}

.wpuf-ud-search-by,
.wpuf-ud-sort-by,
.wpuf-ud-sort-order {
    min-width: 120px;
    cursor: pointer;
}

.wpuf-ud-reset-filters {
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpuf-ud-reset-filters:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* No Users Found - Table Layout Centering */
.wpuf-user-directory-no-users td {
    text-align: center !important;
    padding: 3rem 1rem !important;
    vertical-align: middle !important;
}

.wpuf-user-directory-no-users .wpuf-text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.wpuf-user-directory-no-users .wpuf-text-gray-500 {
    color: #6b7280;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.wpuf-user-directory-no-users .wpuf-text-gray-400 {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* No Users Found - List Layouts */
.wpuf-no-users-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* Ensure parent container allows centering - only when no users */
.wpuf-ud-list.wpuf-no-users-state {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Normal state - preserve original layout */
.wpuf-ud-list:not(.wpuf-no-users-state) {
    /* Preserve original display property */
}

/* When no users container is present */
.wpuf-ud-list:has(.wpuf-no-users-container) {
    min-height: 400px;
}

/* Fallback for browsers without :has() support */
.wpuf-ud-list.wpuf-no-users-state {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override grid layouts when showing no users */
.wpuf-ud-list ul[role="list"]:has(.wpuf-no-users-container),
.wpuf-ud-list .wpuf-no-users-container {
    grid-column: 1 / -1 !important; /* Span full width in grid */
    margin: 0 auto !important;
    width: 100% !important;
    max-width: none !important;
}

.wpuf-no-users-found {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 2rem;
}

/* Table specific adjustments */
.wpuf-table-responsive .wpuf-user-directory-no-users {
    width: 100%;
}

/* Ensure proper table structure */
.wpuf-ud-tbody tr.wpuf-user-directory-no-users {
    display: table-row;
}

.wpuf-ud-tbody tr.wpuf-user-directory-no-users td {
    display: table-cell;
}

/* Field Icon Styles */
.wpuf-field-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.wpuf-field-icon-img {
    object-fit: contain;
}