/**
 * Search Filters CSS
 * Styles for the post-search filter modal and active filter display
 */

/* Two-line display for jumping ability options */
.filter-option-label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.filter-option-range {
    font-size: 11px;
    color: #666;
}

/* Adjust option height for two-line display */
.filter-option[data-category="jumping-ability"] {
    padding: 8px 12px;
    min-height: 40px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 0 0 calc(33% - 4px); /* Ensure 2 columns */
}

/* Ensure jumping ability labels maintain column layout */
.filter-option[data-category="jumping-ability"] label {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Search Header */
.search-header {
    text-align: center;
    margin-bottom: 15px;
}

/* Filter Button Container */
.filter-button-container {
    text-align: center;
    margin-bottom: 20px;
}

/* Classic Search Link */
.classic-search-link {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.classic-search-link a {
    color: #84bc41;
    text-decoration: none;
}

.classic-search-link a:hover {
    text-decoration: underline;
}

/* Filter Button */
.filter-button {
    padding: 8px 20px;
    background-color: #84bc41;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.filter-button:hover {
    background-color: #6b9c34;
}

/* Modal Container */
.filter-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.filter-modal-content {
    position: relative;
    background-color: #fff;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close-filter-modal {
    font-size: 24px;
    color: #777;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-filter-modal:hover {
    color: #333;
}

/* Filter Categories Container */
.filter-categories-container {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Filter Category */
.filter-category {
    margin-bottom: 35px;
}

.filter-category h4 {
    color: #333;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

/* Filter Options */
.filter-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    justify-content: center;
}

/* Group Headers for Location Filters */
.filter-group-header {
    width: 100%;
    font-weight: bold;
    font-size: 14px;
    color: #666;
    margin-top: 15px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    text-align: center;
    font-style: italic;
}

.filter-group-header:first-child {
    margin-top: 0;
}

.filter-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 calc(22% - 4px); /* 2 columns with gap adjustment */
}

/* Hide the actual checkbox inputs - users should only see button-style toggles */
.filter-option input[type="checkbox"] {
    display: none;
}

/* Ensure labels don't block clicks - make them pass-through */
.filter-option label {
    pointer-events: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: inherit;
}

/* Ensure all child elements within labels also don't block clicks */
.filter-option label * {
    pointer-events: none;
}

.filter-option:hover {
    background-color: #efefef;
    border-color: #ccc;
}

.filter-option.selected {
    background-color: #e6f3d9;
    border-color: #84bc41;
    color: #333;
}

/* Modal Footer */
.filter-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
}

/* Action Buttons */
.filter-action-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-apply-filters {
    background-color: #84bc41;
    border: 1px solid #84bc41;
    color: white;
}

.btn-apply-filters:hover {
    background-color: #6b9c34;
}

.btn-clear-filters {
    background-color: #fff;
    border: 1px solid #ddd;
    color: #555;
}

.btn-clear-filters:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

/* Active Filters Display */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 5px 0 15px 0;
    padding-left: 25px;
    padding-right: 25px;
    width: 100%;
    box-sizing: border-box;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    margin: 5px;
    line-height: 1.4;
    min-width: 0;
    position: relative;
    height: 45px;
    vertical-align: top;
    box-sizing: border-box;
}

/* Stack layout for pills with category labels */
.filter-pill.show-category {
    flex-direction: column;
    padding: 3px 20px 10px 20px;
    justify-content: center; /* Center content vertically for better visual alignment */
    height: 45px;
}

.filter-pill .filter-category {
    display: none;
}

/* Show category label for price filters */
.filter-pill.show-category .filter-category {
    display: block;
    font-size: 11px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin: 0;
    text-align: center;
    width: 100%;
    line-height: 1;
}

.filter-pill .filter-value {
    font-size: 14px;
    text-align: center;
}

/* Content wrapper for pills with categories */
.filter-pill.show-category .filter-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    line-height: 1.2;
}

.filter-pill.show-category .filter-value {
    margin-right: 8px;
}

.filter-pill.show-category .remove-filter {
    margin-left: 8px;
}

.remove-filter {
    margin-left: 12px;
    font-size: 18px;
    line-height: 14px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.remove-filter:hover {
    color: #333;
}

/* Loading and Error States */
.filter-loading, .filter-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.filter-error {
    color: #d9534f;
    margin-bottom: 10px;
}

.retry-button {
    display: block;
    margin: 0 auto 15px;
    padding: 6px 12px;
    background-color: #84bc41;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.retry-button:hover {
    background-color: #6b9c34;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .filter-modal-content {
        width: 95%;
        margin: 30px auto;
        max-height: 85vh;
    }

    .filter-options-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-option {
        padding: 6px 8px;
        font-size: 13px;
        height: 32px;
        flex: 0 0 calc(35% - 4px); /* 2 columns with gap adjustment */
    }

    .filter-group-header {
        font-size: 13px;
        margin-top: 12px;
        margin-bottom: 6px;
    }

    .filter-action-btn {
        padding: 7px 14px;
        font-size: 13px;
    }
}

/* Mobile slide-up animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

@media (max-width: 480px) {
    .filter-modal {
        background-color: rgba(0, 0, 0, 0);
        transition: background-color 0.3s ease;
    }
    
    .filter-modal.open {
        background-color: rgba(0, 0, 0, 0.5);
    }
    
    .filter-modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }
    
    .filter-modal.open .filter-modal-content {
        transform: translateY(0);
    }

    .filter-modal-header {
        padding: 12px 15px;
    }

    .filter-categories-container {
        padding: 10px;
    }

    .filter-category h4 {
        font-size: 15px;
    }

    .filter-options-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-option {
        padding: 6px 8px;
        font-size: 12px;
        height: 32px;
        flex: 0 0 calc(35% - 4px); /* 2 columns with gap adjustment */
    }

    .filter-group-header {
        font-size: 12px;
        margin-top: 10px;
        margin-bottom: 5px;
    }

    .filter-modal-footer {
        padding: 12px 15px;
    }

    .filter-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Hide active filter pills on mobile as specified in requirements */
    .active-filters {
        display: none;
    }
}

/* No Results Message Styling */
.no-results-message {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
}

.no-results-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-results-content p {
    color: #28a745; /* Green text consistent with site branding */
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

.no-results-content a {
    color: #28a745;
    text-decoration: underline;
    font-weight: 500;
}

.no-results-content a:hover {
    color: #1e7e34; /* Darker green on hover */
    text-decoration: none;
}

.no-results-content a:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Responsive styling for mobile */
@media (max-width: 767px) {
    .no-results-message {
        padding: 30px 15px;
    }
    
    .no-results-content p {
        font-size: 14px;
    }
}