/* ===== Search Modal ===== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

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

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    background: var(--color-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: slideDown var(--transition-base);
}

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

.search-modal-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.search-input {
    flex: 1;
    font-size: var(--font-size-lg);
    font-family: var(--font-sans);
    padding: var(--spacing-sm) 0;
    border: none;
    background: transparent;
    color: var(--color-text);
    outline: none;
}

.search-input::placeholder {
    color: var(--color-text-tertiary);
}

.search-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-close:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.search-hint {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    margin: var(--spacing-xl) 0;
}

.search-result-item {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    background: var(--color-bg-secondary);
}

.search-result-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.search-result-title a {
    color: var(--color-text);
}

.search-result-title a:hover {
    color: var(--color-accent);
}

.search-result-excerpt {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

.search-result-excerpt mark {
    background: rgba(0, 122, 255, 0.15);
    color: var(--color-accent);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .search-modal-content {
        width: 95%;
        max-height: 80vh;
    }
}
