/**
 * Semantic Search Styles
 * Styles for the AI-powered semantic search interface
 */

.semantic-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    margin-top: 8px;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.search-no-results {
    padding: 20px;
    text-align: center;
}

.search-no-results p {
    margin: 10px 0;
    color: #666;
}

.search-suggestion {
    font-size: 0.9em;
    color: #999;
}

.search-error {
    padding: 20px;
    text-align: center;
    color: #d32f2f;
}

.search-results-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    font-size: 0.9em;
}

.search-results-header strong {
    color: #2980b9;
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f7f7f7;
}

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

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.search-result-title {
    color: #2980b9;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05em;
    flex: 1;
    margin-right: 12px;
}

.search-result-title:hover {
    text-decoration: underline;
    color: #1a5a8a;
}

.search-result-title mark {
    background-color: #fff59d;
    color: inherit;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.search-result-version {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 500;
    white-space: nowrap;
}

.search-result-excerpt {
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 8px 0;
}

.search-result-excerpt mark {
    background-color: #fff59d;
    color: inherit;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}

.search-result-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.search-result-relevance {
    font-size: 0.75em;
    color: #888;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .semantic-search-results {
        background: #2b2b2b;
        border-color: #444;
    }

    .search-results-header {
        background: #333;
        border-bottom-color: #444;
    }

    .search-result-item {
        border-bottom-color: #3a3a3a;
    }

    .search-result-item:hover {
        background-color: #333;
    }

    .search-result-title {
        color: #64b5f6;
    }

    .search-result-title:hover {
        color: #90caf9;
    }

    .search-result-excerpt {
        color: #ccc;
    }

    .search-result-version {
        background: #1e3a5f;
        color: #64b5f6;
    }

    .search-result-relevance {
        background: #3a3a3a;
        color: #999;
    }

    .search-no-results p {
        color: #aaa;
    }

    .search-suggestion {
        color: #777;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .semantic-search-results {
        max-height: 400px;
    }

    .search-result-item {
        padding: 12px;
    }

    .search-result-header {
        flex-direction: column;
    }

    .search-result-version {
        margin-top: 4px;
        align-self: flex-start;
    }
}

/* Print styles */
@media print {
    .semantic-search-results {
        display: none;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.search-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Search input enhancement */
.wy-side-nav-search input[type="text"] {
    position: relative;
}

/* Ensure search container has relative positioning for absolute results */
.wy-side-nav-search {
    position: relative;
}
