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

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

/* Search Container */
.search-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Input Section */
.search-input-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #888;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.search-input:focus {
    border-color: #4a90e2;
}

.search-input::placeholder {
    color: #aaa;
}

/* Results Section */
.search-results-section {
    flex: 1;
    overflow-y: auto;
    max-height: calc(70vh - 100px);
}

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

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item:hover,
.search-result-item.keyboard-selected {
    background-color: #f5f9ff;
}

.search-result-item.keyboard-selected {
    border-left: 3px solid #4a90e2;
}

.search-result-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    word-wrap: break-word;
    line-height: 1.4;
}

.search-result-text .highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

.search-result-shadow-tag {
    color: #999;
    font-style: italic;
    font-size: 13px;
    font-weight: 400;
    margin-left: 6px;
}

.search-result-meta {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-type {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-type.type-node {
    background-color: #dbeafe;
    color: #1e40af;
}

.search-result-type.type-comment {
    background-color: #fef3c7;
    color: #92400e;
}

.search-result-type.type-link {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.search-result-view {
    color: #888;
    font-style: italic;
}

/* Empty State */
.search-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

.search-empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.search-empty-state-text {
    font-size: 15px;
}

/* Info Footer */
.search-info-footer {
    padding: 10px 20px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-keyboard-hints {
    display: flex;
    gap: 12px;
}

.keyboard-hint {
    display: flex;
    align-items: center;
    gap: 4px;
}

.keyboard-hint kbd {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: monospace;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Scrollbar Styling */
.search-results-section::-webkit-scrollbar {
    width: 8px;
}

.search-results-section::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results-section::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.search-results-section::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
