/* wp-content/plugins/mikes-bag-finder/css/mikes-bag-finder.css */

#mikes-bag-finder-wrapper {
    margin-bottom: 2em;
    padding: 1.5em;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 5px;
    max-width: 1200px; /* Adjust as needed, common max-width for content */
    margin-left: auto;
    margin-right: auto;
}

#mikes-bag-search-form {
    display: flex;
    flex-direction: column; /* Stack rows vertically */
    gap: 15px; /* Space between the slow/fast rows */
    margin-bottom: 2em;
    align-items: center; /* Changed to center content horizontally */
}

/* Style for the search rows */
.mbf-search-row {
    display: flex; /* Make items inside horizontal */
    align-items: flex-end; /* Align label and select vertically */
    gap: 15px; /* Space between label/selects and "to" */
}

.mbf-field-group {
    display: flex;
    align-items: center; /* Align label and "to" horizontally */
    gap: 5px; /* Space between select elements and "to" */
}

.mbf-field-group label {
    margin-bottom: 0;
    font-weight: bold;
}

.mbf-field-group select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 80px; /* Adjust as needed */
}

#mikes-bag-search-form button[type="submit"] {
    padding: 10px 20px;
    background-color: #0073aa; /* WordPress primary blue */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#mikes-bag-search-form button[type="submit"]:hover {
    background-color: #005a87;
}

/* --- Sorting Controls --- */
#mbf-sorting-controls {
    /* Styles for the sorting dropdown container */
}

#mbf-sorting-controls label {
    margin-right: 0.5em;
    font-weight: bold;
}

#mbf_sort_by { /* ID for the select dropdown */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px; /* Adjust as needed */
    background-color: #fff; /* Ensure it stands out on the wrapper bg */
}
/* --- END: Sorting Controls --- */


#mikes-bag-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.mbf-initial-message,
#mikes-bag-results > p { /* Catches messages like "Sorting results..." or "No bags found..." */
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}


@media (min-width: 992px) {
    #mikes-bag-results {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mbf-bag-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.mbf-bag-item a {
    text-decoration: none;
    color: inherit;
}

.mbf-bag-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.mbf-bag-item h3 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.mbf-bag-item p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

/* Rating Display */
.mbf-rating-display {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.mbf-avg-rating {
    font-weight: bold;
    color: #333;
}

/* New Dropdown Rating Input & Already Rated Message */
.mbf-rating-input {
    margin-top: 15px;
    display: flex; 
    gap: 10px; 
    align-items: center;
    min-height: 38px; /* Reserve space similar to dropdown+button */
}

.mbf-rating-input select.mbf-rating-dropdown {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 120px;
}

.mbf-rating-input button.mbf-submit-rating {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.mbf-rating-input button.mbf-submit-rating:hover {
    background-color: #218838;
}

/* Styles for the "Already Rated" message display */
.mbf-rating-input.already-rated {
    /* margin-top: 15px; (Inherited from .mbf-rating-input) */
    justify-content: center; /* Center the message if it's the only child */
}

.mbf-already-rated-message {
    font-style: italic;
    color: #555;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.9em;
}

/* Message for rating submission feedback */
.mbf-rating-message {
    display: block;
    margin-top: 10px;
    font-size: 0.85em;
    min-height: 1.2em; /* Prevent layout jump when message appears/disappears */
}

.mbf-rating-message.success {
    color: green;
}

.mbf-rating-message.error {
    color: red;
}

/* --- Pagination Styles --- */
.mbf-pagination-container {
    margin-top: 2em;
    display: flex;
    justify-content: center; /* Center the pagination block */
}

.mbf-pagination .pagination-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Allow pagination items to wrap on smaller screens */
    justify-content: center; /* Center items if they wrap */
    gap: 5px; /* Space between pagination items */
}

.mbf-pagination .pagination-item .page-link,
.mbf-pagination .pagination-item span { /* Applied to both <a> and <span> for consistency */
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #0073aa; /* WordPress blue */
    background-color: #fff;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1.5; /* Ensure text is vertically centered well */
}

.mbf-pagination .pagination-item a.page-link:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.mbf-pagination .pagination-item.active .page-link, /* Targets <a> if it somehow gets .active */
.mbf-pagination .pagination-item.active span.current-page { /* Specifically targets the span for current page */
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
    cursor: default;
}

.mbf-pagination .pagination-item.disabled .page-link, /* Targets <a> if it somehow gets .disabled */
.mbf-pagination .pagination-item.disabled span { /* Specifically targets the span for disabled links */
    color: #aaa;
    cursor: default;
    background-color: #f9f9f9;
    border-color: #eee;
}

.mbf-pagination .pagination-item.pagination-ellipsis span {
    border: none;
    background-color: transparent;
    color: #555;
    padding: 8px 5px; /* Adjusted padding for ellipsis */
}