/* Search and Filter Styles for Christian Career Resources Website */

.search-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

#job-search {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s, box-shadow 0.3s;
    min-height: 44px;
}

#job-search:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
    outline: none;
}

#search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#search-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#search-button.active {
    background-color: rgba(30, 58, 138, 0.1);
}

.search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.95rem;
    color: #333;
    min-height: 44px;
    cursor: pointer;
}

.filter-group select:focus {
    border-color: #1e3a8a;
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.2);
}

.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

#results-count {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

#clear-filters {
    background-color: transparent;
    border: 1px solid #ccc;
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 44px;
}

#clear-filters:hover {
    background-color: #e9ecef;
}

.active-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #333;
}

.remove-filter {
    background: none;
    border: none;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: 6px;
    padding: 2px 4px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.remove-filter:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.no-results {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-left: 4px solid #dc3545;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.no-results p {
    margin: 0.5rem 0;
}

.clear-filters-link {
    background: none;
    border: none;
    color: #1e3a8a;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    text-decoration: underline;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Mobile Responsive Design for Search */
@media (max-width: 768px) {
    .search-container {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .filter-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-group select {
        padding: 14px 12px;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .search-results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    #clear-filters {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    #job-search {
        padding: 14px 50px 14px 16px;
        font-size: 1rem;
        min-height: 48px;
    }
    
    #search-button {
        right: 8px;
        padding: 10px;
        min-width: 48px;
        min-height: 48px;
    }
    
    .search-clear {
        right: 56px;
        min-width: 48px;
        min-height: 48px;
    }
}

@media (max-width: 576px) {
    .search-container {
        padding: 0.8rem;
        margin: 1rem 0;
    }
    
    .filter-group label {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }
    
    .filter-group select {
        padding: 16px 12px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    #job-search {
        padding: 16px 50px 16px 16px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    #search-button, .search-clear {
        min-width: 50px;
        min-height: 50px;
    }
    
    #clear-filters {
        min-height: 50px;
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .filter-tag {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .remove-filter {
        min-width: 28px;
        min-height: 28px;
        font-size: 1.2rem;
    }
}

/* Animation for job items */
.job-item {
    transition: opacity 0.3s ease-in-out;
}

.job-item[style*="display: none"] {
    opacity: 0;
}

.job-item:not([style*="display: none"]) {
    opacity: 1;
}

/* No Results Message Styles */
.no-results-message {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-results-content h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results-content p {
    color: #6c757d;
    margin-bottom: 1rem;
}

.no-results-content ul {
    text-align: left;
    display: inline-block;
    margin: 1rem 0;
    color: #6c757d;
}

.no-results-content li {
    margin-bottom: 0.5rem;
}

.suggestion-links a {
    color: #007bff;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.suggestion-links a:hover {
    background-color: #e7f3ff;
    text-decoration: underline;
}

/* Enhanced Search Input Styles */
.search-container {
    position: relative;
}

.search-bar input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Loading indicator for search */
.search-loading {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.search-loading.active {
    display: block;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced filter tags */
.filter-tag {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    margin: 0.25rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.filter-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.filter-tag .remove-filter {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s;
}

.filter-tag .remove-filter:hover {
    background: rgba(255,255,255,0.3);
}

/* Search suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .no-results-message {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .no-results-content h3 {
        font-size: 1.25rem;
    }
    
    .suggestion-links {
        display: block;
        margin-top: 1rem;
    }
    
    .suggestion-links a {
        display: inline-block;
        margin: 0.25rem;
        padding: 0.5rem 0.75rem;
        background-color: #e7f3ff;
        border-radius: 20px;
    }
}

