/**
 * WhyAgency Search - Predictive Search Styles
 */

.whyagency-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0px 8px 24px rgba(20, 21, 22, 0.15);
    z-index: 1000;
    max-height: 500px;
    overflow: hidden;
}

.suggestions-inner {
    max-height: 450px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f4fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f0f4fa;
}

.suggestion-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f4fa;
}

.suggestion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    color: #2d2d2f;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.suggestion-excerpt {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #6b7280;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.suggestion-matched {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.suggestion-matched strong {
    color: #0066b3;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-matched mark {
    background: #fef08a;
    color: #854d0e;
    padding: 2px 0px 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.suggestion-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.suggestion-type {
    display: inline-block;
    padding: 4px 8px;
    background: #a2b9e040;
    border-radius: 4px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #0066b3;
    text-transform: capitalize;
}

.suggestion-date {
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    color: #9ca3af;
}

.suggestion-footer {
    padding: 12px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* Loading state */
.suggestions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f4fa;
    border-top-color: #0066b3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.whyagency-search-suggestions.loading::before {
    content: '';
    display: block;
    padding: 24px;
    text-align: center;
    color: #9ca3af;
}

/* Taxonomy Results Styles */
.suggestion-taxonomy {
    background-color: #fefce8;
}

.suggestion-taxonomy:hover,
.suggestion-taxonomy.selected {
    background-color: #fef08a;
}

.suggestion-taxonomy-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #fde047;
    border-radius: 8px;
}

.suggestion-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #0066b3;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .suggestion-item {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .suggestion-image {
        width: 50px;
        height: 50px;
    }
    
    .suggestion-title {
        font-size: 14px;
    }
    
    .suggestion-excerpt {
        font-size: 13px;
    }
}

/* Scrollbar styling */
.suggestions-inner::-webkit-scrollbar {
    width: 6px;
}

.suggestions-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.suggestions-inner::-webkit-scrollbar-thumb {
    background: #c9d1e0;
    border-radius: 3px;
}

.suggestions-inner::-webkit-scrollbar-thumb:hover {
    background: #a2b9e0;
}

/* Suggested Keywords Styles */
.suggestions-keywords {
    padding: 16px 0;
}

.suggestions-section {
    padding: 8px 0;
}

.suggestions-section:not(:last-child) {
    border-bottom: 1px solid #f0f4fa;
}

.suggestions-section-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #6b7280;
    padding: 8px 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-keyword-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-keyword-item:hover {
    background-color: #f0f4fa;
}

.keyword-icon {
    flex-shrink: 0;
    font-size: 18px;
}

.keyword-text {
    flex: 1;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #2d2d2f;
}

.keyword-count {
    flex-shrink: 0;
    padding: 2px 8px;
    background: #e5e7eb;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

/* Inline Predictive Results (not dropdown) */
.whyagency-predictive-results {
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whyagency-predictive-results.hidden {
    display: none;
}

/* Line clamp utility for text truncation */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Predictive Results Minimal Styling */
.whyagency-predictive-results {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.whyagency-predictive-results.hidden {
    display: none;
}

/* Smooth scrolling for results */
.predictive-results-container {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb #f9fafb;
}

.predictive-results-container::-webkit-scrollbar {
    width: 5px;
}

.predictive-results-container::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 0 12px 12px 0;
}

.predictive-results-container::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 10px;
    transition: background 0.2s;
}

.predictive-results-container::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}
