/* AJAX Search Pro Frontend Styles */

/* Enhanced AJAX Search Pro Frontend Styles - Clean & Modern */

.asp-search-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Search Form Styles */
.asp-search-form-wrapper {
    position: relative;
    z-index: 10;
}

.asp-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.asp-search-input-wrapper:hover {
    border-color: #d1d5db;
}

.asp-search-input-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.asp-search-input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #111827;
}

.asp-search-input::placeholder {
    color: #6b7280;
}

/* Search Button */
.asp-search-btn {
    padding: 8px 18px;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.asp-search-btn:hover {
    background: #1d4ed8;
}

.asp-search-icon {
    font-size: 18px;
    line-height: 1;
}

/* Loading Spinner */
.asp-loading-spinner {
    position: absolute;
    right: 76px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 5;
}

.asp-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: asp-spin 0.8s linear infinite;
}

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

/* FIXED: Search Results Positioning */
.asp-search-results-wrapper {
    position: relative;
    margin-top: 0;
    height: 0; /* FIXED: Prevents layout shift */
    overflow: visible;
}

.asp-search-results {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.asp-search-results.asp-has-results {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Custom Scrollbar (subtle) */
.asp-search-results::-webkit-scrollbar {
    width: 6px;
}

.asp-search-results::-webkit-scrollbar-track {
    background: #f9fafb;
}

.asp-search-results::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.asp-search-results::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Result Items - Clean & Simple */
.asp-result-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.asp-result-item:hover,
.asp-result-item.asp-result-focused {
    background-color: #f8fafc;
}

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

.asp-result-image {
    flex-shrink: 0;
    margin-right: 16px;
}

.asp-result-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

/* Image placeholder for missing images */
.asp-result-image.asp-no-image {
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #9ca3af;
}

.asp-result-content {
    flex: 1;
    min-width: 0;
}

.asp-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asp-result-item:hover .asp-result-title {
    color: #2563eb;
}

.asp-result-excerpt {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asp-result-meta {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.asp-result-type {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 11px;
}

.asp-result-date {
    font-style: italic;
}

/* No Results */
.asp-no-results {
    padding: 32px 20px;
    text-align: center;
    color: #6b7280;
}

.asp-no-results::before {
    content: '🔍';
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.7;
}

/* Load More Button */
.asp-load-more-wrapper {
    padding: 16px 20px;
    text-align: center;
}

.asp-load-more-btn {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
}

.asp-load-more-btn:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
}

/* Overlay Search Styles */
.asp-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.asp-search-overlay.asp-active {
    display: flex;
}

.asp-search-overlay .asp-search-container {
    width: 90%;
    max-width: 640px;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    position: relative;
    animation: asp-slide-down 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

@keyframes asp-slide-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.asp-close-search {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.asp-close-search:hover {
    background: #e5e7eb;
    color: #374151;
}

.asp-open-search-btn {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    transition: border-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
}

.asp-open-search-btn:hover {
    border-color: #2563eb;
}

/* Custom Meta Fields Display */
.asp-result-custom-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.asp-meta-item {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 3px;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .asp-search-container {
        margin: 0 16px;
    }
    
    .asp-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 20px;
    }
    
    .asp-search-btn {
        padding: 14px 20px;
    }
    
    .asp-result-item {
        padding: 14px 16px;
    }
    
    .asp-result-image img,
    .asp-result-image.asp-no-image {
        width: 50px;
        height: 50px;
    }
    
    .asp-result-title {
        font-size: 15px;
    }
    
    .asp-result-excerpt {
        font-size: 13px;
    }
    
    .asp-search-overlay .asp-search-container {
        width: 95%;
        padding: 24px;
        margin-top: 20px;
    }
}



/* Accessibility Improvements */
.asp-search-input:focus,
.asp-search-btn:focus,
.asp-load-more-btn:focus,
.asp-open-search-btn:focus,
.asp-close-search:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.asp-result-item:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .asp-search-input-wrapper {
        border-color: #000;
    }
    
    .asp-search-btn {
        background: #000;
    }
    
    .asp-result-item {
        border-color: #000;
    }
}



/* Additional Styles Later */

.asp-search-input-wrapper input[type="text"] {
	border: none;
}

.asp-search-input-wrapper {
	border: none;
}

.asp-search-input:focus {
	outline: none;
	outline-offset: 0;
}

.asp-search-btn:focus, .asp-load-more-btn:focus, .asp-open-search-btn:focus, .asp-close-search:focus {
	outline: 0;
}

.asp-result-item:focus {
	outline: none;
}

.asp-search-btn:focus {
	background: inherit;
}










