/* Tool Search Styles */

.search-container {
    max-width: 700px;
    margin: 2rem auto;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg, #ffffff);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-box:focus-within {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

.search-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    opacity: 0.6;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-color, #1f2937);
}

.search-input::placeholder {
    color: var(--text-secondary, #6b7280);
}

.clear-search {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary, #6b7280);
    transition: color 0.2s ease;
    border-radius: 4px;
}

.clear-search:hover {
    color: var(--text-color, #1f2937);
    background: var(--hover-bg, #f3f4f6);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--card-bg, #ffffff);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.search-results-header {
    padding: 0.75rem 1rem;
    background: var(--hover-bg, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
}

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

.search-result-item:hover {
    background: var(--hover-bg, #f3f4f6);
}

.search-result-icon {
    font-size: 2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

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

.search-result-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color, #1f2937);
}

.search-result-description {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.search-result-match {
    font-size: 0.75rem;
    color: var(--primary-color, #2563eb);
    font-weight: 500;
}

.search-result-category {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--hover-bg, #f3f4f6);
    border-radius: 4px;
    margin-top: 0.5rem;
    color: #1f2937;
    font-weight: 500;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary, #6b7280);
}

.search-no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-no-results-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.search-no-results-hint {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Highlight matched text */
.search-highlight {
    background: rgba(37, 99, 235, 0.15);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Dark mode support */
[data-theme="dark"] .search-box {
    background: var(--card-bg-dark, #1f2937);
    border-color: var(--border-color-dark, #374151);
}

[data-theme="dark"] .search-input {
    color: var(--text-color-dark, #f9fafb);
}

[data-theme="dark"] .search-results {
    background: var(--card-bg-dark, #1f2937);
    border-color: var(--border-color-dark, #374151);
}

[data-theme="dark"] .search-results-header {
    background: var(--hover-bg-dark, #111827);
}

[data-theme="dark"] .search-result-item:hover {
    background: var(--hover-bg-dark, #374151);
}

[data-theme="dark"] .search-result-title {
    color: var(--text-color-dark, #f9fafb);
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        margin: 1.5rem 1rem;
    }

    .search-input {
        font-size: 0.9rem;
    }

    .search-input::placeholder {
        font-size: 0.85rem;
    }

    .search-results {
        max-height: 400px;
    }

    .search-result-item {
        padding: 0.75rem;
    }

    .search-result-icon {
        font-size: 1.5rem;
        margin-right: 0.75rem;
    }
}

/* Smooth animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results {
    animation: slideDown 0.2s ease;
}
